/* ATTCEI — static site stylesheet. No JavaScript anywhere.
 *
 * The palette is sampled from the logo artwork rather than the old theme's
 * settings: burnt orange #d07010 is 41% of the wordmark's pixels, the owl's
 * eyes are gold #f0a000, and its body is a desaturated slate. Header and
 * footer are near-black because the original attcei.org header was #000000 —
 * the orange mark is drawn to sit on dark.
 */

:root {
  /* --- sampled from the logo ----------------------------------------- */
  --brand:       #d07010;   /* wordmark orange — decorative, or on dark */
  --brand-gold:  #f0a000;   /* owl eyes — highlight on dark, 8.27:1 */
  --brand-deep:  #a85b0d;   /* links and solid fills: 5.04:1 with white */
  --brand-hover: #8c4a09;
  --slate:       #506060;   /* owl body — muted text, 6.60:1 */

  /* --- surfaces ------------------------------------------------------- */
  --shell:   #15181a;       /* header + footer */
  --ink:     #20262a;
  --body:    #4a5257;
  --bg:      #ffffff;
  --bg-alt:  #f7f5f3;
  --line:    #e8e3de;       /* decorative dividers */
  --line-strong: #8e8880;   /* borders of interactive elements, >= 3:1 */

  --max: 1140px;
  --gap: 1.5rem;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(21,24,26,.06), 0 2px 8px rgba(21,24,26,.05);
  --shadow-md: 0 2px 4px rgba(21,24,26,.07), 0 12px 28px rgba(21,24,26,.10);
  --ease: 180ms cubic-bezier(.2,.6,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;   /* sticky header height plus breathing room */
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--body);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .6em;
  font-weight: 750;
  letter-spacing: -.021em;   /* the wordmark is tight and heavy; echo it */
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.15rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); letter-spacing: -.012em; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand-deep);
  text-decoration: none;
  text-underline-offset: .18em;
  transition: color var(--ease);
}
a:hover, a:focus { color: var(--brand-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; border: 0; }

:focus-visible {
  /* White halo inside a dark outline, so the ring reads on white, on the
     tinted bands, on the near-black shell and over the hero photograph. */
  outline: 3px solid var(--shell);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
  border-radius: 3px;
}

.container { max-width: var(--max); margin-inline: auto; padding-inline: 1.5rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand-deep); color: #fff; padding: .8rem 1.35rem;
  font-weight: 650; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* Visible to assistive tech only — the language switch shows "PT"/"EN"
   but announces "Português"/"English". */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--shell);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.header-inner {
  max-width: var(--max); margin-inline: auto;
  padding: .55rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; margin-right: auto; padding: .25rem 0; }
.brand img { display: block; width: 150px; height: 57px; }
.brand:hover { text-decoration: none; }

.nav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; flex-wrap: wrap; }

.nav a {
  display: flex; align-items: center;
  min-height: 44px;              /* pointer target */
  padding: .5rem .8rem;
  color: rgba(255,255,255,.88);
  font-size: .94rem; font-weight: 600;
  border-radius: 7px;
  transition: color var(--ease), background-color var(--ease);
}
.nav a:hover, .nav a:focus { color: #fff; background: rgba(255,255,255,.10); text-decoration: none; }

/* A bare "PT EN" pair reads as an abbreviation, not a control. The globe names
   what it is at a glance and the pill groups the two options, so the active one
   is visibly a choice among others rather than a label.

   It sits last in the bar, after the menu items, and last in reading order —
   the main navigation is what most visitors want first. Targets are 34px
   rather than the 44px used elsewhere: comfortably above the 24px WCAG 2.5.8
   floor, and this is a control people use once, not repeatedly. */
.lang {
  display: flex; align-items: center; gap: .05rem;
  font-size: .74rem; font-weight: 700;
  padding: .15rem .2rem .15rem .42rem;
  margin-left: .6rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
}
.lang-icon {
  display: grid; place-items: center;
  width: .95rem; height: .95rem; margin-right: .1rem;
  color: rgba(255,255,255,.6); flex: 0 0 auto;
}
.lang-icon svg { width: 100%; height: 100%; }
.lang a {
  display: grid; place-items: center;
  min-width: 34px; min-height: 34px;
  padding-inline: .4rem;
  color: rgba(255,255,255,.66);
  border-radius: 999px;
  letter-spacing: .03em;
  transition: color var(--ease), background-color var(--ease);
}
.lang a:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }
.lang [aria-current="true"] { color: var(--shell); background: var(--brand-gold); }

