/* Shared by the home page and For studios. Tokens are the web app's light
   theme (src/theme.ts) so the site and app.choreosophy.com read as one
   product: gallery paper, ink, and seaglass spent only on jewelry. Muted
   7.6:1 and faint 4.8:1 on the paper ground — do not lighten. */
:root {
  --background: #FBFAF8;
  --surface: #FFFFFF;
  --surface-muted: #F5F4F1;
  --border: #E8E6E2;
  --border-strong: #D8D6D2;
  --text: #17181A;
  --text-muted: #4E5154;
  --text-faint: #6F7175;
  --ink: #1D1F23;
  --ink-pressed: #33373B;
  --glint: #54747D;
  /* The logo's other ribbon colour (evening glint). Logo only: never text. */
  --steel: #A9B6C2;
  --blush: rgba(84, 116, 125, 0.10);
  --blush-text: #47626B;
  --error: #A44A38;
  --display: Didot, "Bodoni MT", "Playfair Display", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --header-h: 72px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
::selection { background: rgba(84, 116, 125, 0.22); }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--glint); outline-offset: 3px; border-radius: 4px; }

/* Wide enough to use a desktop screen; the gutter grows with the viewport. */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 72px); }


.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ---------- Header ----------
   Sticky. Transparent over the silk hero, then frosted paper once the page
   scrolls (site.js adds .scrolled). A hero that follows the header is pulled
   up underneath it so the silk still runs to the top edge. */
.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: rgba(251, 250, 248, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom-color: var(--border);
}
.site-header + main > .silk:first-child { margin-top: calc(-1 * var(--header-h)); padding-top: var(--header-h); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: var(--header-h);
}

/* The horizontal lockup: mark + the wordmark set live in the display serif.
   The C stands a little taller than the wordmark's capitals, per the guide. */
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); flex: none; }
.brand-mark { height: 31px; width: auto; flex: none; overflow: visible; }
.wordmark {
  font-family: var(--display); font-size: 28px; letter-spacing: 0.3px; line-height: 1;
  text-decoration: none; color: var(--text);
}
/* Logo colours: morning room. Inside the C the ribbon is seaglass, outside steel. */
.mk-c { fill: var(--text); }
.mk-in { fill: var(--glint); }
.mk-out { fill: var(--steel); }

.site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-nav a:not(.btn) {
  position: relative; text-decoration: none; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; padding: 6px 0; transition: color 0.2s ease;
}
.site-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--glint); transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:not(.btn):hover { color: var(--text); }
.site-nav a:not(.btn):hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-nav .btn-ink { color: #fff; }
.site-header .header-cta { display: none; }

.menu-toggle {
  display: none; width: 42px; height: 42px; flex: none; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; align-items: center; justify-content: center; padding: 0;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 16px; height: 1.6px; border-radius: 2px; background: currentColor;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-open .menu-icon { background: transparent; }
.menu-open .menu-icon::before { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-md); padding: 12px 18px; font: 600 15px var(--sans);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease, opacity 0.2s ease;
}
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--ink-pressed); box-shadow: 0 10px 24px -14px rgba(23, 24, 26, 0.6); }
.btn-ink[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--text-faint); }
.btn:not([disabled]):active { transform: scale(0.97); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: var(--radius-sm); }
.btn svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease-out); }
.btn:not([disabled]):hover svg { transform: translateX(3px); }

/* ---------- Silk ---------- */
.silk {
  position: relative; overflow: hidden;
  background: var(--surface-muted) url("/assets/silk-morning.jpg") center / cover no-repeat;
}
.silk::after {
  /* Wash the artwork toward paper so body text keeps its contrast. */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(251,250,248,0.92) 0%, rgba(251,250,248,0.6) 60%, rgba(251,250,248,0.35) 100%);
  pointer-events: none;
}
.silk > * { position: relative; z-index: 1; }

/* The ribbon: the app's silk strand (AscentLine), drawn once on load. */
.ribbon { display: block; width: 190px; height: 28px; margin: 18px 0 26px; overflow: visible; }
.ribbon .strand { fill: var(--glint); }
.ribbon .echo { fill: var(--glint); opacity: 0.35; }
.ribbon-clip { animation: ribbon-draw 1.6s cubic-bezier(0.33, 1, 0.68, 1) both; }
@keyframes ribbon-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .ribbon-clip { animation: none; } }

/* ---------- Type ---------- */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 12px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blush); color: var(--blush-text);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blush-text); }
.display { font-family: var(--display); font-weight: 400; letter-spacing: 0.2px; margin: 0; }
h1.display { font-size: clamp(48px, 8vw, 92px); line-height: 1.02; }
h2.display { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; }
h3.display { font-size: 21px; line-height: 1.25; }
.lede { font-size: 18px; line-height: 1.6; color: var(--text-muted); max-width: 560px; margin: 0; }
.muted { color: var(--text-muted); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-muted { background: var(--surface-muted); }
.section-head { margin-bottom: 28px; }
.rule { border-top: 1px solid var(--border); }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
}
.card-muted { background: var(--surface-muted); border-color: transparent; }
.card p { margin: 8px 0 0; font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.card-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--blush); color: var(--blush-text);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.card-icon svg { width: 18px; height: 18px; }
.icon-plain { color: var(--text); margin-bottom: 14px; display: block; width: 20px; height: 20px; }

