/* ============================================================
   ASTARTE — a 1978 Gin Fizz ketch
   Built on the antidot editorial shell, dressed for the sea.
   Chart paper, deep navy ink, one stroke of brass.
   ============================================================ */

:root {
  --paper: #eee9dc;        /* aged chart paper */
  --paper-deep: #e4ddca;
  --ink: #14212b;          /* deep sea navy */
  --ink-soft: rgba(20, 33, 43, 0.62);
  --ink-faint: rgba(20, 33, 43, 0.16);
  --accent: #a9772f;       /* brass / varnished brightwork */
  --accent-deep: #8a5f22;
  --sea: #1d5c66;          /* secondary: deep teal */
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Archivo", Helvetica, Arial, sans-serif;
  --mono: "Space Mono", "Courier New", monospace;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 42rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }

/* Every local <img> carries explicit width/height attributes (added by _build/seo.py) so
   the browser can reserve its space before the file loads. Those attributes also act as
   presentational hints, so height MUST be reset to auto here — otherwise any rule that
   sets only a width (.figure-wide img, .proj-img img) leaves the attribute height in
   force and stretches the picture. Rules that set a height on purpose — .gallery img,
   .proj-card-img img, .hero-figure img — are more specific and still win. */
img { max-width: 100%; height: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: 0.72em; letter-spacing: 0.04em; text-transform: uppercase; }
.accent { color: var(--accent); }
em { font-family: var(--serif); font-style: italic; font-size: 1.06em; }

/* ============ intro curtain ============ */
.curtain {
  position: fixed; inset: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  padding: 0 max(6vw, 1.4rem); box-sizing: border-box; text-align: center;
}
.curtain-word {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  letter-spacing: -0.01em; font-size: clamp(2.4rem, 9vw, 7rem);
  overflow: hidden; display: flex; max-width: 100%;
  /* The mask clips to the padding box, and the italic terminal of the final "e"
     inks ~0.018em past its advance width — pad both sides so it isn't sliced. */
  padding: 0 0.06em;
}
.curtain-line, .curtain-dot { display: inline-block; transform: translateY(110%); }
.curtain-dot { color: var(--accent); font-style: normal; }

/* ============ header ============ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: 1.1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-faint);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-header.is-hidden { transform: translateY(-100%); }

/* wordmark: identical to antidot so the left never changes */
.wordmark {
  font-family: var(--sans); font-weight: 600; letter-spacing: -0.02em;
  font-size: 1.15rem; text-decoration: none; white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }
/* contextual "you are here" tag next to the wordmark */
.here-tag {
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
  padding-left: 0.9rem; margin-left: 0.85rem; border-left: 1px solid var(--ink-faint);
  align-self: center;
}
.here-tag .sy { color: var(--accent); }
.here-tag { text-decoration: none; transition: color 0.25s; }
.here-tag:hover { color: var(--ink); }
.header-left { display: flex; align-items: center; }

/* ---- persistent top nav (desktop) ---- */
.astarte-nav {
  display: flex; align-items: center; align-self: center;
  gap: clamp(0.7rem, 1.5vw, 1.4rem); flex-wrap: nowrap;
}
.astarte-nav a {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
  white-space: nowrap; transition: color 0.25s;
}
.astarte-nav a:hover { color: var(--accent); }
.astarte-nav a[aria-current="page"] {
  color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 2px;
}
/* desktop: show inline nav, hide burger */
@media (min-width: 1121px) {
  .site-header .burger { display: none; }
}
/* small screens: hide inline nav, use the burger */
@media (max-width: 1120px) {
  .astarte-nav { display: none; }
  /* Contact already lives inside the burger menu whenever the burger is showing,
     so the inline Contact link is dropped here — it was crowding the burger off
     the right edge on phones. Now the burger sits clear at the end of the header. */
  .header-contact { display: none; }
}

.header-right { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 1.6rem); }
.header-contact {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
  white-space: nowrap; transition: color 0.25s;
}
.header-contact:hover { color: var(--accent); }

