/* ==========================================================================
   Allan Reyes — CV as a website
   One accent (#4A6DA7), one typeface (JetBrains Mono), lots of paper.
   ========================================================================== */

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@view-transition { navigation: auto; }

:root {
  color-scheme: light dark;

  --accent-base: #4A6DA7;
  --accent: light-dark(#4A6DA7, color-mix(in oklch, #4A6DA7 62%, white));
  --accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 35%, transparent);

  --paper: light-dark(#FBFBF9, #101218);
  --paper-2: light-dark(#F2F3F1, #171A22);
  --ink: light-dark(#17191E, #E4E6EB);
  --ink-2: light-dark(#3C4049, #B9BDC6);
  --muted: light-dark(#6E737C, #8A909B);
  --rule: light-dark(#DCDEE1, #2A2E38);

  --font: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --side: 15.5rem;
  --gap: clamp(2rem, 5vw, 4.5rem);
  --maxw: 70rem;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

[data-theme="light"] { color-scheme: light; }
[data-theme="dark"]  { color-scheme: dark; }

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
  background: var(--paper);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.65;
  font-weight: 400;
  font-feature-settings: "calt" 1, "zero" 0;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--accent-line); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--paper); }
h1, h2, h3, p, ul, ol { margin: 0; }
strong { font-weight: 700; }
kbd { font: inherit; font-size: .7rem; padding: .05rem .35rem; border: 1px solid var(--rule); border-radius: 4px; color: var(--muted); }
mark.ai { background: none; color: var(--accent); font-weight: 600; }

.visually-hidden, .skip:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; top: .75rem; left: .75rem; z-index: 50; background: var(--ink); color: var(--paper); padding: .4rem .8rem; }

/* ---------- Reading progress (scroll-driven) ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 30;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes grow { to { transform: scaleX(1); } }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  font-size: .75rem; letter-spacing: .02em;
  background: color-mix(in oklch, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
}
@supports (animation-timeline: scroll()) {
  .toolbar { animation: toolbar-edge linear both; animation-timeline: scroll(root); animation-range: 0 120px; }
  @keyframes toolbar-edge { to { border-bottom-color: var(--rule); } }
}
.toolbar__home { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 600; }
.toolbar__mark { display: inline-block; width: 1.05rem; }
.toolbar__mark .monogram path { animation: none; stroke: none; fill: var(--accent); }
.toolbar__links { list-style: none; padding: 0; display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.4rem); }
.toolbar__links a { text-decoration: none; color: var(--ink-2); }
.toolbar__links a[aria-current="page"] { color: var(--accent); }
.toolbar__links a[aria-current="page"]::before { content: "*"; }

/* On the home page, the small mark only appears once the big one has scrolled away */
@supports (animation-timeline: scroll()) {
  .is-home .toolbar__home { animation: fade-in linear both; animation-timeline: scroll(root); animation-range: 120px 260px; }
  @keyframes fade-in { from { opacity: 0; translate: 0 -4px; } }
}

button { font: inherit; color: inherit; cursor: pointer; }
.ask-trigger {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .32rem .55rem .32rem .6rem; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.ask-trigger:hover { background: color-mix(in oklch, var(--accent) 20%, transparent); border-color: var(--accent); }
.ask-trigger:active { transform: scale(.97); }
.ask-trigger kbd { border-color: var(--accent-line); color: inherit; opacity: .75; }

/* The "live" dot: a slowly rotating conic gradient, animated via @property */
.ask-trigger__dot {
  width: .55rem; height: .55rem; border-radius: 50%; flex: none;
  background: conic-gradient(from var(--spin), var(--accent), color-mix(in oklch, var(--accent) 20%, var(--paper)), var(--accent));
  animation: spin 3.2s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }

.theme-toggle { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: none; }
.theme-toggle svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.3; }
.theme-toggle svg path { fill: currentColor; stroke: none; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 40rem) {
  .toolbar__name, .ask-trigger kbd { display: none; }
}

/* ---------- The sheet (CV page) ---------- */
.sheet {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3rem) 3rem;
  display: grid; gap: 0 var(--gap);
  grid-template-columns: var(--side) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "side main";
}
.sheet__head { grid-area: head; display: grid; grid-template-columns: subgrid; align-items: start; padding-bottom: 2.5rem; }
.sheet__side { grid-area: side; }
.sheet__main { grid-area: main; border-top: 1px solid var(--rule); padding-top: 1.6rem; }

.sheet__mark { width: min(10rem, 100%); padding-top: .4rem; }
.sheet__intro { max-width: 44rem; }

/* Monogram: drawn as a line, then filled */
.monogram { width: 100%; height: auto; overflow: visible; }
.monogram path {
  fill: var(--accent); stroke: var(--accent); stroke-width: .9;
  stroke-dasharray: 1; stroke-dashoffset: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .sheet__mark .monogram path { animation: draw 2.4s var(--ease) both, fill 1s .9s ease both; }
  @keyframes draw { from { stroke-dashoffset: 1; } }
  @keyframes fill { from { fill: transparent; } }
}
.sheet__mark { view-transition-name: monogram; }

.name {
  font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.05; font-weight: 800; letter-spacing: -.035em;
  margin-bottom: 1.3rem;
}
.lede {
  font-size: clamp(1rem, 1.7vw, 1.2rem); line-height: 1.6; font-weight: 300; color: var(--muted);
  text-wrap: pretty;
}
.lede strong { color: var(--accent); font-weight: 700; }

.toolchain {
  margin-top: 1.6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem;
  font-size: .78rem; color: var(--ink-2);
}
.toolchain__label { color: var(--muted); }
.toolchain__item { position: relative; }
.toolchain__item + .toolchain__item::before { content: "+"; position: absolute; left: -.68rem; color: var(--accent); }
.toolchain__item:last-of-type { color: var(--accent); font-weight: 700; }
.toolchain__cursor { width: .55em; height: 1.05em; align-self: center; background: var(--accent); margin-left: -.55rem; }
@media (prefers-reduced-motion: no-preference) {
  .toolchain__item { animation: type-in .01s steps(1) both; animation-delay: calc(1.3s + var(--i) * .28s); }
  .toolchain__cursor { animation: blink 1.05s steps(1) infinite; }
  @keyframes type-in { from { visibility: hidden; } }
  @keyframes blink { 50% { opacity: 0; } }
}

/* Labels, like the small caps in the PDF */
.label {
  font-size: .7rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Side column */
.block { padding: 1.6rem 0; border-top: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.skill + .skill { margin-top: 1.05rem; }
.skill h3 { font-size: .82rem; font-weight: 700; }
.skill p { font-size: .82rem; color: var(--ink-2); text-wrap: pretty; }
.small { font-size: .78rem; color: var(--ink-2); }
.small + .small { margin-top: .9rem; }
.small strong { color: var(--ink); }
.contact a { text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* Contact (opens the contact dialog) */
.contact-cta { margin: 1rem 0 1.2rem; }
.toolbar__contact { background: none; border: 0; padding: 0; color: var(--ink-2); }
.toolbar__contact:hover { color: var(--accent); }
@media print { .contact-cta { display: none !important; } }

/* Works */
.works { list-style: none; padding: 0; counter-reset: work; }
.work { position: relative; padding: 0 0 2.6rem; counter-increment: work; }
.work::before {
  content: counter(work, decimal-leading-zero);
  position: absolute; right: 100%; margin-right: 1.1rem; top: .2rem;
  font-size: .68rem; color: var(--rule); font-weight: 700;
  transition: color .3s;
}
.work:hover::before, .work:target::before { color: var(--accent); }
.work:target .work__company { text-decoration: underline; text-decoration-thickness: 2px; }
.work__company { font-size: 1.05rem; font-weight: 700; color: var(--accent); letter-spacing: -.01em; line-height: 1.35; }
.work__period { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .15rem 0 1rem; }
.work__points { list-style: none; padding: 0; display: grid; gap: .55rem; }
.work__points li { position: relative; padding-left: 1.4rem; font-size: .86rem; color: var(--ink); text-wrap: pretty; }
.work__points li::before { content: "–"; position: absolute; left: 0; color: var(--muted); transition: color .2s, translate .2s var(--ease); }
.work__points li:hover::before { color: var(--accent); translate: 3px 0; }
.work__about { margin-top: 1rem; font-size: .74rem; color: var(--muted); text-wrap: pretty; }
.work__cases { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.work__cases a {
  font-size: .72rem; text-decoration: none; color: var(--accent);
  padding: .15rem .55rem; border: 1px solid var(--accent-line); border-radius: 999px;
  transition: background .2s;
}
.work__cases a:hover { background: var(--accent-soft); }

.index__badge { display: inline-block; margin: .3rem 0 .2rem; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; padding: .05rem .5rem; }

/* Featured project inside a role */
.feature {
  display: grid; margin-top: 1.1rem; text-decoration: none; color: inherit;
  border: 1px solid var(--accent-line); border-radius: 10px; overflow: hidden;
  background: var(--paper-2); transition: border-color .2s, translate .3s var(--ease);
}
.feature:hover { border-color: var(--accent); translate: 0 -2px; }
.feature:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.feature__body { display: grid; gap: .35rem; padding: .9rem 1rem 1rem; }
.feature__label { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.feature__title { font-size: .95rem; font-weight: 700; color: var(--ink); }
.feature__text { font-size: .78rem; color: var(--ink-2); text-wrap: pretty; }
.feature__more { font-size: .72rem; color: var(--accent); margin-top: .2rem; }
.prose img[src$="#phone"] { width: min(100%, 20rem); display: block; margin-inline: auto; border-radius: 22px; }
.prose p:has(> img[src$="#phone"]) { margin-inline: 0; }
@media print { .feature { display: none !important; } }

/* Scroll-driven reveal for each role */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .work, .block, .index__item {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    @keyframes rise { from { opacity: 0; translate: 0 1.4rem; } }
  }
}

/* CTA */
.cta {
  margin-top: 1rem; padding: 1.6rem; border: 1px dashed var(--accent-line); border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  display: grid; gap: 1rem; justify-items: start;
}
.cta .label { margin: 0; }
.cta p:not(.label) { font-size: .86rem; color: var(--ink-2); max-width: 38rem; }
.cta__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.button {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: light-dark(#fff, #0E1118); font-weight: 600; font-size: .8rem; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.button:hover { color: light-dark(#fff, #0E1118); transform: translateY(-1px); box-shadow: 0 6px 20px -8px var(--accent); }
.button kbd { color: inherit; border-color: color-mix(in oklch, currentColor 40%, transparent); }
.button--ghost { background: none; color: var(--accent); }
.button--ghost:hover { color: var(--accent); }

/* Mobile: name + works first, side column after, like reading the PDF on a phone */
@media (max-width: 52rem) {
  .sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "main" "side";
  }
  .sheet__head { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .sheet__mark { width: 4.5rem; }
  .sheet__side { margin-top: 1rem; }
  .work::before { position: static; display: block; margin: 0 0 .25rem; }
}

/* ---------- Inner pages: work index + case studies ---------- */
.page { max-width: 56rem; margin: 0 auto; padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 5vw, 3rem) 3rem; }
.page__head { margin-bottom: 2.5rem; }
.page__head .label a { text-decoration: none; color: var(--accent); }
.page__title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin-bottom: 1rem; }
.page .lede { max-width: 44rem; }
.page .lede p { margin: 0; }

.index { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.index__item { border-bottom: 1px solid var(--rule); }
.index__link {
  display: grid; grid-template-columns: 2rem 7.5rem minmax(0, 1fr) 1.5rem; align-items: center; gap: 1.25rem;
  padding: 1.1rem 0; text-decoration: none;
}
.index__num { font-size: .7rem; color: var(--muted); }
.index__thumb { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.index__thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .4s, scale .5s var(--ease); }
.index__title { display: block; font-weight: 700; font-size: 1rem; color: var(--accent); width: fit-content; }
.index__sub { display: block; font-size: .76rem; color: var(--muted); margin-top: .2rem; text-wrap: pretty; }
.index__arrow { color: var(--muted); transition: translate .25s var(--ease), color .2s; }
.index__link:hover .index__thumb img, .index__link:focus-visible .index__thumb img { filter: none; scale: 1.04; }
.index__link:hover .index__arrow { translate: 4px 0; color: var(--accent); }
@media (max-width: 36rem) {
  .index__link { grid-template-columns: 5rem minmax(0, 1fr); gap: .9rem; }
  .index__num, .index__arrow { display: none; }
}

.case__hero { margin: 0 0 2.5rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); background: var(--paper-2); }
.case__hero img { width: 100%; }

.prose { max-width: 44rem; font-size: .9rem; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1rem; }
.prose h2, .prose h3 { color: var(--ink); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.prose h4 { color: var(--accent); font-size: .95rem; margin-top: 1.8rem; }
.prose ul { padding: 0; list-style: none; }
.prose ul li { padding-left: 1.4rem; position: relative; }
.prose ul li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }
.prose img { border-radius: 8px; border: 1px solid var(--rule); margin: 1.6rem 0 .4rem; width: 100%; max-width: none; }
.prose p:has(> img) { margin-inline: calc(-1 * min(6vw, 6rem)); }
.prose a { color: var(--accent); }
.prose em { color: var(--muted); }

.case__nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); font-size: .8rem; }
.case__nav a { text-decoration: none; color: var(--accent); }
.case__nav a:only-child:last-child { margin-left: auto; }

/* ---------- Colophon ---------- */
.colophon {
  max-width: var(--maxw); margin: 0 auto; padding: 2rem clamp(1.25rem, 5vw, 3rem) 3rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  font-size: .7rem; color: var(--muted); border-top: 1px solid var(--rule);
}

/* ---------- Ask my CV (native <dialog> + @starting-style) ---------- */
.ask {
  width: min(42rem, calc(100vw - 1.5rem)); max-height: min(44rem, calc(100dvh - 3rem));
  padding: 0; border: 1px solid var(--rule); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px -30px rgb(10 20 40 / .45), 0 0 0 1px var(--accent-soft);
  display: none; flex-direction: column;
  opacity: 0; translate: 0 12px; scale: .98;
  transition: opacity .25s var(--ease), translate .3s var(--ease), scale .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete;
}
.ask[open] { display: flex; opacity: 1; translate: 0 0; scale: 1; }
@starting-style { .ask[open] { opacity: 0; translate: 0 12px; scale: .98; } }
.ask::backdrop {
  background: color-mix(in oklch, var(--paper) 55%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s, overlay .3s allow-discrete, display .3s allow-discrete;
}
.ask[open]::backdrop { opacity: 1; }
@starting-style { .ask[open]::backdrop { opacity: 0; } }

.ask__head { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; padding: 1rem 1.2rem .9rem; border-bottom: 1px solid var(--rule); }
.ask__title { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--accent); font-size: .85rem; }
.ask__hint { grid-column: 1; font-size: .68rem; color: var(--muted); }
.ask__close { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .7rem; padding: .25rem .5rem; border: 1px solid var(--rule); border-radius: 6px; background: none; color: var(--muted); }
.ask__close:hover { color: var(--accent); border-color: var(--accent); }

.ask__log { flex: 1; overflow-y: auto; padding: 1.2rem; display: grid; align-content: start; gap: 1.1rem; overscroll-behavior: contain; min-height: 12rem; }
.ask__lead { font-size: .86rem; color: var(--ink-2); margin-bottom: 1rem; text-wrap: pretty; }
.ask__chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.ask__chips button {
  font-size: .74rem; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.ask__chips button:hover { border-color: var(--accent); color: var(--accent); }

.msg { font-size: .84rem; line-height: 1.65; }
.msg--user { justify-self: end; max-width: 85%; padding: .55rem .85rem; border-radius: 10px 10px 2px 10px; background: var(--accent-soft); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9rem; overflow: auto; }
.msg--bot { color: var(--ink-2); padding-left: 1.1rem; border-left: 2px solid var(--accent-line); }
.msg--bot p + p, .msg--bot ul, .msg--bot p + ul, .msg--bot ul + p { margin-top: .6rem; }
.msg--bot ul { padding-left: 1.1rem; }
.msg--bot strong { color: var(--ink); }
.msg--bot a { color: var(--accent); }
.msg--error { color: light-dark(#A3402F, #E4907F); border-left-color: currentColor; }
.msg--thinking::after {
  content: ""; display: inline-block; width: .5em; height: 1em; vertical-align: -.15em; margin-left: .15em;
  background: var(--accent); animation: blink 1s steps(1) infinite;
}
.msg--thinking:empty::before { content: "thinking"; color: var(--muted); }

.ask__form { display: flex; align-items: flex-end; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid var(--rule); background: var(--paper-2); border-radius: 0 0 14px 14px; }
.ask__prompt { color: var(--accent); font-weight: 700; padding-bottom: .4rem; }
.ask__form textarea {
  flex: 1; resize: none; border: 0; background: none; color: var(--ink); font: inherit; font-size: .86rem; line-height: 1.5;
  padding: .3rem 0; max-height: 10rem; field-sizing: content; min-height: 1.6rem;
}
.ask__form textarea:focus { outline: none; }
.ask__form:focus-within { box-shadow: inset 0 1px 0 var(--accent); }
.ask__send { font-size: .74rem; font-weight: 600; padding: .4rem .75rem; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: light-dark(#fff, #0E1118); }
.ask__send:disabled { opacity: .45; cursor: progress; }

/* ---------- Contact me dialog (shares the .ask dialog shell) ---------- */
.contact-dialog { width: min(36rem, calc(100vw - 1.5rem)); }
.contact-form { display: grid; gap: .9rem; padding: 1.2rem; overflow-y: auto; overscroll-behavior: contain; }
.contact-form .ask__lead { margin: 0; }
.contact-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field span { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: .84rem; color: var(--ink); width: 100%;
  padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.contact-form__foot { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.contact-form__status { margin-right: auto; }
.contact-form__status.is-error { color: light-dark(#A3402F, #E4907F); }
.contact-form__status.is-done { color: var(--accent); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* ---------- Print: the page becomes the PDF again ---------- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  :root { color-scheme: light; }
  body { font-size: 8.6pt; background: #fff; }
  .toolbar, .progress, .ask, .cta, .colophon, .toolchain, .work__cases, .skip { display: none !important; }
  .sheet { padding: 0; grid-template-columns: 46mm 1fr; grid-template-areas: "head head" "side main"; }
  .sheet__head { grid-template-columns: subgrid; }
  .sheet__mark { width: 30mm; }
  .work, .block { animation: none !important; opacity: 1 !important; translate: none !important; break-inside: avoid; }
  .work::before { display: none; }
  a { text-decoration: none; }
}
