/* =========================================================
   Chan Design Studio — Landscape Architecture & Art Installation
   Quiet, minimal system. No framework, no build step.
   One accent only: italic serif for the titles of works.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;      /* light is the default; dark only via the header toggle */

  --bg: #ffffff;
  --ink: #111110;
  --ink-2: #3b3b39;
  --muted: #6b6b68;          /* 5.3:1 on white */
  --line: #e4e4e1;
  --danger: #b3261e;
  --brand-filter: none;      /* logo PNGs are black */
  --img-filter: grayscale(1);

  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;

  --fs-small: 0.8125rem;     /* 13px */
  --fs-ui: 0.9375rem;        /* 15px */
  --fs-body: 1rem;

  --gutter: clamp(16px, 4vw, 64px);
  --max: 1600px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

/* Dark: only when the visitor switches it on with the header toggle (html[data-theme="dark"]). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0d;
  --ink: #ecebe7;
  --ink-2: #c3c2bd;
  --muted: #94938e;
  --line: #2a2a28;
  --danger: #f2b8b5;
  --brand-filter: invert(1);
  --img-filter: grayscale(1) brightness(0.92);
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main { flex: 1 0 auto; }

/* Screen-fit pages (cover, projects): exactly one screen tall, no page scrollbar.
   dvh = the visible area, so browser toolbars (Chrome address bar, mobile bars)
   are already subtracted. The image area takes whatever height is left. */
body[data-page="home"], body[data-page="projects"] { height: 100vh; height: 100dvh; min-height: 0; }
body[data-page="home"] main, body[data-page="projects"] main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.3; }
ul, ol { list-style: none; padding: 0; }
address { font-style: normal; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ---------- Language switching ----------
   Every translatable string exists twice, as [lang="vi"] and [lang="en"]. */
html[lang="vi"] body [lang="en"],
html[lang="en"] body [lang="vi"] { display: none !important; }

/* ---------- Page transition (progressive) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out 0.25s ease both; }
::view-transition-new(root) { animation: fade-in 0.5s var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Type ---------- */
.work-title {                 /* the one accent: titles of works */
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.label { font-size: var(--fs-small); color: var(--muted); font-weight: 300; }
.muted { color: var(--muted); }
.prose { color: var(--ink-2); max-width: 62ch; }
.prose p + p { margin-top: 1.1em; }

.link { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.link .arrow { transition: transform 0.5s var(--ease); }
.link:hover .arrow { transform: translateX(4px); }
.u { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; transition: background-size 0.5s var(--ease); }
a:hover .u, a.u:hover { background-size: 100% 1px; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  background: var(--ink); color: var(--bg); padding: 10px 14px;
  transform: translateY(-200%); transition: transform 0.2s;
}
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  width: 100%; max-width: var(--max); margin-inline: auto;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: 28px var(--gutter) 0;
}
/* Brand lockup: C mark with the wordmark to its right */
.brand { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; }
.brand__logo { height: 44px; width: auto; filter: var(--brand-filter); }
.brand__word { height: 18px; width: auto; filter: var(--brand-filter); }

.header-right { display: flex; align-items: center; gap: 36px; }
.nav { display: flex; gap: 28px; font-size: var(--fs-ui); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); transition: color 0.2s; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.lang { display: flex; align-items: center; gap: 2px; font-size: var(--fs-small); color: var(--muted); }
.lang button { min-width: 28px; min-height: 44px; color: var(--muted); transition: color 0.2s; }
.lang button[aria-pressed="true"], .lang button:hover { color: var(--ink); }
.prefs { display: flex; align-items: center; gap: 10px; }

/* Light / dark toggle: shows the mode it switches to — a moon in light, a sun in dark */
.theme-btn { width: 32px; height: 44px; display: inline-grid; place-items: center; color: var(--muted); transition: color 0.2s; }
.theme-btn:hover { color: var(--ink); }
.theme-btn svg { width: 16px; height: 16px; transition: transform 0.6s var(--ease); }
.theme-btn:hover svg { transform: rotate(-15deg); }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }

@media (max-width: 599px) {
  .site-header { padding-top: 20px; gap: 12px; }
  .brand__logo { height: 34px; }
  .brand { gap: 10px; }
  .brand__word { height: 12.5px; }
  .brand, .brand__logo, .brand__word { flex: none; }
  .header-right { flex-direction: column; align-items: flex-end; gap: 0; }
  .nav { gap: 14px; font-size: 0.875rem; }
  .prefs { margin-top: -10px; }
}
@media (max-width: 370px) {            /* smallest phones: keep logo + menu on one row */
  .brand__word { height: 11px; }
  .nav { gap: 12px; }
}
@media (max-width: 340px) {
  .nav { gap: 10px; font-size: 0.8125rem; }
  .brand { gap: 8px; }
}

/* ---------- Footer: place + copyright, nothing else ---------- */
.site-footer {
  width: 100%; max-width: var(--max); margin-inline: auto;
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  padding: 32px var(--gutter) 24px;
  font-size: var(--fs-small); color: var(--muted);
}

/* ---------- Thin progress line ---------- */
.bar { position: relative; height: 1px; background: var(--line); }
.bar::after {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  transform-origin: left; transform: scaleX(var(--p, 0));
  transition: transform 0.7s var(--ease);
}
.bar--live::after { transition: none; }   /* follows the scroll position directly */

.arrows { display: flex; }
.arrows button { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--ink); }
.arrows svg { width: 20px; height: 10px; }

