/* =========================================================================
   Alicia Alfonso — Portfolio
   One accent, warm neutrals, no italics. All text pairs ≥ 7:1 (WCAG AAA).
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #fbf9f6;          /* page */
  --bg-alt: #f3efea;      /* alternate section band */
  --surface: #ffffff;     /* cards, form */
  --text: #1d1719;
  --muted: #5a5053;
  --line: rgba(29, 23, 25, .12);
  --accent: #8a1f48;
  --accent-ink: #ffffff;
  --accent-soft: rgba(138, 31, 72, .08);
  --shadow: 0 1px 2px rgba(29, 23, 25, .04), 0 12px 32px -18px rgba(29, 23, 25, .28);

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 10px;
  --pad: clamp(24px, 4vw, 48px);
  --section: clamp(80px, 10vw, 128px);
  --measure: 68ch;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141112;
  --bg-alt: #1c1819;
  --surface: #241f21;
  --text: #f4efec;
  --muted: #bdb3b5;
  --line: rgba(244, 239, 236, .12);
  --accent: #eba2bd;
  --accent-ink: #1a1013;
  --accent-soft: rgba(235, 162, 189, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
img[width][height], video[width][height] { height: auto; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
figure { margin: 0; }
p { margin: 0 0 1em; }
em { font-style: normal; color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -80px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 16px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
.kicker { font: 600 14px/1.4 var(--sans); color: var(--muted); margin: 0 0 16px; }
.mini { font: 600 14px/1.4 var(--sans); color: var(--text); margin: 40px 0 12px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__main { display: flex; align-items: center; gap: 4px; }
.nav__home { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 99px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); transition: color .2s, background-color .2s; }
.nav__home svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav__home:hover { color: var(--text); background: var(--accent-soft); }
.nav__home.is-active { color: var(--accent); background: var(--accent-soft); }
.nav__links { display: flex; gap: 4px; }
.nav__links a { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted); padding: 10px 14px; border-radius: 99px; transition: color .2s, background-color .2s; }
.nav__links a:hover { color: var(--text); background: var(--accent-soft); }
.nav__links a.is-active { color: var(--accent); background: var(--accent-soft); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.seg button { min-width: 44px; height: 38px; border: 0; background: none; font-size: 13px; font-weight: 600; border-radius: 99px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: transparent; border-radius: 99px; transition: background-color .2s; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }
.nav__burger { display: none; }
.mobile-menu { position: fixed; z-index: 49; inset: 72px 0 auto; padding: 8px var(--pad) 20px; background: var(--bg); border-bottom: 1px solid var(--line); display: grid; }
.mobile-menu[hidden] { display: none; }
.mobile-menu a { font-size: 18px; font-weight: 500; text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line); }

/* ---------- Bands & section headers ---------- */
.band { background: var(--bg); }
.band--alt { background: var(--bg-alt); }
.section { padding: var(--section) 0; }
.sec-head { max-width: 860px; margin-bottom: clamp(40px, 5vw, 64px); }
.sec-label { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font: 600 14px/1.4 var(--sans); color: var(--muted); margin: 0 0 20px; }
.sec-num { color: var(--accent); display: inline-flex; align-items: center; gap: 12px; }
.sec-num::after { content: ''; width: 32px; height: 1px; background: currentColor; }
.sec-meta { color: var(--muted); font-weight: 500; }
.sec-meta::before { content: '·'; margin-right: 12px; }
.sec-title { margin: 0; font: 500 clamp(38px, 4.6vw, 64px)/1.08 var(--serif); letter-spacing: -.015em; text-wrap: balance; }
.sec-lead { font-size: clamp(18px, 1.5vw, 20px); color: var(--muted); max-width: var(--measure); margin: 20px 0 0; }

/* ---------- Hero ---------- */
.hero { padding: 136px 0 72px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero__title { margin: 0; font: 500 clamp(44px, 5.8vw, 84px)/1.04 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.hero__sub { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 54ch; margin: 24px 0 32px; }
.hero__meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 40px; margin: 0 0 36px; padding: 20px 0; border-block: 1px solid var(--line); }
.hero__meta dt { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.hero__meta dd { margin: 0; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1f8a5b; box-shadow: 0 0 0 4px rgba(31, 138, 91, .16); flex: none; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__photo img { width: 100%; border-radius: var(--radius); }
.clients { margin-top: clamp(56px, 7vw, 96px); padding-top: 28px; border-top: 1px solid var(--line); }
.clients__title { margin: 0 0 20px; font-size: 14px; font-weight: 600; color: var(--muted); }
/* Logo banner: two identical tracks slide left forever; hover or focus pauses it */
.logos { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.logos__track { list-style: none; margin: 0; padding: 0 8px 0 0; display: flex; gap: 8px; flex: none; animation: logos 48s linear infinite; }
.logos:hover .logos__track, .logos:focus-within .logos__track { animation-play-state: paused; }
@keyframes logos { to { transform: translateX(-100%); } }
.logo { flex: none; width: 168px; height: 80px; display: grid; place-items: center; padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.logo img { max-width: 100%; max-height: 44px; width: auto; height: auto; }

/* ---------- Buttons, chips, pills ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: 600 15px/1 var(--sans); border-radius: 99px; text-decoration: none; transition: filter .2s, transform .2s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--text); filter: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chips span { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 99px; background: var(--accent-soft); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; font-size: 15px; font-weight: 500; text-decoration: none; border: 1px solid var(--line); border-radius: 99px; transition: border-color .2s, background-color .2s; }
.pill:hover { border-color: var(--text); }
.chips--tools span { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* ---------- 01 TapTap Digital ---------- */
.tt-stats { list-style: none; margin: 0 0 48px; padding: 24px 0; display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.tt-stats li { display: grid; gap: 4px; padding-right: 20px; }
.tt-stats li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.tt-stats strong { font: 500 clamp(28px, 2.8vw, 38px)/1.1 var(--serif); }
.tt-stats span { font-size: 15px; color: var(--muted); line-height: 1.45; }
.tt-tabs, .filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.tt-tabs button, .filters button { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; font-size: 15px; font-weight: 500; color: var(--muted); transition: color .2s, border-color .2s, background-color .2s; }
.tt-tabs button:hover, .filters button:hover { color: var(--text); border-color: var(--text); }
.tt-tabs button[aria-selected="true"], .filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tt-panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: center; animation: fade .4s ease; }
.tt-panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.tt-panel__text h3 { margin: 0 0 16px; font: 500 clamp(28px, 2.6vw, 36px)/1.15 var(--serif); letter-spacing: -.01em; }
.tt-panel__text > p { color: var(--muted); }
.tt-panel__text b { color: var(--text); font-weight: 600; }
.ticks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.55; }
.ticks li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tt-shot { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tt-shot img { width: 100%; }
.gallery { grid-column: 1 / -1; margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gallery figure { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.gallery figure:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; }
.gallery figcaption { flex: 1; padding: 12px 16px; font-size: 14px; line-height: 1.45; color: var(--muted); border-top: 1px solid var(--line); }
[data-lightbox] { cursor: zoom-in; }
[data-lightbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- 02 Projects ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
@media (min-width: 1081px) {
  /* 10 cards in 3 columns: the last one spans the full row, image left, so no card is left alone */
  .grid .card:last-child:nth-child(3n+1) { grid-column: 1 / -1; flex-direction: row; }
  .grid .card:last-child:nth-child(3n+1) .card__media { width: calc((100% - 48px) / 3); flex: none; }
  .grid .card:last-child:nth-child(3n+1) .card__body { padding: 32px; justify-content: center; }
  .grid .card:last-child:nth-child(3n+1) .card__foot { margin-top: 8px; }
}
.card { width: 100%; margin: 0; display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .3s ease, box-shadow .3s ease; animation: fade .4s ease both; }
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 4 / 5; background: #f6f6f4; overflow: hidden; }
.card__media img { width: 100%; height: 100%; transition: transform .6s ease; }
.card__media--video { display: flex; justify-content: center; background: #2a2523; }
.card__media--video::before { content: ''; position: absolute; inset: -24px; background: var(--poster) center / cover; filter: blur(22px) brightness(.85); }
.card__media--video video { position: relative; height: 100%; width: auto; max-width: 100%; }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { flex: 1; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.card__year { font-size: 14px; font-weight: 600; color: var(--accent); }
.card__title { margin: 0; font: 500 25px/1.2 var(--serif); letter-spacing: -.01em; }
.card__client { font-size: 14px; color: var(--muted); }
.card__desc { margin: 6px 0 0; font-size: 16px; color: var(--muted); line-height: 1.55; }
.card__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: auto; padding-top: 16px; }
.card__foot .chips { flex: 1; }
.card__go { width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line); display: grid; place-items: center; flex: none; transition: background-color .2s, color .2s, border-color .2s; }
.card:hover .card__go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.card__go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.more { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line); }
.more__title { margin: 0 0 16px; font: 500 28px/1.2 var(--serif); }
.more__list { list-style: none; padding: 0; margin: 0; columns: 2 420px; column-gap: 48px; }
.more__list li { break-inside: avoid; display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.5; }
.more__list span { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.75; }

/* ---------- 03 Method ---------- */
.process { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.process__n { display: block; font: 500 40px/1 var(--serif); color: var(--accent); margin-bottom: 20px; }
.process h3 { margin: 0 0 8px; font: 500 25px/1.2 var(--serif); }
.process p { margin: 0; font-size: 16px; color: var(--muted); }
.numbers { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.numbers li { padding-top: 20px; border-top: 1px solid var(--line); }
.numbers strong { display: block; font: 500 clamp(48px, 5.4vw, 76px)/1 var(--serif); letter-spacing: -.02em; }
.numbers span { display: block; margin-top: 8px; font-size: 15px; color: var(--muted); max-width: 22ch; }

/* ---------- Ways of working ---------- */
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.way { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 24px 28px; }
.way h3 { margin: 0 0 8px; font: 500 24px/1.25 var(--serif); }
.way p { margin: 0; font-size: 16px; color: var(--muted); max-width: 60ch; }

/* ---------- Glossary & search ---------- */
.glossary { margin-top: 56px; padding: clamp(24px, 3vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 48px; align-items: center; }
.glossary__title { margin: 0 0 8px; font: 500 clamp(26px, 2.4vw, 32px)/1.2 var(--serif); }
.glossary__lead { margin: 0; color: var(--muted); }
.glossary__actions { display: grid; gap: 16px; justify-items: start; }
.glossary__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--bg); border-radius: 99px; font-size: 14px; font-weight: 500; color: var(--text); transition: border-color .2s, color .2s; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.search { position: fixed; inset: 0; z-index: 85; display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; }
.search[hidden] { display: none; }
.search__backdrop { position: absolute; inset: 0; background: rgba(20, 17, 18, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .2s; }
.search__panel { position: relative; width: min(720px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: pop .25s ease; }
.search__bar { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 28px; border-bottom: 1px solid var(--line); }
.search__bar > svg, .glossary .btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search__bar > svg { color: var(--muted); }
.search__bar input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: transparent; font: 400 18px/1.4 var(--sans); color: var(--text); }
.search__bar input:focus { outline: none; }
.search__bar input::-webkit-search-cancel-button { display: none; }
.search__count { margin: 0; padding: 20px 32px 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.search__results { list-style: none; margin: 0; padding: 4px 32px 24px; overflow-y: auto; }
.search__results.is-start { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.search__results.is-start li { list-style: none; }
.term { padding: 20px 0; border-bottom: 1px solid var(--line); }
.term:last-child { border-bottom: 0; }
.term__name { margin: 0 0 4px; font: 500 22px/1.25 var(--serif); }
.term__def { margin: 0 0 8px; font-size: 16px; color: var(--muted); max-width: 58ch; }
.term__where { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0; font-size: 14px; color: var(--muted); }
.term__link { min-height: 32px; padding: 0; text-align: left; border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--accent); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.term__link:hover { text-decoration-color: currentColor; }
.search__hint { margin: 0; padding: 14px 32px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- 04 About ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.about__photo { position: sticky; top: 104px; }
.about__photo img { width: 100%; border-radius: var(--radius); }
.quote { margin: 0 0 32px; padding-left: 24px; border-left: 3px solid var(--accent); font: 500 clamp(24px, 2.4vw, 32px)/1.3 var(--serif); max-width: 32ch; }
.about__text > p { max-width: var(--measure); color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.timeline .t-years { font-size: 14px; font-weight: 500; color: var(--muted); }
.timeline .t-org { font: 500 20px/1.3 var(--serif); }
.timeline .t-role { font-size: 15px; color: var(--muted); line-height: 1.5; }
.badge { display: inline-block; margin-left: 8px; vertical-align: 3px; font: 600 13px/1 var(--sans); padding: 4px 9px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.skills { list-style: none; padding: 0; margin: 0; }
.skills li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.skills b { color: var(--text); font-weight: 600; }

/* ---------- 05 Contact ---------- */
.contact .sec-title { color: var(--accent); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact__grid .mini { margin-top: 0; }
.contact__mail { display: inline-block; padding-block: 6px; font: 500 clamp(24px, 2.6vw, 34px)/1.25 var(--serif); text-decoration: none; border-bottom: 1px solid var(--accent); word-break: break-word; }
.contact__mail:hover { color: var(--accent); }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 3vw, 36px); }
.field { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.field input, .field textarea { width: 100%; font: 400 17px/1.5 var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-height: 48px; resize: vertical; transition: border-color .2s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--text); border-width: 2px; padding: 11px 13px; }
.form .btn { justify-self: start; }
.form__note { margin: 0; min-height: 1.5em; font-size: 15px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--bg); border-top: 1px solid var(--line); }
.footer__row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------- Floating back to top (always visible) ---------- */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 99px; background: var(--surface); color: var(--accent); border: 1px solid var(--accent); box-shadow: var(--shadow); text-decoration: none; transition: background-color .2s, color .2s, transform .2s; }
.to-top:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer__row { padding-right: 72px; }

/* ---------- Case study modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 17, 18, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .25s; }
.modal__panel { position: relative; width: min(1080px, 100%); max-height: calc(100svh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; animation: pop .35s ease; }
.modal__panel:focus { outline: none; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px); } }
.modal__close { position: sticky; top: 16px; float: right; margin: 16px 16px 0 0; z-index: 2; background: var(--surface); }
.modal__body { padding: clamp(28px, 5vw, 64px); }
.modal__body > .eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 12px; }
.case__title { margin: 0 0 16px; font: 500 clamp(36px, 4.6vw, 60px)/1.08 var(--serif); letter-spacing: -.015em; }
.case__summary { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: var(--measure); margin: 0; }
.case__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; padding: 20px 0; border-block: 1px solid var(--line); }
.case__meta dt { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.case__meta dd { margin: 0; font-size: 16px; }
.case__hero { width: fit-content; max-width: 100%; margin: 0 auto 48px; border-radius: var(--radius); overflow: hidden; }
.case__hero img { width: auto; max-width: 100%; max-height: min(68vh, 680px); }
.case__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.case__cols h3 { margin: 0 0 12px; font: 500 22px/1.25 var(--serif); }
.case__cols p, .case__cols li { font-size: 16px; color: var(--muted); line-height: 1.6; }
.case__cols p { margin: 0; }
.case__imgs { margin-top: 48px; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.case__imgs figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.case__imgs img { width: auto; max-width: 100%; max-height: min(68vh, 680px); }
.case__videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 48px; }
.case__videos video { width: 100%; max-height: 68vh; border-radius: var(--radius); background: #000; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(12, 10, 11, .94); display: grid; place-items: center; padding: 64px 16px 16px; overflow: auto; animation: fadeIn .2s; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1600px, 100%); border-radius: 8px; }
.lightbox__close { position: fixed; top: 12px; right: 12px; color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .4); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav__links a { padding: 10px 10px; font-size: 14px; }
  .tt-panel { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glossary { grid-template-columns: 1fr; }
  .case__cols { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-grid; }
  .nav__home { width: 44px; padding: 0; justify-content: center; border: 1px solid var(--line); }
  .nav__home span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero { padding-top: 112px; }
  .hero__grid, .about__grid, .contact__grid, .cols { grid-template-columns: 1fr; }
  .hero__photo { max-width: 440px; }
  .about__photo { position: static; max-width: 440px; }
  .tt-stats { grid-template-columns: 1fr 1fr; gap: 20px 0; }
  .tt-stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .numbers { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero__meta { grid-template-columns: 1fr; gap: 14px; }
  .tt-tabs, .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); scrollbar-width: none; }
  .tt-tabs::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
  .tt-tabs button, .filters button { flex: none; }
  /* fade on the edge hints that the row scrolls sideways */
  .tt-tabs, .filters { padding-inline-end: 56px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .process { grid-template-columns: 1fr; }
  .grid, .gallery, .ways { grid-template-columns: 1fr; }
  .search { padding-top: 16px; }
  .search__panel { max-height: calc(100svh - 32px); }
  .skills li, .more__list li { grid-template-columns: 1fr; gap: 2px; }
  .case__meta { grid-template-columns: 1fr; }
  .nav__tools { gap: 6px; }
  .seg button { min-width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .logos { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .logos__track { animation: none; flex-wrap: wrap; }
  .logos__track[aria-hidden] { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Very small phones (320 px): keep the header tools inside the screen */
@media (max-width: 360px) {
  .nav { padding-left: 14px; padding-right: 14px; }
  .nav__tools { gap: 4px; }
}