/* Level bars, the same four-step glyph as the app's LevelBars. */
.bars { display: inline-flex; align-items: flex-end; gap: 4px; height: 36px; margin-bottom: 12px; }
.bars span { width: 8px; border-radius: 2px; background: var(--border-strong); }
.bars span:nth-child(1) { height: 11px; }
.bars span:nth-child(2) { height: 19px; }
.bars span:nth-child(3) { height: 27px; }
.bars span:nth-child(4) { height: 36px; }
.bars span.on { background: var(--glint); }

/* ---------- Forms ---------- */
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.input {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-md); padding: 13px 15px; font: 16px var(--sans); color: var(--text);
}
.input::placeholder { color: var(--text-faint); }
.input { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input:hover { border-color: var(--text-faint); }
.input:focus { border-color: var(--glint); box-shadow: 0 0 0 4px rgba(84, 116, 125, 0.16); }

/* Cards answer the pointer quietly: a lift and a firmer edge, never a jump. */
.card { transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s ease; }
@media (hover: hover) {
  .card:not(.card-muted):hover {
    transform: translateY(-3px); border-color: var(--border-strong);
    box-shadow: 0 22px 40px -28px rgba(23, 24, 26, 0.35);
  }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--background); }
.site-footer .wrap {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; padding-top: 28px; padding-bottom: 28px;
}
.site-footer .brand-mark { height: 25px; }
.site-footer .wordmark { font-size: 22px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: 13px; color: var(--text-muted); }
.footer-links a { text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--glint); text-underline-offset: 3px; }

/* A large mark closing a page, drawn in when it scrolls into view. */
.mark-lg { display: block; height: 76px; width: auto; margin: 0 auto 26px; overflow: visible; }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 860px) {
  .cards, .cards-4 { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 64px 0; }
  :root { --header-h: 64px; }

  /* With script: the links fold into a panel under the header. Without it
     they simply wrap below the lockup. */
  .site-header .wrap { flex-wrap: wrap; }
  .js .site-header .wrap { flex-wrap: nowrap; }
  .js .site-header .header-cta { display: inline-flex; margin-left: auto; }
  .js .menu-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; top: calc(100% + 6px); left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -30px rgba(23, 24, 26, 0.4);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: top right;
    transition: opacity 0.2s ease, transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
  }
  .js .menu-open .site-nav {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.2s ease, transform 0.3s var(--ease-out), visibility 0s;
  }
  .js .site-nav a:not(.btn) { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 16px; }
  .js .site-nav a:not(.btn)::after { display: none; }
  .js .site-nav a:not(.btn):hover, .js .site-nav a[aria-current="page"] { background: var(--surface-muted); }
  .js .site-nav .btn { margin-top: 8px; padding: 13px 16px; font-size: 15px; }
  .js .menu-open.site-header { background: rgba(251, 250, 248, 0.94); border-bottom-color: var(--border); }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .wordmark { font-size: 24px; }
  .brand-mark { height: 27px; }
  .brand { gap: 9px; }
  .js .site-header .header-cta { display: none; }
  .menu-toggle { margin-left: auto; }
}

/* ---------- Motion ----------
   Everything below only runs when the visitor hasn't asked for reduced
   motion, and reveal-on-scroll only hides content once site.js is running
   (html.js), so nothing is ever stuck invisible without script. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

  /* Hero copy arrives in sequence. */
  .hero-stagger > * { animation: rise 0.8s var(--ease-out) both; }
  .hero-stagger > :nth-child(2) { animation-delay: 0.07s; }
  .hero-stagger > :nth-child(3) { animation-delay: 0.14s; }
  .hero-stagger > :nth-child(4) { animation-delay: 0.21s; }
  .hero-stagger > :nth-child(5) { animation-delay: 0.28s; }
  .hero-stagger > :nth-child(n+6) { animation-delay: 0.35s; }

  /* The logo's ribbon draws through the C, inside lobe then out past the
     opening: on the header mark once per visit (html.intro), and on large
     marks as they scroll in. The C itself never moves. */
  .intro .site-header .mk-in, .mark-draw .mk-in { animation: wipe 0.6s cubic-bezier(0.5, 0, 0.3, 1) 0.2s both; }
  .intro .site-header .mk-out, .mark-draw .mk-out { animation: wipe 0.75s var(--ease-out) 0.72s both; }
  .js .mark-lg:not(.mark-draw) .mk-in, .js .mark-lg:not(.mark-draw) .mk-out { clip-path: inset(0 100% 0 0); }

  .js [data-reveal] {
    opacity: 0; transform: translateY(22px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