/* ---- burger ---- */
.burger {
  position: relative; width: 26px; height: 13px; padding: 0; border: 0;
  background: none; cursor: pointer; color: var(--ink); transition: color 0.25s; align-self: center;
}
.burger:hover { color: var(--accent); }
.burger-box { position: absolute; inset: 0; }
.burger-box span {
  position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
.burger-box span:nth-child(1) { top: 0; }
.burger-box span:nth-child(2) { bottom: 0; }
.burger.is-open .burger-box span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.burger.is-open .burger-box span:nth-child(2) { top: 50%; bottom: auto; transform: translateY(-50%) rotate(-45deg); }
/* When the menu opens, an anchor blends in front of the X. It is line art, so the X
   still reads through it; it drops in with a small settle. Painted after .burger-box,
   so it layers on top. */
.burger::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 21px; height: 21px; pointer-events: none;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9772f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='5' r='3'/%3E%3Cline x1='12' y1='22' x2='12' y2='8'/%3E%3Cpath d='M5 12H2a10 10 0 0 0 20 0h-3'/%3E%3C/svg%3E");
  opacity: 0; transform: translate(-50%, -50%) scale(0.55) rotate(-14deg);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.burger.is-open::after { opacity: 0.92; transform: translate(-50%, -50%) scale(1) rotate(0deg); }

/* ---- menu overlay ---- */
.menu-panel {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(0.8rem, 2.4vh, 1.6rem);
  padding: 16vh var(--gutter) var(--gutter);
  background: color-mix(in srgb, var(--paper-deep) 96%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0.45s;
  overflow-y: auto;
}
.menu-panel.is-open { opacity: 1; visibility: visible; }
.menu-eyebrow { color: var(--ink-soft); margin-bottom: 0.4rem; }
.menu-nav { display: flex; flex-direction: column; gap: clamp(0.15rem, 0.9vh, 0.6rem); }
.menu-link {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3.6rem);
  letter-spacing: -0.03em; line-height: 1.02; text-decoration: none;
  color: var(--ink); width: max-content; transition: color 0.25s, transform 0.25s;
}
.menu-link:hover { color: var(--accent); transform: translateX(0.5rem); }
.menu-sub {
  font-family: var(--mono); font-size: 0.9rem; font-weight: 400;
  letter-spacing: 0.02em; text-transform: none; color: var(--ink-soft);
  padding-left: 1.4rem; margin-top: 0.15rem;
}
.menu-sub:hover { color: var(--sea); transform: translateX(0.4rem); }
.menu-back {
  margin-top: clamp(1.2rem, 4vh, 2.4rem); padding-top: 1.2rem;
  border-top: 1px solid var(--ink-faint);
}
.menu-back a {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft); text-decoration: none;
}
.menu-back a:hover { color: var(--accent); }
body.menu-lock { overflow: hidden; }

/* ============ layout primitives ============ */
.section { padding: clamp(4.5rem, 11vh, 8rem) var(--gutter); max-width: 78rem; margin: 0 auto; }
.section-narrow { max-width: 52rem; }

.section-label {
  color: var(--ink-soft); margin-bottom: clamp(1.8rem, 5vh, 3rem);
  display: flex; align-items: center; gap: 0.75rem;
  /* Marked up as <h2> so every section sits properly under the page <h1>; the label
     look is entirely class-driven, so the heading defaults are reset here. */
  font-weight: 400;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--ink-faint); }
.label-no { color: var(--accent); font-weight: 700; }

.section-title {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 3.6rem); line-height: 1.06;
  letter-spacing: -0.02em; margin-bottom: clamp(1.4rem, 4vh, 2.2rem);
}
.section-title em { font-weight: 400; }

.prose p { max-width: var(--measure); font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--ink); margin-bottom: 1.15rem; }
.prose p.soft { color: var(--ink-soft); }
.prose a { color: var(--sea); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--sea) 45%, transparent); }
.prose a:hover { color: var(--accent); border-color: var(--accent); }
.prose h3 {
  font-family: var(--sans); font-weight: 600; font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  letter-spacing: -0.01em; margin: 2.4rem 0 0.6rem; color: var(--accent);
}

/* ============ page hero ============ */
.page-hero {
  min-height: 82svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8rem var(--gutter) clamp(2.5rem, 6vh, 4rem);
  max-width: 78rem; margin: 0 auto; position: relative;
}
.page-hero.center { justify-content: center; }
.hero-kicker { color: var(--ink-soft); margin-bottom: clamp(1.2rem, 3vh, 2rem); }
.hero-title {
  font-weight: 500; font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 0.98; letter-spacing: -0.03em;
}
.hero-line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hl-inner { display: inline-block; will-change: transform; }
.hero-title em { font-weight: 400; letter-spacing: -0.01em; }
.hero-sub {
  margin-top: clamp(1.4rem, 3vh, 2.2rem); max-width: 34rem;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--ink-soft);
}
.scroll-hint { position: absolute; bottom: 1.5rem; left: var(--gutter); color: var(--ink-soft); }
.scroll-arrow { display: inline-block; }