/* ---------- Reveal (only while JS runs) ---------- */
html.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: var(--delay, 0ms); }
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================
   COVER (index.html)
   ========================================================= */
.cover { padding-top: clamp(16px, 3vh, 40px); }
/* one 3:2 frame for every slide (the same proportion as the project photos),
   as large as the space left between header and footer allows (64px = caption row) */
.cover__stage { flex: 1 1 auto; min-height: 0; container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cover__frame, .cover__row { width: min(100cqw, calc((100cqh - 64px) * 1.5)); }
.cover__frame { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--line); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s var(--ease-io); }
.slide.is-active { opacity: 1; z-index: 1; }
.slide img, .cover__video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; filter: var(--img-filter); }
.slide img { transform: scale(1.05); transition: transform 8s linear, filter 0.8s var(--ease); }
.cover__video { transition: filter 0.8s var(--ease); }
/* black & white by default; the original colour shows while the pointer rests on the image */
@media (hover: hover) and (pointer: fine) {
  .cover__frame:hover .slide img, .cover__frame:hover .cover__video { filter: none; }
}
.slide.is-active img { transform: none; }
.cover__video { position: absolute; inset: 0; }

.cover__row { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 64px; }
.cover__cap { font-size: 1.25rem; transition: opacity 0.4s; }
.cover__cap.is-swapping { opacity: 0; }
.cover__ctrl { display: flex; align-items: center; gap: 8px; }
.cover__ctrl .bar { width: clamp(80px, 12vw, 160px); }
.pause-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--muted); }
.pause-btn:hover { color: var(--ink); }
.pause-btn svg { width: 12px; height: 12px; }
.pause-btn .i-play, .pause-btn[aria-pressed="true"] .i-pause { display: none; }
.pause-btn[aria-pressed="true"] .i-play { display: block; }



/* =========================================================
   PROJECTS (projects.html) — one work at a time, no loop
   ========================================================= */
.cats { display: flex; flex-wrap: wrap; gap: 0 28px; padding-top: clamp(12px, 3vh, 40px); font-size: var(--fs-ui); }
.cats a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); transition: color 0.2s; }
.cats a:hover { color: var(--ink); }
.cats a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
/* sub-sections of a category (Works / Exhibitions) — one step quieter */
.subcats { display: flex; gap: 0 20px; font-size: var(--fs-small); }
.subcats[hidden] { display: none; }
.subcats a { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); transition: color 0.2s; }
.subcats a:hover, .subcats a[aria-current="true"] { color: var(--ink); }
.subcats a[aria-current="true"]::before { content: "—"; margin-right: 8px; }

.pj__stage { position: relative; flex: 1 1 auto; min-height: 180px; display: flex; flex-direction: column; margin-top: 16px; }
.track {
  flex: 1 1 auto; min-height: 0;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-width: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
}
.track::-webkit-scrollbar { display: none; }
.track[hidden] { display: none; }
.track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
/* middle-button panning: the grabbing hand everywhere while it lasts */
html.is-panning, html.is-panning * { cursor: grabbing !important; user-select: none; }
.pj-slide {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  position: relative;
  -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
}
.pj-slide img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  pointer-events: none; filter: var(--img-filter); transition: filter 0.7s var(--ease);
}
.pj-slide--photo img { object-fit: cover; }
/* Sketches: black-on-white in light mode, the white-on-black version in dark mode.
   `lighten` lets the drawing's black paper melt into the page background. */