/* CSS-only menu driven by :target, not a checkbox. A checkbox stays checked
   when you tap a link, so the menu used to sit open over the section you had
   just jumped to. Following any other fragment clears :target. */
.nav-open, .nav-close {
  align-items: center; min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid rgba(255,255,255,.40); border-radius: 8px;  /* 3.81:1 on the shell */
  font-size: .88rem; font-weight: 700;
  color: #fff; text-decoration: none;
  transition: background-color var(--ease);
}
.nav-open:hover, .nav-close:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav-open { display: none; }
/* `.nav .nav-close` needs the extra specificity because `.nav a` sets display */
.nav .nav-close { display: none; margin: .5rem 0 .35rem; justify-content: center; }

/* -------------------------------------------------------------------- hero */

/* A scroll-snap track, not a JavaScript slider. Swiping, the arrow keys and
   the dot links below all work with scripting disabled; hero.js only adds
   auto-advance. */
.hero { position: relative; background: var(--shell); }

.hero-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;          /* the dots are the affordance */
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-track:focus-visible { outline-offset: -4px; }

.hero-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: grid; place-items: center;
  min-height: clamp(24rem, 62vh, 34rem);
  padding: clamp(4rem, 9vw, 6.5rem) 1.5rem clamp(5rem, 9vw, 7rem);
  color: #fff; text-align: center;
  background: var(--shell) center/cover no-repeat;
}
.hero-slide::before {
  content: ""; position: absolute; inset: 0;
  /* darkest at the top so each slide reads as continuous with the header */
  background: linear-gradient(180deg,
      rgba(21,24,26,.88) 0%, rgba(21,24,26,.60) 42%, rgba(21,24,26,.78) 100%);
}
.hero-inner { position: relative; max-width: 48rem; }

.hero-tunel       { background-image: url("../img/tunel.jpg"); }
.hero-tunel       { background-image: image-set(url("../img/tunel.webp") type("image/webp"), url("../img/tunel.jpg") type("image/jpeg")); }
.hero-science     { background-image: url("../img/science.jpg"); }
.hero-science     { background-image: image-set(url("../img/science.webp") type("image/webp"), url("../img/science.jpg") type("image/jpeg")); }
.hero-electronics { background-image: url("../img/electronics.jpg"); }
.hero-electronics { background-image: image-set(url("../img/electronics.webp") type("image/webp"), url("../img/electronics.jpg") type("image/jpeg")); }

.hero-slide h1, .hero-slide h2 { color: #fff; margin-bottom: .5em; }
.hero-slide h2 { font-size: clamp(2rem, 4.6vw, 3.15rem); }   /* same size as the h1 */
.hero-slide p {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  color: rgba(255,255,255,.93);
  max-width: 40rem; margin-inline: auto;
}

.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 1.5rem;
  display: flex; justify-content: center; gap: .35rem;
  z-index: 2;
}
.hero-dots a {
  display: grid; place-items: center;
  width: 44px; height: 44px;             /* pointer target around a small dot */
  border-radius: 50%;
}
.hero-dots a::before {
  content: ""; display: block;
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(255,255,255,.45);
  border: 2px solid rgba(255,255,255,.85);
  transition: background-color var(--ease), transform var(--ease);
}
.hero-dots a:hover::before { background: #fff; transform: scale(1.15); }
/* :target marks the slide the dots point at, so the active dot needs no script */
.hero-slide:target ~ .hero-dots a { background: none; }
.hero-dots a:focus-visible { outline-offset: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; margin-top: 1.1rem;
  padding: .8rem 2rem;
  background: var(--brand-deep); color: #fff;
  font-weight: 700;
  border: 2px solid var(--brand-deep); border-radius: 8px;
  transition: background-color var(--ease), border-color var(--ease),
              transform var(--ease), box-shadow var(--ease);
}
.btn:hover, .btn:focus {
  background: var(--brand-hover); border-color: var(--brand-hover);
  color: #fff; text-decoration: none;
  transform: translateY(-1px); box-shadow: var(--shadow-md);
}
.btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.85); }
.btn-ghost:hover, .btn-ghost:focus { background: #fff; border-color: #fff; color: var(--ink); }

/* ---------------------------------------------------------------- sections */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 46rem; margin: 0 auto clamp(2rem, 4.5vw, 3rem); text-align: center; }
.section-head p { color: var(--slate); font-size: 1.05rem; }
.section-head h2 { margin-bottom: .45em; }
.section-head h2::after {
  content: ""; display: block;
  width: 52px; height: 4px; border-radius: 4px;
  /* wordmark orange running into the owl's gold */
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-gold) 100%);
  margin: .8rem auto 0;
}