/* ============ home hero: parallax reveal of the full photo ============ */
.hero-parallax { position: relative; width: 100%; }
.hero-figure {
  position: relative; width: 100%; overflow: hidden; background: var(--ink);
}
.hero-figure img { display: block; width: 100%; height: auto; will-change: transform; }
.hero-figure .hero-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(20,33,43,0.72) 0%, rgba(20,33,43,0.12) 42%, rgba(20,33,43,0.34) 100%);
}
.hero-figure .hero-caption {
  position: absolute; left: var(--gutter); bottom: clamp(2rem, 6vh, 4rem); right: var(--gutter);
  max-width: 78rem; margin: 0 auto; color: var(--paper); z-index: 2;
}
.hero-figure .hero-caption .hero-title { color: var(--paper); }
.hero-figure .hero-caption .hero-kicker { color: rgba(238,233,220,0.78); }
.hero-figure .hero-caption .hero-sub { color: rgba(238,233,220,0.82); }

/* wide screens: pin a viewport-tall window and parallax-scroll the tall photo
   through it, so its full height is revealed top-to-bottom as you scroll */
@media (min-width: 1024px) {
  .hero-parallax { height: 130svh; }
  .hero-figure { position: sticky; top: 0; height: 100svh; }
  .hero-figure img { position: absolute; top: 0; left: 0; min-height: 100%; object-fit: cover; }
}
/* phones/tablets: the photo is otherwise a short landscape band. Make it fill the
   viewport so the hero reads full-height, with the caption anchored at the bottom. */
@media (max-width: 1023px) {
  .hero-figure { height: 100svh; }
  .hero-figure img { height: 100%; object-fit: cover; object-position: center; }
}

/* ============ quote block ============ */
.quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem); line-height: 1.25;
  letter-spacing: -0.01em; max-width: 46rem; color: var(--ink);
}
.quote cite {
  display: block; margin-top: 1.2rem; font-family: var(--mono); font-style: normal;
  font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
}