.pj-slide .tile-dark { display: none; mix-blend-mode: lighten; }
:root[data-theme="dark"] .pj-slide.has-dark .tile-dark { display: block; }
:root[data-theme="dark"] .pj-slide.has-dark .tile-light { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pj-slide:hover img, .pj-slide:focus-visible img { filter: none; }
}
/* touch: colour while a finger is on the work, and as it opens */
.pj-slide.is-touched img { filter: none; }
.cover__frame { touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.cover__frame.is-touched .slide img, .cover__frame.is-touched .cover__video { filter: none; }
.pj-slide:focus-visible { outline-offset: -1px; }

.pj__empty { flex: 1 1 auto; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; color: var(--ink-2); }
.pj__empty[hidden] { display: none; }

.pj__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; padding-top: 28px; }
.pj__foot[hidden] { display: none; }
.pj__title { font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.5rem); }
.pj__meta { margin-top: 6px; font-size: var(--fs-ui); color: var(--ink-2); }
.ph-tag { margin-left: 8px; font-size: var(--fs-small); color: var(--muted); }
.pj__cap { animation: fade-in 0.6s var(--ease); }
.pj__nav { display: flex; align-items: center; gap: 12px; padding-bottom: 4px; }
.pj__nav .bar { width: clamp(96px, 16vw, 220px); }

@media (max-width: 767px) {
  /* one line of categories that scrolls sideways instead of wrapping */
  .cats { flex-wrap: nowrap; gap: 0 20px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cats::-webkit-scrollbar { display: none; }
  .pj__foot { padding-top: 16px; }
  .pj__title { font-size: 1.5rem; }
  .site-footer { font-size: 0.75rem; }
  .pj__foot { grid-template-columns: 1fr; gap: 16px; }
  .pj__nav { justify-content: space-between; }
  .pj__nav .bar { flex: 1; width: auto; }
}

/* =========================================================
   PAGE HEADS + WORK DETAIL
   ========================================================= */
.page-head { padding-block: clamp(56px, 12vh, 144px) clamp(40px, 6vw, 72px); }
.back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-ui); color: var(--muted); margin-bottom: 24px; transition: color 0.2s; }
.back:hover { color: var(--ink); }
.wd-title { font-size: clamp(2.5rem, 1.4rem + 4.5vw, 5.5rem); line-height: 1.05; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 40px; margin-top: clamp(32px, 5vw, 56px); padding-top: 20px; border-top: 1px solid var(--line); }
.meta dt { font-size: var(--fs-small); color: var(--muted); margin-bottom: 4px; }
.meta dd { font-size: var(--fs-ui); }
.meta dd .work-title { font-size: 1.125rem; }

.wd-hero img { width: 100%; max-height: 88vh; object-fit: cover; object-position: 50% 78%; filter: none; }
.wd-hero--full img { max-height: none; object-fit: contain; }
.wd-gap { height: clamp(56px, 8vw, 120px); }
.ph-note { margin-top: 10px; font-size: var(--fs-small); color: var(--muted); }

.wd-text { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--gutter); padding-block: clamp(72px, 10vw, 160px); }
.wd-text .lead { grid-column: 1 / span 6; font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem); line-height: 1.45; }
.wd-text .prose { grid-column: 8 / span 5; }
@media (max-width: 1023px) { .wd-text .lead, .wd-text .prose { grid-column: 1 / -1; } }

.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(56px, 8vw, 120px) var(--gutter); }
.gallery > * { grid-column: 1 / -1; }
.gallery .g-left { grid-column: 1 / span 6; }
.gallery .g-right { grid-column: 7 / span 6; }
/* left + right pair: same height, widths follow each image's proportion */
.gallery .g-pair { display: flex; gap: var(--gutter); align-items: flex-start; }
.g-pair > figure { min-width: 0; }
@media (max-width: 767px) { .gallery .g-pair { flex-direction: column; gap: clamp(56px, 8vw, 120px); } .g-pair > figure { flex: none !important; width: 100%; } }
.gallery .g-center { grid-column: 3 / span 8; }
.gallery .g-narrow { grid-column: 8 / span 4; }
@media (max-width: 767px) { .gallery > * { grid-column: 1 / -1 !important; margin-top: 0 !important; } }
.gallery figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--muted); }
.zoom { display: block; width: 100%; cursor: zoom-in; }
.zoom img { width: 100%; }
/* Gallery sketches in dark mode: a supplied white-on-black file, or the
   drawing inverted; `lighten` melts the black paper into the page. */
.only-dark { display: none; }
:root[data-theme="dark"] .only-light { display: none; }
:root[data-theme="dark"] .only-dark { display: block; mix-blend-mode: lighten; }
:root[data-theme="dark"] .sketch-inv { filter: grayscale(1) invert(1); mix-blend-mode: lighten; }

/* ---------- Article (Consulting & Research) ---------- */
.article { max-width: 42rem; margin-inline: auto; padding-block: clamp(56px, 8vw, 112px) 0; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.75; }
.article p + p { margin-top: 1.1em; }
.article__h { margin: 2.2em 0 0.8em; color: var(--ink); font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem); font-weight: 400; line-height: 1.3; letter-spacing: -0.01em; }
.article__source { margin-top: 32px; font-size: var(--fs-ui); color: var(--ink); }
.signature { margin-top: clamp(48px, 7vw, 80px); }
.signature__img { width: auto; height: 96px; mix-blend-mode: multiply; }
:root[data-theme="dark"] .signature__img { filter: grayscale(1) invert(1); mix-blend-mode: lighten; }
.signature p { margin-top: 8px; font-size: var(--fs-ui); color: var(--ink); }

