/* ============================================================================
   AUREA ARCHITECTS — concept demo for Swiss Web Bureau
   World: cyanotype / diazo reprographic print. The page ground IS the drawing;
   photographs of the built work are the warm prints laid onto it.
   Self-contained: local fonts, no CDN, no framework, no third-party script.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../_fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../_fonts/martianmono-var.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* the reprographic blues: a diazo print is one ink, many exposures */
  --blue-950: #041428;
  --blue-900: #061e39;
  --blue-850: #072542;
  --blue-800: #0a2b4d;
  --blue-700: #0f3c68;
  --blue-600: #17507f;

  --line: rgba(168, 205, 236, 0.26);
  --line-strong: rgba(198, 226, 248, 0.55);

  --ink: #e4f0fb;          /* white line work / primary text */
  --ink-2: #a9c8e2;        /* secondary */
  --ink-3: #6f96b8;        /* annotation */
  --pencil: #ef7350;       /* red pencil markup — active/current only, <2% */

  --sp: clamp(20px, 4.4vw, 68px);
  --measure: 68ch;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--blue-900);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  font-weight: 380;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The sheet itself. Both the paper and its ruling are ABSOLUTE, not fixed:
   a diazo sheet's grain and grid belong to the paper and travel with it, and a
   fixed layer would read as a screen overlay laid over the page. */
body { position: relative; }
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* The Prussian ground is baked into the tile itself, so the paper is visible
     without depending on a blend mode against a near-black backdrop. The tile is
     a bloom-free interior crop at 560px: it reads as rag tooth, not as a
     recognisable image repeating down the page. */
  background-image: url("img/sheet.webp");
  background-size: 560px 560px;
  background-repeat: repeat;
}
/* the ruling, printed on that paper */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(150, 195, 232, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(150, 195, 232, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
}
main, header, footer { position: relative; z-index: 1; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--pencil);
  outline-offset: 3px;
}

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

/* --- typography ---------------------------------------------------------- */

.display {
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.86;
  text-wrap: balance;
}
h1.display { font-size: clamp(3rem, 9vw, 6rem); }
h2.display { font-size: clamp(2.1rem, 5.4vw, 4.2rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 640; letter-spacing: -0.025em; line-height: 1.06; }

.lede {
  font-size: clamp(1.06rem, 1.55vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
  font-weight: 380;
}
p { max-width: var(--measure); }
.dim { color: var(--ink-2); }

/* the annotation voice of a drawing sheet */
.note {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.5;
}
.note-b { color: var(--ink-2); }

/* --- header / sheet index nav -------------------------------------------- */

.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: linear-gradient(to bottom, var(--blue-900) 42%, rgba(6, 30, 57, 0));
  transition: background 0.4s var(--ease);
}
.site-head.is-stuck {
  background: rgba(6, 30, 57, 0.92);
  backdrop-filter: blur(9px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-weight: 780;
  font-size: 1.16rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.brand small {
  font-family: "Martian Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  font-weight: 500;
}

/* sheet index: the navigation of a drawing set is its sheet numbers */
.sheet-nav { display: flex; align-items: center; gap: 4px; }
.sheet-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.sheet-nav a .sh {
  font-family: "Martian Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  transition: color 0.3s var(--ease);
}
.sheet-nav a:hover { color: var(--ink); border-color: var(--line); }
.sheet-nav a:hover .sh { color: var(--ink-2); }
.sheet-nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(23, 80, 127, 0.35);
}
.sheet-nav a[aria-current="page"] .sh { color: var(--pencil); }

.menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded="true"] .x { display: block; }
.menu-btn[aria-expanded="true"] .b { display: none; }

@media (max-width: 900px) {
  .sheet-nav {
    position: fixed;
    inset: 78px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(6, 30, 57, 0.985);
    border-block: 1px solid var(--line);
    padding: 8px var(--sp) 22px;
    transform: translateY(-6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0.32s;
  }
  .sheet-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .sheet-nav a { padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .sheet-nav a[aria-current="page"] { background: none; }
  .menu-btn { display: inline-flex; }
}

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

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 150px;
  padding-bottom: clamp(28px, 5vw, 60px);
  overflow: hidden;
}
.hero-plan {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-plan svg { width: 100%; height: 100%; }
.hero-plan .st { vector-effect: non-scaling-stroke; }
.hero-inner { position: relative; z-index: 2; width: 100%; }

/* the headline is dimensioned like a drawing */
.h1-wrap { position: relative; display: inline-block; max-width: 100%; }
.dimstring {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--ink-3);
}
.dimstring .rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  max-width: 340px;
}
.dimstring .rule::before,
.dimstring .rule::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--line-strong);
}
.dimstring .rule::before { left: 0; }
.dimstring .rule::after { right: 0; }