/* ============ ambient sailing video, with the E.B. White quote beneath ============ */
.quote-video {
  position: relative; isolation: isolate;
  /* Match the footage's own 16:9 so object-fit: cover has nothing to crop. A fixed
     min-height forced a ~1.4:1 box and cut most of the width off the frame. */
  aspect-ratio: 16 / 9;
  /* Constrain the WIDTH, not the height. Capping height while width stayed 100% left
     the box wider than 16:9 — which both re-cropped the frame and pushed it off centre.
     Shrinking the width instead keeps a true 16:9 always, and margin-inline centres
     whatever is left over on very wide screens. */
  width: min(100%, calc(100svh * 16 / 9));
  margin-inline: auto;
  background: var(--ink);
}
.quote-bg {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}
/* No scrim at all — the quote lives below the video now, so the frame is left alone. */
.quote-under {
  text-align: center; padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(3.5rem, 9vh, 6rem);
}
.quote-under .quote { max-width: 46rem; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { .quote-bg { display: none; } }
.pull {
  border-left: 2px solid var(--accent); padding-left: 1.4rem;
  margin: clamp(2rem, 5vh, 3rem) 0;
}

/* ============ figure + media ============ */
.figure { margin: clamp(2rem, 5vh, 3.2rem) 0; }
.figure img {
  width: 100%; display: block; border: 1px solid var(--ink-faint);
  background: var(--paper-deep);
}
.figure figcaption { margin-top: 0.9rem; color: var(--ink-soft); font-size: 0.9rem; }
.figure.plain img { box-shadow: none; border: 1px solid var(--ink-faint); }

/* ============ spec table ============ */
.spec-grid {
  list-style: none; margin: clamp(2rem, 5vh, 3rem) 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  border-top: 1px solid var(--ink); border-left: 1px solid var(--ink-faint);
}
.spec-grid li { border-right: 1px solid var(--ink-faint); border-bottom: 1px solid var(--ink-faint); padding: 1.1rem 1.2rem; }
.spec-grid dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.spec-grid dd { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.1; margin-top: 0.35rem; color: var(--ink); }
/* The sub-label sits on its own line under the figure. Inline it wrapped mid-phrase
   ("displacement /" then "length") against the serif's tight 1.1 line-height. */
.spec-grid dd small {
  display: block; margin-top: 0.4rem;
  font-family: var(--sans); font-size: 0.8rem; line-height: 1.4;
  letter-spacing: 0; color: var(--ink-soft);
}

/* ============ gallery grid ============ */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(0.5rem, 1.2vw, 0.9rem); margin-top: clamp(2rem, 5vh, 3rem);
}
.gallery figure { position: relative; overflow: hidden; aspect-ratio: 4/3; background: var(--paper-deep); border: 1px solid var(--ink-faint); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
@media (hover:hover) { .gallery figure:hover img { transform: scale(1.05); } }

/* ============ index cards (section landing) ============ */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px; background: var(--ink-faint); border: 1px solid var(--ink-faint);
  margin-top: clamp(2rem, 5vh, 3rem);
}
.card {
  background: var(--paper); padding: clamp(1.4rem, 3vw, 2.2rem);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  min-height: 11rem; transition: background 0.3s;
}
.card:hover { background: var(--paper-deep); }
.card-no {
  font-family: var(--mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.06em;
}
.card h3 { font-weight: 600; font-size: 1.35rem; letter-spacing: -0.01em; margin: auto 0 0.4rem; transition: color 0.25s; }
.card:hover h3 { color: var(--accent); }
.card p { color: var(--ink-soft); font-size: 0.92rem; }
.card .arrow { color: var(--accent); font-family: var(--mono); margin-top: 0.6rem; }

/* ============ contact ============ */
.contact-title { font-weight: 500; font-size: clamp(2.4rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -0.03em; margin-bottom: clamp(1.6rem, 4vh, 2.4rem); }
.contact-email {
  display: inline-block; font-family: var(--serif); font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  color: var(--accent); text-decoration: none; border-bottom: 2px solid var(--accent);
  padding-bottom: 0.1em; will-change: transform;
}
.contact-meta { margin-top: 2rem; color: var(--ink-soft); }
.contact-meta a { color: var(--ink); text-decoration-color: var(--accent); }
.contact-meta a:hover { color: var(--accent); }

/* newsletter / form */
.form-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; max-width: 34rem; }
.form-row input {
  flex: 1 1 12rem; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: transparent; border: 1px solid var(--ink-faint); border-radius: 0;
  padding: 0.85rem 1rem;
}
.form-row input:focus { outline: none; border-color: var(--accent); }
.btn {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 0.85rem 1.4rem; cursor: pointer; transition: background 0.25s, color 0.25s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }

/* ============ footer ============ */
.site-footer { border-top: 1px solid var(--ink-faint); }
.footer-inner {
  max-width: 78rem; margin: 0 auto; padding: clamp(2.5rem, 6vh, 4rem) var(--gutter);
  display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: baseline;
}
.footer-social { display: flex; gap: 1.2rem; }
.footer-social a { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.footer-social a:hover { color: var(--accent); }
.footer-note { color: var(--ink-soft); font-size: 0.82rem; max-width: 30rem; }
.footer-note a { color: var(--ink); text-decoration-color: var(--accent); }

/* ============ reveal defaults (JS animates in) ============ */
.js .reveal { opacity: 0; transform: translateY(28px); }
.js .hl-inner { transform: translateY(110%); }

/* ============ hero backlink ============ */
/* .scroll-hint is absolutely positioned at the bottom of the hero, so the backlink
   needs to reserve room for it or the two collide on short heroes. */
.hero-backlink { margin-top: 1rem; margin-bottom: 3.5rem; }
@media (max-width: 760px) { .hero-backlink { margin-bottom: 0; } }
.hero-backlink a { color: var(--ink-soft); text-decoration: none; transition: color 0.25s; }
.hero-backlink a:hover { color: var(--accent); }

/* ============ card thumbnails (gallery landing) ============ */
.card-thumb { position: relative; overflow: hidden; min-height: 14rem; }
.card-thumb::before {
  content: ""; position: absolute; inset: 0; background: var(--thumb) center/cover no-repeat;
  opacity: 0; transform: scale(1.08); transition: opacity 0.5s, transform 0.8s cubic-bezier(0.22,1,0.36,1); z-index: 0;
}
.card-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--paper) 12%, rgba(238,233,220,0.35) 60%, transparent); opacity: 0; transition: opacity 0.5s; z-index: 1; }
.card-thumb:hover::before { opacity: 1; transform: scale(1); }
.card-thumb:hover::after { opacity: 1; }
.card-thumb > * { position: relative; z-index: 2; }

