/* ============================================================================
   Photlin Aquarium — the landing page theme.
   Monochrome: ink, paper and the greys between. The only colour on the page is
   the app's own screenshots. Fish and flora are the only living things.
   ========================================================================== */

:root {
  --bg: #fafaf7;
  --surface: #efeee9;
  --ink: #161614;
  --ink-soft: #3c3a37;
  --dim: #77776f;
  --line: rgba(22, 22, 20, 0.14);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  /* one light, high and to the upper left: every shadow falls down and to the right */
  --shadow: 7px 11px 18px rgba(22, 22, 20, 0.17);
  --shadow-sm: 4px 6px 10px rgba(22, 22, 20, 0.17);
  --frame-off: 10px;
  --gap: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; color: var(--ink); overflow-x: clip; }

/* the pond floor: a faint stipple so the fish beneath the page still read above it */
html {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(22, 22, 20, 0.045) 0.8px, transparent 1px);
  background-size: 14px 14px;
  scroll-behavior: smooth;
}
body {
  background: transparent;
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the fish layers ---------- */
.fish-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 20; }
.fish-canvas.under { z-index: -1; }

/* ---------- flora: reeds, papyrus, lilies grow from behind the frames ---------- */
.flora { position: absolute; z-index: 1; pointer-events: none;
  filter: drop-shadow(6px 9px 5px rgba(22, 22, 20, 0.2)); }
.flora svg { display: block; overflow: visible; }
.flora .bob { transform-origin: 50% 90%; animation: flora-bob 7s ease-in-out infinite; }
.flora .sway { animation: flora-sway 4s ease-in-out infinite; }
@keyframes flora-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1.2deg); } }
@keyframes flora-sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }

/* ---------- frames: every screenshot sits in an ink frame pushed down-right ---------- */
.shot { position: relative; margin: 0 var(--frame-off) var(--frame-off) 0; }
.frame-line { position: absolute; inset: 0; z-index: 1;
  transform: translate(var(--frame-off), var(--frame-off));
  border: 1.4px solid var(--ink); pointer-events: none; }
.shot-frame { position: relative; z-index: 2; display: block; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- buttons: ink outlines, shadows down-right ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 1.4px solid var(--ink); background: var(--bg); color: var(--ink);
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 9px 14px rgba(22, 22, 20, 0.2); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 2px 3px rgba(22, 22, 20, 0.2); }
.btn-accent { background: var(--ink); color: var(--bg); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.72rem; }
.btn .chev { font-size: 0.7em; }

/* ---------- top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 18px; background: rgba(250, 250, 247, 0.86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px rgba(22, 22, 20, 0.06);
  transform: translateY(-100%); transition: transform 0.35s ease; }
.topbar[data-show="true"] { transform: none; }
.topbar .brand { display: flex; align-items: center; gap: 9px; margin-right: auto; font-family: var(--serif); font-size: 1.05rem; }
.topbar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }

/* hamburger: hidden until the topbar appears (scrolled). When shown it
   replaces the wordmark, and its menu links through to the docs. */
.topbar .menu-btn { display: none; }
.topbar[data-show="true"] .brand { display: none; }
.topbar[data-show="true"] .menu-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  margin-right: auto; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.topbar .menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.topbar .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topbar .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topbar-menu { position: absolute; top: 56px; left: 12px; z-index: 50; min-width: 210px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column; }
.topbar-menu[hidden] { display: none; }
.topbar-menu a { padding: 11px 13px; border-radius: 8px; color: var(--ink); font-size: 14px; text-decoration: none; }
.topbar-menu a:first-child { font-weight: 600; }
.topbar-menu a:hover { background: var(--surface); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg);
  padding: 9px 14px; font-size: 0.8rem; transition: top 0.2s ease; }
.skip-link:focus { top: 10px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 64px 20px 36px; overflow: hidden; }
/* Desktop: the camera (with its ripples + orbiting vocabulary) sits on the
   LEFT, the title / mantra / buttons on the RIGHT — side by side so neither
   fights for space. Below 760px it re-stacks vertically (camera above copy). */
.hero-stack { position: relative; z-index: 2; width: 100%; max-width: 1200px;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: clamp(28px, 5vw, 84px); transform: translateY(-6px); }
.hero-camera-col { flex: 0 1 680px; display: flex; justify-content: center; min-width: 0; }
/* The word-pointillism camera is the welcoming point. Its own SVG carries the
   concentric ripples; the surrounding vocabulary orbits it like a solar system. */