.hero-foot {
  display: grid;
  gap: 28px;
  margin-top: clamp(30px, 4.6vw, 58px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .hero-foot { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto; align-items: start; gap: 44px; }
}
.hero-meta { display: flex; gap: 34px; flex-wrap: wrap; }

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

section { padding-block: clamp(72px, 10vw, 152px); }
.sec-head { margin-bottom: clamp(34px, 4.6vw, 62px); }
.sec-head .note { margin-bottom: 18px; }

/* --- the print: a photograph laid onto the blue sheet --------------------- */

.print {
  position: relative;
  background: rgba(4, 20, 40, 0.5);
  border: 1px solid var(--line);
  overflow: hidden;
}
.print img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the warm print tone is baked into the asset itself, not faked with a filter
     the eye cannot see — see img/ and the synthetic-media note in the markup */
}
.print figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 14px;
}

.print-full { margin-top: clamp(30px, 4vw, 56px); }
.print-full .frame { aspect-ratio: 21 / 9; }
@media (max-width: 700px) { .print-full .frame { aspect-ratio: 4 / 3; } }
.frame { position: relative; overflow: hidden; border: 1px solid var(--line); }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* --- project sheet index (rows, not cards) ------------------------------- */

.sheets { border-top: 1px solid var(--line); }
.sheet-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 20px;
  align-items: baseline;
  padding: clamp(22px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.45s var(--ease);
}
@media (min-width: 860px) {
  .sheet-row {
    grid-template-columns: 96px minmax(0, 1fr) 190px 132px 44px;
    gap: 28px;
    align-items: center;
  }
}
.sheet-row:hover { background: rgba(23, 80, 127, 0.22); }
.sheet-row .no {
  font-family: "Martian Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  transition: color 0.35s var(--ease);
}
.sheet-row:hover .no { color: var(--pencil); }
.sheet-row h3 { transition: transform 0.5s var(--ease); }
@media (min-width: 860px) { .sheet-row:hover h3 { transform: translateX(9px); } }
.sheet-row .arrow {
  justify-self: end;
  width: 20px;
  color: var(--ink-3);
  transition: transform 0.5s var(--ease), color 0.35s var(--ease);
}
.sheet-row:hover .arrow { transform: translateX(6px); color: var(--ink); }
.sheet-row a::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 859px) {
  .sheet-row .meta-cell { grid-column: 2; }
  .sheet-row .arrow { display: none; }
}

/* the drawing thumbnail that surfaces on hover — desktop pointer only */
.sheet-peek {
  position: fixed;
  z-index: 40;
  width: 290px;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
}
.sheet-peek.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sheet-peek img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px), (pointer: coarse) { .sheet-peek { display: none; } }

/* --- two-up editorial block ---------------------------------------------- */