/* ============ download cards ============ */
.card-dl .card-no { color: var(--sea); }
.card-dl:hover { background: var(--paper-deep); }
.card-dl h3 { margin-top: auto; }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); }
.figure-row .figure { margin: 0; }
.figure-row.plain img, .figure .plain { background: var(--paper-deep); }

/* ============ projects: card grid ============ */
.proj-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--ink-faint); border: 1px solid var(--ink-faint);
  margin-top: clamp(2rem, 5vh, 3rem);
}
.proj-card {
  display: flex; flex-direction: column; background: var(--paper);
  text-decoration: none; color: inherit; overflow: hidden; transition: background 0.3s;
}
.proj-card:hover { background: var(--paper-deep); }
.proj-card-img { display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-deep); }
/* Placeholder panel for a project whose photos have not been added yet — keeps the card
   the same shape as its neighbours instead of collapsing. */
.proj-card-blank {
  display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(-45deg,
    var(--paper-deep) 0 10px, color-mix(in srgb, var(--paper-deep) 55%, var(--paper)) 10px 20px);
}
.proj-card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
@media (hover:hover) { .proj-card:hover .proj-card-img img { transform: scale(1.05); } }
.proj-card-body {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
}
.proj-card-no { font-size: 0.72rem; letter-spacing: 0.06em; color: var(--accent); }
.proj-card-title {
  font-family: var(--serif); font-size: clamp(1.35rem, 2.2vw, 1.8rem); line-height: 1.15;
  color: var(--ink); transition: color 0.25s;
}
.proj-card:hover .proj-card-title { color: var(--accent); }
.proj-card-meta { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
/* Two columns from tablet all the way down to phones — the cards squeeze happily. */
@media (max-width: 980px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ projects: alternating rows ============ */
.proj-jump {
  max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; align-items: center;
  border-bottom: 1px solid var(--ink-faint); padding-bottom: 1.5rem;
}
.proj-jump a { color: var(--ink-soft); text-decoration: none; transition: color 0.25s; }
.proj-jump a:hover { color: var(--accent); }
.proj {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
}
.proj-right .proj-text { order: 2; }
.proj-lead {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.9rem); line-height: 1.3;
  color: var(--ink); margin-bottom: 1.4rem;
}
.proj-list { list-style: none; }
.proj-list li {
  padding: 0.5rem 0 0.5rem 1.5rem; position: relative; color: var(--ink-soft);
  border-bottom: 1px solid var(--ink-faint);
}
.proj-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); font-size: 0.8em; top: 0.7em; }
.proj-img { margin: 0; overflow: hidden; }
.proj-img img { width: 100%; display: block; border: 1px solid var(--ink-faint); transition: transform 0.7s cubic-bezier(0.22,1,0.36,1); }
@media (hover:hover) { .proj-img:hover img { transform: scale(1.03); } }
.proj-img a { display: block; }
.proj-more { margin-top: 1.6rem; }
.text-link {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent;
  padding-bottom: 2px; transition: border-color 0.25s, color 0.25s;
}
.text-link:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }
.text-link span { display: inline-block; transition: transform 0.25s; }
.text-link:hover span { transform: translateX(4px); }
@media (max-width: 760px) {
  .proj { grid-template-columns: 1fr; }
  .proj-right .proj-text { order: 0; }
}