/* Decorative image band. Not background-attachment:fixed — that forces a
   repaint every scroll frame and iOS Safari renders it at the wrong scale. */
.band {
  position: relative; padding: clamp(3rem, 7vw, 4.5rem) 1.5rem;
  background: var(--shell) center/cover no-repeat;
}
.band::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(21,24,26,.72), rgba(21,24,26,.58));
}
.band-cnc     { background-image: url("../img/band-cnc.jpg"); }
.band-cnc     { background-image: image-set(url("../img/band-cnc.webp") type("image/webp"), url("../img/band-cnc.jpg") type("image/jpeg")); }
.band-space   { background-image: url("../img/band-space.jpg"); }
.band-space   { background-image: image-set(url("../img/band-space.webp") type("image/webp"), url("../img/band-space.jpg") type("image/jpeg")); }
.band-circuit { background-image: url("../img/band-circuit.jpg"); }
.band-circuit { background-image: image-set(url("../img/band-circuit.webp") type("image/webp"), url("../img/band-circuit.jpg") type("image/jpeg")); }

/* ------------------------------------------------------------ grids, cards */

.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); }
/* 11.5rem, not 13.5: Direção has five members and 13.5rem only fitted four
   across the 1092px content column, orphaning the fifth onto its own row.
   auto-fit collapses the spare tracks, so the three-member groups still show
   three across rather than three-plus-gaps. */
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: .45em; }

/* value propositions carried over from the old JavaScript slider */
.value-card { border-top: 3px solid var(--brand); }
.value-card .num {
  display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--brand-deep); color: #fff;
  font-weight: 700; font-size: .95rem;
  margin-bottom: .85rem;
}

/* ~75 characters per line; the old 52rem measured about 98 and read poorly */
.prose { max-width: 44rem; margin-inline: auto; }
.prose h3 { margin-top: 2.4rem; }
.prose h3:first-child { margin-top: 0; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .3rem; }
.prose strong { color: var(--ink); font-weight: 700; }

/* -------------------------------------------------------------------- team */

.team-group { margin-bottom: 2.75rem; }
.team-group:last-child { margin-bottom: 0; }
.team-group > h3 {
  text-align: center; color: var(--slate); font-size: 1rem;
  text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
}

.person {
  text-align: center; padding: 1.5rem 1rem;
  background: #fff; border: 1px solid var(--line);
  border-top: 3px solid var(--brand-gold);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.person .name { font-weight: 700; color: var(--ink); }
.person .role { font-size: .89rem; color: var(--slate); }

/* -------------------------------------------------------------- logo walls */

.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 0; padding: 0; }
.logos li { list-style: none; }
.logo-item {
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 1.1rem; min-height: 8rem;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.logo-item img { max-height: 5rem; width: auto; object-fit: contain; }
a.logo-item:hover, a.logo-item:focus {
  border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px);
}

/* ----------------------------------------------------------- project cards */

.project-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.project-card .thumb {
  display: grid; place-items: center;
  background: var(--bg-alt); border-bottom: 1px solid var(--line);
  padding: 1rem; min-height: 7.5rem;
}
.project-card .thumb img { max-height: 5.5rem; width: auto; object-fit: contain; }
.project-card .body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.project-card h3 { font-size: 1.08rem; margin-bottom: .5em; }
.project-card p { font-size: .95rem; color: var(--body); }
.project-card .more { margin-top: auto; padding-top: 1rem; font-weight: 700; font-size: .89rem; color: var(--brand-deep); }
.project-card:hover, .project-card:focus-visible {
  border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-3px);
}

