/* ============================================================
   SUMMER STUDIOS 88 — DESIGN SYSTEM
   "Coastal Institutional" — deep teal + warm coral on pure white.
   Teal reads calm and trustworthy; coral carries the warmth and
   the calls to action. Every text/background pair below meets or
   exceeds WCAG 2.1 AA at its stated size.

   Note on token names: the surface tokens are still called --ink*
   for historical reasons, but now hold light values. --accent is
   TEAL (the readable one, safe for small text on white); coral is
   --coral and is reserved for buttons, large headings, and accents
   where its lower contrast on white is not a legibility risk.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  /* Surfaces — pure white base, with barely-there raised panels */
  --ink: #ffffff;               /* page background */
  --ink-raised: #f6fafa;        /* cards, quotes, form fields — a whisper of teal */
  --ink-sunk: #eef4f4;          /* footer, deep sections */
  --line: rgba(18, 35, 42, 0.12);
  --line-strong: rgba(18, 35, 42, 0.24);

  /* Text — contrast-checked against white */
  --text: #12232a;              /* deep teal-ink — 15.3:1 */
  --text-2: #3a4b52;            /* 9.1:1 */
  --text-3: #5c6b71;            /* 5.6:1 — AA for body and small text */

  /* Brand */
  --teal: #0d7377;              /* 5.1:1 on white — safe for links + small text */
  --teal-deep: #0a5457;         /* 7.4:1 — headings, hovers */
  --coral: #ff6b5c;             /* buttons, large display marks (NOT small text) */
  --coral-ink: #d84a3c;         /* 4.6:1 — coral you CAN use on white for small text */
  --gold: #f4b942;              /* warm secondary accent, decorative */
  --gold-ink: #9a6b00;          /* 4.6:1 — gold-family text that passes on white */

  /* Semantic alias: --accent is the readable brand color (teal). */
  --accent: var(--teal);
  --ember: var(--coral);        /* legacy alias kept so old refs resolve */

  /* Type — grotesque display, humanist body */
  --display: "Space Grotesk", "Trebuchet MS", sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --gutter: clamp(20px, 5vw, 88px);
  --section: clamp(72px, 9vw, 132px);
  --maxw: 1180px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(13, 115, 119, 0.18);
  color: var(--text);
}

/* ---------- Accessibility floor ---------- */

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  background: var(--teal-deep);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Layout ---------- */

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

.section {
  padding-block: var(--section);
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

.grid-2 {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2--wide-left {
    grid-template-columns: 1.15fr 1fr;
  }
}

.grid-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.06;
  text-wrap: balance;
}

.h-display {
  font-size: clamp(2.6rem, 8.5vw, 6.6rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.h-1 {
  font-size: clamp(2rem, 5.2vw, 3.9rem);
  letter-spacing: -0.04em;
}
.h-2 {
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
}
.h-3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1.02rem, 1.7vw, 1.22rem);
  line-height: 1.75;
  color: var(--text-2);
  max-width: 62ch;
}

.body-copy {
  color: var(--text-2);
  max-width: 68ch;
}
.body-copy p + p {
  margin-top: 1.15em;
}

.muted {
  color: var(--text-3);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.688rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
  margin-bottom: 18px;
}

.eyebrow--accent {
  color: var(--teal);
}

.mark {
  color: var(--coral);
}
.mark-gold {
  color: var(--gold-ink);
}

/* Signature element: the docket rail — a mono metadata strip that
   runs above every case and practice. Reads like a project file. */
.docket {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.docket span strong {
  color: var(--text);
  font-weight: 500;
  margin-left: 8px;
}

/* ---------- Links & buttons ---------- */

a {
  color: inherit;
}

.link {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.link:hover {
  text-decoration-thickness: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--coral);
  color: #fff;
}
.btn--primary:hover {
  box-shadow: 0 14px 34px rgba(255, 107, 92, 0.42);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--text);
}