/* ============ project sub-pages ============ */
.page-hero-sub { min-height: 46vh; }
.figure-wide { margin: 0 auto; max-width: 1000px; }
.figure-wide img {
  width: 100%; display: block; border: 1px solid var(--ink-faint); background: var(--paper-deep);
}
.proj-list-wide { max-width: 640px; margin-bottom: 2.4rem; }
.gallery-note { margin-top: 0.6rem; font-size: 0.92rem; }
.tech-note {
  font-size: 0.82rem; line-height: 1.65; color: var(--ink-soft);
  border-left: 2px solid var(--accent); padding: 0.4rem 0 0.4rem 1.1rem; margin: 0.7rem 0;
  background: var(--paper-deep);
}
.proj-prevnext {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  max-width: var(--wrap, 1200px); margin: 2rem auto 5rem; padding: 2rem clamp(1.2rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--ink-faint);
}
.proj-prevnext a {
  font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.2;
  color: var(--ink); text-decoration: none; transition: color 0.25s;
}
.proj-prevnext a:hover { color: var(--accent); }
.proj-prevnext .mono { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.proj-prevnext .pn-next { text-align: right; }

/* ============ links list ============ */
.link-list { list-style: none; border-top: 1px solid var(--ink); }
.link-item a {
  display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; align-items: baseline;
  padding: clamp(1rem, 2.4vw, 1.5rem) 0; border-bottom: 1px solid var(--ink-faint);
  text-decoration: none; color: var(--ink); transition: padding-left 0.3s;
}
.link-item a:hover { padding-left: 0.7rem; }
.link-title { font-size: clamp(1.15rem, 2.4vw, 1.7rem); font-weight: 600; letter-spacing: -0.01em; transition: color 0.25s; }
.link-item a:hover .link-title { color: var(--accent); }
.link-desc { grid-column: 1; color: var(--ink-soft); font-size: 0.95rem; }
.link-host { grid-column: 2; grid-row: 1 / span 2; color: var(--ink-soft); align-self: center; white-space: nowrap; }

/* ============ lightbox ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(9,16,21,0.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; box-shadow: 0 24px 70px rgba(0,0,0,0.55); }
.lb-btn {
  position: absolute; background: none; border: 0; color: var(--paper); cursor: pointer;
  font-family: var(--mono); font-size: 2rem; line-height: 1; padding: 0.5rem 0.9rem;
  opacity: 0.7; transition: opacity 0.2s, color 0.2s;
}
.lb-btn:hover { opacity: 1; color: var(--accent); }
.lb-close { top: 1rem; right: 1.2rem; font-size: 1.6rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1.2rem; left: 0; right: 0; text-align: center; color: rgba(238,233,220,0.8); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; }
.gallery figure { cursor: zoom-in; }

/* ============ equipment browser (specification) ============ */
/* The inventory is the page's working area, so it gets a much tighter top margin than
   the standard section rhythm — that reclaims up to ~90px and puts more of the list
   on screen once a filter anchors the heading to the top. */
#equipment { padding-top: clamp(1.75rem, 3.5vh, 2.75rem); }
#equipment .section-label { margin-bottom: clamp(1rem, 2.5vh, 1.5rem); }

/* Filters in a sidebar: the chips used to wrap across two full-width rows above the
   list, costing ~120px of vertical band on every screen. */
.equip-layout {
  display: grid; grid-template-columns: minmax(190px, 15rem) 1fr;
  gap: clamp(1.5rem, 3vw, 3rem); align-items: start;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}
.equip-controls { position: sticky; top: 84px; }
/* Keeps the document from collapsing when a one-item category is selected, which
   would otherwise clamp the scroll position and bounce the page. */
.equip-list { min-height: 70vh; }
.equip-search { width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink); background: transparent; border: 1px solid var(--ink-faint); padding: 0.8rem 1rem; }
.equip-search:focus { outline: none; border-color: var(--accent); }
.equip-chips { display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem; margin-top: 1rem; }
.chip {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent; border: 0; border-left: 2px solid transparent;
  padding: 0.5rem 0.7rem; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-align: left; line-height: 1.35;
}
.chip:hover { color: var(--accent); border-left-color: var(--ink-faint); }
.chip.is-active { color: var(--ink); border-left-color: var(--accent); background: var(--paper-deep); }
.equip-count { margin-top: 0.7rem; color: var(--ink-soft); }
/* Mobile-only category dropdown, built by js/astarte.js from the chips. Hidden on
   desktop, where the vertical chip list is used instead. */