/* ----------------------------------------------------------------- contact */

.contact-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--gap); list-style: none; margin: 0; padding: 0;
}
.contact-list li {
  text-align: center; padding: 2rem 1.25rem;
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.contact-list .icon {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; margin: 0 auto .9rem;
  border-radius: 50%; background: var(--bg-alt); color: var(--brand-deep);
}
.contact-list .icon svg { width: 1.35rem; height: 1.35rem; }
.contact-list .label {
  display: block; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--slate); font-weight: 700; margin-bottom: .4rem;
}
.contact-list .value { font-weight: 600; color: var(--ink); font-style: normal; }

/* ----------------------------------------------------------- article pages */

.page-hero { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: clamp(2.5rem, 5vw, 4rem) 0; }
.page-hero h1 { margin-bottom: 0; }
.breadcrumb { font-size: .87rem; color: var(--slate); margin-bottom: .7rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.breadcrumb li::after { content: "›"; margin-left: .45rem; color: var(--line-strong); }
.breadcrumb li:last-child::after { content: ""; }

.article { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.article-media { float: right; margin: .3rem 0 1.35rem 2rem; max-width: 15rem; }
.article-media img {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; padding: .9rem; box-shadow: var(--shadow-sm);
}

.pager {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  border-top: 1px solid var(--line); margin-top: 2.75rem; padding-top: 1.6rem;
}
.pager a { font-weight: 650; }

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--shell); color: rgba(255,255,255,.62); padding: 3.25rem 0 2rem; font-size: .94rem; }
.site-footer h2 {
  color: #fff; font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem;
}
.site-footer a { color: rgba(255,255,255,.82); }
.site-footer a:hover { color: var(--brand-gold); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2.5rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .1rem; }
/* inline-block padding lifts these from ~18px to a usable target */
.footer-grid li a { display: inline-block; padding: .45rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 2.5rem; padding-top: 1.4rem;
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between;
  font-size: .87rem; color: rgba(255,255,255,.5);
}

/* -------------------------------------------------------------- responsive */

/* 1100px, not 900: with seven menu items the bar wraps onto a second row
   below about 1160px, which doubles the sticky header's height and makes
   scroll-padding-top land anchors underneath it. The collapsed menu is the
   better answer for that range. */
@media (max-width: 1160px) {
  .nav-open { display: inline-flex; order: 3; padding: .5rem .8rem; }
  .nav { order: 4; flex-basis: 100%; display: none; }
  .nav:target { display: block; }
  /* Swap Menu for Fechar while open. :has() is needed because the button
     precedes the nav in the DOM (correct reading order); where unsupported
     the button simply stays visible, which is harmless. */
  .header-inner:has(.nav:target) .nav-open { display: none; }
  .nav ul { flex-direction: column; gap: 0; padding-bottom: .25rem; }
  .nav a { padding: .75rem .5rem; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.10); }
  .nav .nav-close { display: flex; width: 100%; }
  .lang { order: 2; margin-left: 0; }
  .article-media { float: none; margin: 0 auto 1.75rem; }
}

/* At 390px the brand, language pair and Menu button overflow one row once the
   targets are big enough to tap; a smaller wordmark keeps the header to a
   single row instead of a two-row block. */
@media (max-width: 460px) {
  .header-inner { gap: .5rem; padding-inline: 1rem; }
  .brand img { width: 118px; height: 45px; }
  .container { padding-inline: 1.15rem; }
  .card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .btn:hover, .project-card:hover, .logo-item:hover { transform: none; }
}

@media print {
  .site-header, .band, .site-footer, .btn, .pager, .breadcrumb { display: none; }
  body { color: #000; font-size: 11pt; }
  /* print the first slide only — the other two are the same pitch rephrased */
  .hero { background: none; }
  .hero-track { display: block; overflow: visible; }
  .hero-slide { display: none; }
  .hero-slide:first-child { display: block; min-height: 0; padding: 0 0 1rem; background: none; color: #000; }
  .hero-slide::before { display: none; }
  .hero-slide h1 { color: #000; }
  .hero-dots { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