/* ---------- Cards ---------- */

.card {
  display: block;
  height: 100%;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-raised);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
a.card:hover,
a.card:focus-visible {
  border-color: var(--teal);
  transform: translateY(-3px);
  background: #eef6f6;
  box-shadow: 0 12px 30px rgba(18, 35, 42, 0.08);
}

.card__meta {
  font-family: var(--mono);
  font-size: 0.688rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.card__title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
}

.card__body {
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.65;
}

/* ---------- Stat ledger ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--ink);
  padding: 26px 22px;
}
.stat:nth-child(odd) {
  background: var(--ink-raised);
}
.stat__value {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}
.stat__label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.4;
}

/* ---------- Lists ---------- */

.checklist {
  list-style: none;
  display: grid;
  gap: 11px;
}
.checklist li {
  position: relative;
  padding-left: 24px;
  font-size: 0.925rem;
  color: var(--text-2);
  line-height: 1.6;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.spec {
  list-style: none;
  border-top: 1px solid var(--line);
}
.spec li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.spec dt,
.spec .spec__k {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.spec .spec__v {
  color: var(--text);
  text-align: right;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav__brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.nav__brand span {
  color: var(--accent);
}
.nav__links {
  display: none;
  gap: 28px;
  align-items: center;
  list-style: none;
}
@media (min-width: 900px) {
  .nav__links {
    display: flex;
  }
  .nav__toggle {
    display: none;
  }
}
.nav__link {
  font-size: 0.85rem;
  color: var(--text-3);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav__link:hover {
  color: var(--text);
}
.nav__link[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.nav__toggle {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav__drawer[hidden] {
  display: none !important;
}
.nav__drawer {
  border-top: 1px solid var(--line);
  padding: 8px var(--gutter) 22px;
  list-style: none;
}
.nav__drawer li a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.95rem;
}
@media (min-width: 900px) {
  .nav__drawer {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(88px, 13vw, 170px) clamp(56px, 8vw, 100px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 10% -5%, rgba(13, 115, 119, 0.06), transparent 55%),
    radial-gradient(ellipse at 95% 15%, rgba(255, 107, 92, 0.05), transparent 55%);
}
.hero > * {
  position: relative;
  z-index: 1;
}

/* Flower canvas — sits behind hero content, ignores pointer, never
   causes layout shift. Sized generously and centered-right so the
   headline overlaps its left edge like the BluePixel orb. */
.flower {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.flower canvas,
.flower svg {
  position: absolute;
  top: 50%;
  left: 68%;
  width: min(760px, 92vw);
  height: min(760px, 92vw);
  transform: translate(-50%, -50%);
}
@media (max-width: 760px) {
  .flower canvas,
  .flower svg {
    left: 50%;
    top: 38%;
    opacity: 0.85;
  }
}

/* Faint echo used in later sections (static, cheap) */
.echo {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background: radial-gradient(circle at 85% 30%, rgba(13, 115, 119, 0.05), transparent 42%),
    radial-gradient(circle at 90% 34%, rgba(255, 107, 92, 0.045), transparent 38%);
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Case media ---------- */

.figure {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-raised);
  aspect-ratio: 16 / 10;
}
.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Quote ---------- */

.quote {
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--ink-raised);
  height: 100%;
}
.quote p {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 20px;
}
.quote footer {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------- Notice (for TODO placeholders) ---------- */

.notice {
  border: 1px dashed var(--coral-ink);
  border-radius: var(--radius);
  background: rgba(255, 107, 92, 0.07);
  padding: 20px 24px;
  font-size: 0.9rem;
  color: var(--text-2);
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(56px, 7vw, 84px) 40px;
  background: var(--ink-sunk);
}
.footer__cols {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  margin-bottom: 48px;
}
.footer h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}
.footer ul {
  list-style: none;
  display: grid;
  gap: 10px;
}
.footer a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer__base {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