.next { display: block; margin-top: clamp(96px, 12vw, 176px); padding-top: 24px; border-top: 1px solid var(--line); }
.next .label { display: block; margin-bottom: 12px; }
.next__title { font-size: clamp(2rem, 1.2rem + 3vw, 4rem); display: inline-flex; align-items: baseline; gap: 0.4em; transition: transform 0.8s var(--ease); }
.next:hover .next__title { transform: translateX(8px); }
.next__title .arrow { font-family: var(--sans); font-style: normal; font-size: 0.5em; }

/* ---------- Lightbox ---------- */
.lightbox { width: 100%; height: 100%; max-width: none; max-height: none; border: 0; padding: 0; background: transparent; color: var(--ink); }
.lightbox::backdrop { background: var(--bg); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: fade-in 0.4s var(--ease); }
.lightbox__bar, .lightbox__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px var(--gutter); font-size: var(--fs-ui); }
.lightbox__bar .bar { width: clamp(96px, 16vw, 200px); }
.lightbox__stage { display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.lightbox__stage img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; animation: fade-in 0.6s var(--ease); }
.lightbox__foot { color: var(--muted); font-size: var(--fs-small); }
.lightbox button { min-height: 44px; }

/* =========================================================
   STUDIO
   ========================================================= */
.studio-quote p + p { margin-top: 1em; }
.studio-quote {
  max-width: 34em; margin-inline: auto; text-align: center;
  font-size: clamp(1rem, 0.75rem + 1.1vw, 1.5rem);
  line-height: 1.55; letter-spacing: -0.005em; text-wrap: balance;
}
.studio-img img { width: 100%; max-height: 82vh; object-fit: cover; object-position: 50% 78%; filter: var(--img-filter); }
.about { padding-block: clamp(72px, 10vw, 160px) 0; }
.about .prose { margin-inline: auto; text-align: center; }

.block { padding-top: clamp(72px, 10vw, 144px); }
.block > .label { margin-bottom: 16px; }
.rows li { border-top: 1px solid var(--line); }
.rows li:last-child { border-bottom: 1px solid var(--line); }
.rows > li > a, .rows .row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 4px 24px; align-items: baseline; padding-block: 18px; }
.rows .r-main { font-size: 1.125rem; }
.rows .work-title { font-size: 1.375rem; }
.rows .r-sub { color: var(--ink-2); font-size: var(--fs-ui); }
.rows .r-end { color: var(--muted); font-size: var(--fs-ui); text-align: right; }
.rows .row .work-title { font-size: 1.0625rem; }
.founder { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); letter-spacing: -0.015em; line-height: 1.2; }
.awards-head { margin: 40px 0 8px; }
.rows > li > a { transition: padding 0.6s var(--ease); }
.rows > li > a:hover { padding-left: 8px; }
@media (max-width: 767px) {
  .rows > li > a, .rows .row { grid-template-columns: 1fr; }
  .rows .r-end { text-align: left; }
}

/* =========================================================
   CONTACT
   ========================================================= */
.page-title { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.5rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 56px var(--gutter); padding-bottom: 24px; }
.contact__info { grid-column: 1 / span 4; display: grid; gap: 32px; align-content: start; }
.contact__form { grid-column: 6 / span 7; }
@media (max-width: 1023px) { .contact__info, .contact__form { grid-column: 1 / -1; } }
.info .label { margin-bottom: 4px; }
.info a, .info address { font-size: 1.125rem; }
.info li a { min-height: 36px; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px var(--gutter); }
.form[hidden] { display: none; }   /* after sending: only the thank-you remains (a reload brings the form back) */
.field { display: grid; gap: 4px; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 599px) { .field { grid-column: 1 / -1; } }
.field label { font-size: var(--fs-small); color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 0; font-size: 1rem; font-weight: 300;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  transition: border-color 0.2s; appearance: none; -webkit-appearance: none;
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.6; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field .error { font-size: var(--fs-small); color: var(--danger); }
.field .error:empty { display: none; }
.hp { position: absolute; left: -9999px; }

.btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 24px;
  border: 1px solid var(--ink); font-size: var(--fs-ui); font-weight: 400;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.form__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.form__status { font-size: var(--fs-small); color: var(--ink-2); }
.form__status.is-error { color: var(--danger); }
.form-done { padding-top: 24px; border-top: 1px solid var(--line); font-size: 1.25rem; line-height: 1.5; }
.form-done[hidden] { display: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .track { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