.camera-stage { position: relative; width: min(100%, 660px, 82vh); margin: 0; transform: none; }
.hero-copy { flex: 0 1 400px; display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; min-width: 0; }
/* The artwork is served as a pre-rasterised WebP (decodes in milliseconds);
   the SVG is kept as the vector master for browsers without WebP support. */
.camera-pic { display: block; width: 100%; }
.camera-art { position: relative; z-index: 1; display: block; width: 100%; height: auto;
  /* promote to its own compositor layer so the fade/transform during the
     intro never triggers a re-raster of the raster image */
  will-change: opacity, transform; }
.cloud-plants { position: absolute; inset: -6% -8%; z-index: 2; pointer-events: none; }
.cloud-plants .flora { opacity: 0.42; }
/* The camera's surrounding words remain the site's table of contents. They are
   pinned to the outer edges so they can never overflow the artwork. */
.camera-nav { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.camera-nav a { position: absolute; display: block; white-space: nowrap; pointer-events: auto;
  text-align: center; transform: translate(-50%, -50%);
  font-family: var(--sans); font-size: clamp(9px, 1.05vw, 13px); letter-spacing: 0.02em;
  color: var(--ink-soft); text-decoration: none; cursor: pointer;
  text-shadow: 0 0 5px var(--bg), 0 0 5px var(--bg), 0 1px 0 var(--bg);
  transition: transform .2s ease, color .2s ease; }
.camera-nav a:hover { color: var(--ink); transform: translate(-50%, calc(-50% - 2px)); }
.camera-nav a[data-target]::after { content: ""; display: block; height: 1px; width: 0;
  background: var(--ink); transition: width .25s ease; }
.camera-nav a:hover::after { width: 100%; }
.camera-nav .nav-key { font-size: clamp(11px, 1.35vw, 16px); font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.hero-plants { position: absolute; inset: -10% -16%; z-index: 0; pointer-events: none; }
/* The title is the centre of focus: all caps, larger, generous tracking. */
.hero-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.0;
  margin: 10px 0 0; letter-spacing: 0.055em; text-transform: uppercase; }
.hero-tagline { margin: 14px 0 20px; font-size: 1.02rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hero-copy .hero-actions { justify-content: flex-start; }
.hero-scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft); }
.hero-scroll .chev { display: block; margin: 6px auto 0; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--ink); animation: nudge 2.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(4px); opacity: 1; } }

/* ---------- section intro ---------- */
.section { position: relative; padding: clamp(48px, 8vw, 96px) 20px; }
.section-head { max-width: 720px; margin: 0 auto clamp(28px, 5vw, 56px); text-align: center; }
.kicker { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin: 12px 0 10px; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-soft); margin: 0 auto; max-width: 56ch; }

/* ---------- feature rows: framed screenshot + text, plants around ---------- */
.features { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(56px, 9vw, 110px); }
.feature { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media { position: relative; display: flex; justify-content: center; align-items: center; }
.feature-media .shot { width: min(300px, 100%); }
.feature-media .shot-frame { aspect-ratio: 9 / 19; }
.feature-text { position: relative; }
.feature-text .idx { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.22em; color: var(--dim); }
.feature-text h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  margin: 8px 0 14px; letter-spacing: -0.01em; }
.feature-text p { color: var(--ink-soft); line-height: 1.6; margin: 0 0 16px; }
.feature-text .sub-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.feature-text .sub-list li { display: flex; gap: 12px; align-items: baseline; font-size: 0.96rem; }
.feature-text .sub-list b { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; flex: none; min-width: 0; }
.feature-text .sub-list .ln { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); }

/* ---------- contact sheet: every screenshot framed, like the client ---------- */
.sheet { position: relative; max-width: 1320px; margin: 0 auto; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap); }
.sheet-card { position: relative; }
.sheet-card .shot { margin: 0 var(--frame-off) var(--frame-off) 0; }
.sheet-card .frame-line { z-index: 1; }
.sheet-card .shot-frame { z-index: 2; aspect-ratio: 9 / 19; cursor: pointer; }
.sheet-card .shot-frame img { transition: filter 0.6s ease, transform 0.6s ease; }
.sheet-card:hover .shot-frame img { transform: scale(1.03); }
.sheet-card .meta { display: block; margin: 6px 0 0 2px; font-size: 0.82rem; color: var(--ink-soft); }
.sheet-card .meta b { font-weight: 600; }
.sheet-group-title { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 18px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }

/* ---------- final call to action ---------- */
.cta { position: relative; text-align: center; padding: clamp(56px, 10vw, 110px) 20px; }
.cta h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 16px; letter-spacing: -0.01em; }
.cta p { color: var(--ink-soft); margin: 0 auto 28px; max-width: 52ch; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- footer: the far bank of the pond ---------- */
.site-footer { position: relative; margin-top: clamp(48px, 10vh, 120px); border-top: 1px solid var(--line);
  padding: clamp(48px, 9vw, 100px) clamp(20px, 6vw, 80px) clamp(56px, 11vh, 140px); }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: clamp(30px, 7vh, 64px); }
.footer-brand { display: flex; align-items: baseline; gap: 12px; }
.footer-brand .name { font-family: var(--serif); font-size: 1.6rem; }
.footer-brand .tag { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.footer-lines { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.footer-lines a { text-decoration: underline; text-underline-offset: 4px; }
.legal { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: clamp(34px, 8vh, 80px); font-size: 0.76rem; color: var(--dim); }
.legal a { text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column;
  height: 100dvh; opacity: 0; visibility: hidden; transition: opacity 0.2s ease; }
.lightbox[aria-hidden="false"] { opacity: 1; visibility: visible; }
.lightbox-bar { flex: none; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px; }
.lightbox-stage { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 8px; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain;
  filter: drop-shadow(6px 10px 14px rgba(22, 22, 20, 0.18)); }
.lightbox-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 1.4rem; }
.lightbox-close:hover { background: rgba(22, 22, 20, 0.06); }
.lightbox-count { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--dim); }

/* ---------- reveal (only when JS is on) ---------- */
.reveal-ready .feature, .reveal-ready .sheet-group { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-ready .feature.in, .reveal-ready .sheet-group.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  :root { --frame-off: 8px; --gap: 22px; }

  /* --- hero: stacked on phones — camera above, then the ALL-CAPS title --- */
  .hero { padding: 62px 12px 38px; }
  .hero-stack { flex-direction: column; gap: 0; transform: translateY(-8px); }
  .hero-camera-col { flex: none; width: 100%; }
  .camera-stage { width: min(430px, 96vw); transform: translateY(-6px); }
  .hero-copy { flex: none; width: 100%; align-items: center; text-align: center; }
  .hero-copy .hero-actions { justify-content: center; }
  .cloud-plants { inset: -4% -3%; }
  .cloud-plants .flora { opacity: 0.34; }
  /* only a handful of surrounding words on small screens — no crowding */
  .camera-nav a { font-size: 10px; }
  .camera-nav .nav-key { font-size: 12px; }
  .camera-nav .nav-optional { display: none; }
  .hero-title { font-size: clamp(2.3rem, 12vw, 3.2rem); letter-spacing: 0.04em; margin-top: 18px; }
  .hero-tagline { font-size: 0.84rem; letter-spacing: 0.13em; margin: 14px 0 20px; }
  .hero-actions { gap: 10px; }

  /* --- the screenshots-only contact sheet repeats the feature shots and makes
         mobile scrolling far too long: drop it on small screens --- */
  #contact-sheet { display: none; }

  /* --- feature rows: much smaller phone screenshots, clean readable text --- */
  .section-head { text-align: left; }
  .features { gap: clamp(46px, 11vw, 64px); }
  .feature { grid-template-columns: 1fr; gap: 22px; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature-media .shot { width: min(186px, 50%); }
  .feature-text { text-align: left; padding: 0 2px; }
  .feature-text .idx { font-size: 0.7rem; letter-spacing: 0.18em; }
  .feature-text h3 { font-size: 1.55rem; margin: 6px 0 12px; }
  .feature-text p { font-size: 1rem; line-height: 1.66; }
  /* stack each sub-list row: bold label on its own line, description beneath.
     No dotted leader on narrow screens -> nothing gets squeezed or misaligned. */
  .feature-text .sub-list { gap: 16px; }
  .feature-text .sub-list li { display: block; font-size: 0.98rem; }
  .feature-text .sub-list b { display: block; font-size: 1.08rem; margin-bottom: 3px; }
  .feature-text .sub-list .ln { display: none; }
  .feature-text .sub-list li > span:last-child { display: block; color: var(--ink-soft); line-height: 1.55; }
  /* keep the decorative plants off the copy, and soften the fish over text */
  .feature-text-plant { display: none !important; }
  .fish-canvas:not(.under) { opacity: 0.4; }
}

/* short viewports: keep the hero (and its scroll cue) on a single screen */
@media (max-height: 720px) {
  .ascii-cam { font-size: clamp(6px, 1.4vw, 11px); }
  .hero { padding-top: 76px; padding-bottom: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