.equip-select { display: none; }
@media (max-width: 860px) {
  .equip-layout { grid-template-columns: 1fr; }
  .equip-controls {
    position: sticky; top: 60px; z-index: 20; padding: 0.9rem 0;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--ink-faint);
  }
  /* The vertical chip list gives way to a single dropdown here — a horizontal chip
     strip used to run off the right edge and stretch the whole page sideways. */
  .equip-chips { display: none; }
  .equip-select {
    display: block; width: 100%; margin-top: 0.8rem;
    font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--ink); background-color: var(--paper);
    border: 1px solid var(--ink-faint); border-radius: 0;
    padding: 0.7rem 2.2rem 0.7rem 0.9rem; cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23a9772f' d='M3 5.5l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.85rem center; background-size: 0.85rem;
  }
  .equip-select:focus { outline: none; border-color: var(--accent); }
}

/* ============ information tooltips ============ */
.spec-grid li.has-tip dt { display: flex; align-items: center; gap: 0.45rem; }
.tip {
  flex: 0 0 auto; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  border: 1px solid var(--ink-faint); background: transparent; color: var(--ink-soft);
  font-family: var(--mono); font-size: 0.62rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tip:hover, .tip:focus-visible, .tip[aria-expanded="true"] {
  color: var(--paper); background: var(--accent); border-color: var(--accent); outline: none;
}
/* Desktop: a positioned panel beside the trigger. */
.tip-pop {
  position: absolute; z-index: 90; max-width: min(30rem, calc(100vw - 2rem));
  background: var(--ink); color: var(--paper);
  padding: 1.15rem 1.3rem; line-height: 1.6; font-size: 0.92rem;
  box-shadow: 0 18px 50px rgba(20,33,43,0.28);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.tip-pop.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.tip-pop .tip-close { display: none; }
/* Touch: a centred card with an explicit close, since there is no hover to end. */
@media (pointer: coarse) {
  /* The dot stays visually small but gets a 44px hit area, the minimum comfortable
     tap target — without it the control is ~18px and easy to miss. */
  .tip { position: relative; }
  .tip::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 44px; height: 44px; transform: translate(-50%, -50%);
  }
  .tip-pop {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%);
    width: min(28rem, calc(100vw - 2.5rem)); max-width: none;
    padding: 2rem 1.6rem 1.7rem; font-size: 1rem;
  }
  .tip-pop.is-open { transform: translate(-50%, -50%); }
  .tip-pop .tip-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 0.5rem; right: 0.5rem; width: 2.25rem; height: 2.25rem;
    background: transparent; border: 0; color: var(--paper); font-size: 1.15rem; cursor: pointer;
  }
  .tip-backdrop {
    position: fixed; inset: 0; z-index: 89; background: rgba(20,33,43,0.45);
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
  }
  .tip-backdrop.is-open { opacity: 1; visibility: visible; }
}
.equip-cat { margin-top: clamp(2rem, 5vh, 3rem); }
.equip-cat.is-hidden { display: none; }
.equip-cat h3 { font-family: var(--sans); font-weight: 600; font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: -0.01em; color: var(--accent); padding-bottom: 0.6rem; border-bottom: 1px solid var(--ink); }
.equip-cat ul { list-style: none; }
.equip-cat li { display: flex; align-items: baseline; gap: 0.75rem; justify-content: space-between; padding: 0.7rem 0; border-bottom: 1px solid var(--ink-faint); color: var(--ink); transition: color 0.2s; }
.equip-cat li.is-hidden { display: none; }
.equip-cat li:hover { color: var(--accent); }
.equip-cat li mark { background: var(--accent); color: var(--paper); border-radius: 2px; padding: 0 0.1em; }
.equip-cat li .badge { flex: none; font-size: 0.6rem; letter-spacing: 0.08em; color: var(--sea); border: 1px solid color-mix(in srgb, var(--sea) 40%, transparent); border-radius: 100px; padding: 0.15rem 0.55rem; white-space: nowrap; }
.equip-empty { color: var(--ink-soft); font-style: italic; padding: 2rem 0; }

/* ============ three.js sea band (home) ============ */
.sea-band { position: relative; height: 46svh; min-height: 300px; overflow: hidden; background: var(--paper); }
.sea-band canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }

/* ============ responsive ============ */
@media (max-width: 760px) {
  .scroll-hint { display: none; }
  .link-item a { grid-template-columns: 1fr; }
  .link-host { grid-column: 1; grid-row: auto; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .hl-inner { opacity: 1 !important; transform: none !important; }
  .curtain { display: none; }
}