.duo { display: grid; gap: clamp(28px, 4vw, 64px); align-items: center; }
@media (min-width: 900px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo.narrow-left { }
@media (min-width: 900px) { .duo.narrow-left { grid-template-columns: 0.85fr 1.15fr; } }

/* --- method: drawn steps, not icon cards --------------------------------- */

.method { display: grid; gap: 0; border-top: 1px solid var(--line); }
.method-step {
  display: grid;
  gap: 10px 30px;
  padding: clamp(24px, 3.2vw, 40px) 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 860px) {
  .method-step { grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; gap: 44px; }
}
/* below the desktop grid the phase marker rides beside its heading rather than
   stacking above it, which would read as an eyebrow */
@media (min-width: 620px) and (max-width: 859px) {
  .method-step { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .method-step > .note { grid-column: 2; grid-row: 1; text-align: right; }
  .method-step > h3 { grid-column: 1; grid-row: 1; }
  .method-step > p { grid-column: 1 / -1; grid-row: 2; }
}
/* on a narrow phone the marker gets its own line UNDER the heading: beside it
   would crush the heading measure, above it would be an eyebrow */
@media (max-width: 619px) {
  .method-step { grid-template-columns: minmax(0, 1fr); }
  .method-step > h3 { order: 1; }
  .method-step > .note { order: 2; }
  .method-step > p { order: 3; }
}
.method-step h3 { font-size: clamp(1.15rem, 1.9vw, 1.55rem); }

/* --- revision block: how a drawing set actually records its history ------ */

.revisions { width: 100%; border-collapse: collapse; margin-top: 44px; text-align: left; }
.revisions caption { text-align: left; padding-bottom: 12px; }
.revisions th, .revisions td {
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
  font-variant-numeric: tabular-nums;
}
.revisions thead th { border-bottom-color: var(--line-strong); padding-bottom: 9px; }
.revisions tbody td:first-child { color: var(--pencil); font-family: "Martian Mono", monospace; font-size: 0.68rem; width: 3.5rem; }
.revisions tbody td:nth-child(2) { color: var(--ink-2); font-size: 0.88rem; white-space: nowrap; width: 6.5rem; }
.revisions tbody td:last-child { color: var(--ink); font-size: 0.95rem; padding-right: 0; }
@media (max-width: 560px) {
  .revisions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .revisions tbody tr { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .revisions tbody td { border: 0; padding: 0; }
  .revisions tbody td:nth-child(2) { grid-column: 2; }
  .revisions tbody td:last-child { grid-column: 2; margin-top: 4px; }
}

/* --- links / buttons ----------------------------------------------------- */

.link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-strong);
  transition: gap 0.4s var(--ease), border-color 0.3s var(--ease);
}
.link:hover { gap: 17px; border-color: var(--ink); }
.link svg { width: 15px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 14px 26px;
  background: var(--ink);
  color: var(--blue-950);
  font-weight: 620;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: rgba(23, 80, 127, 0.4); }

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

.site-foot { padding-block: clamp(56px, 7vw, 104px) 44px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 40px; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: 1.7fr 1fr 1fr; gap: 48px; } }
.foot-grid a.block { display: block; color: var(--ink-2); margin-top: 8px; transition: color 0.3s var(--ease); }
.foot-grid a.block:hover { color: var(--ink); }
.foot-fine {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(46px, 6vw, 84px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* the title block of a drawing sheet, used as the real footer stamp */
.titleblock {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  margin-top: clamp(40px, 5vw, 68px);
}
@media (min-width: 720px) { .titleblock { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.titleblock div { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.titleblock div:last-child { border-right: 0; }
.titleblock span { display: block; margin-top: 5px; color: var(--ink); font-size: 0.86rem; letter-spacing: 0.01em; }

/* --- concept provenance badge (honesty: this is not client work) --------- */

.concept-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: var(--blue-950);
  border: 1px solid var(--line-strong);
  font-family: "Martian Mono", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.concept-badge:hover { color: var(--ink); border-color: var(--ink); }
.concept-badge b { color: var(--ink); font-weight: 600; }
.concept-badge .dot { width: 5px; height: 5px; background: var(--pencil); flex: none; }
@media (max-width: 560px) { .concept-badge { font-size: 0.5rem; padding: 7px 10px; } }

/* --- motion: the print develops ------------------------------------------ */

/* Content is visible by default. Script arms the hidden state only once it is
   running, so a JS failure leaves a complete readable page rather than a blank one. */
[data-dev] {
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease), filter 0.95s var(--ease);
}
[data-dev].is-armed { opacity: 0; transform: translateY(20px); filter: blur(5px); }

/* The hero plan draws itself, once — but only after JS has measured each stroke's
   real length. Without that measurement the dash pattern would be wrong, so with
   no JS the plan simply renders complete. */
.hero-plan.is-ready .st {
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  animation: draw 2.5s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  [data-dev], [data-dev].is-armed { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
  .hero-plan.is-ready .st { animation: none; stroke-dashoffset: 0; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --- utility ------------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--blue-950);
  font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
