/* =========================================================================
   Variosophic — variosophic.com
   Warm-ivory editorial canvas · single terracotta accent · Fraunces + Inter.
   Dependency-free. No inline styles, no JS (strict CSP). Scroll-reveal is
   pure-CSS (animation-timeline) and degrades to fully-visible content.
   ========================================================================= */

/* ---- Self-hosted variable fonts (latin subset) ------------------------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 340 560;
  font-display: swap;
  src: url('/assets/fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --ink: #241C15;
  --ink-soft: #574C42;
  --ink-faint: #766A5C;
  --accent: #A8481A;
  --accent-hover: #8F3C15;
  --accent-soft: #F4E2D2;
  --border: #E8DECF;

  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --maxw: 1200px;
  --pad: clamp(16px, 5vw, 48px);
  --section-y: clamp(3.5rem, 9vh, 7rem);
  --warm-shadow: 0 1px 2px rgba(36, 28, 21, .04), 0 10px 30px rgba(168, 72, 26, .06);
  --warm-shadow-lg: 0 2px 4px rgba(36, 28, 21, .05), 0 18px 48px rgba(168, 72, 26, .10);
}

/* ---- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---- Layout primitives ------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

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

.eyebrow {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-faint);
}
.eyebrow--accent { color: var(--accent); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 420;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.15rem, 5.5vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -.022em;
}

h2 { font-size: clamp(1.75rem, 3.2vw, 2.75rem); }

h3 { font-size: 1.3rem; font-weight: 460; letter-spacing: -.005em; }

.lead {
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
  max-width: 60ch;
}

p { color: var(--ink-soft); max-width: 62ch; }
p + p { margin-top: 1.1em; }

.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head .eyebrow { margin-bottom: 1rem; }
.section-head h2 { margin-bottom: 1rem; }
.section-head p { color: var(--ink-soft); }

/* ---- Links & buttons --------------------------------------------------- */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .35em;
  white-space: nowrap;
}
.link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s cubic-bezier(.16, 1, .3, 1);
}
.link:hover::after { transform: scaleX(1); }
.link .arr { transition: transform .2s ease; }
.link:hover .arr { transform: translate(1px, -1px); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  padding: .85rem 1.4rem;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }

.arr { width: 1em; height: 1em; flex: none; }

/* ---- Brand marks ------------------------------------------------------- */
.mark { color: var(--ink); }
.mark .cell--accent { fill: var(--accent); }
.mark--sm { width: 26px; height: 26px; }
.mark--hero { width: min(340px, 78%); height: auto; }
.mark--lg { width: 84px; height: 84px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}
.brand__word {
  font-family: var(--serif);
  font-weight: 460;
  font-size: 1.32rem;
  letter-spacing: -.01em;
}
.brand__a { color: var(--ink); }
.brand__b { color: var(--ink-soft); }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 240, .80);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
/* Transparent over the hero, settling to glass on scroll (progressive). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-header {
      border-color: transparent;
      background: rgba(251, 247, 240, 0);
      animation: header-settle linear both;
      animation-timeline: scroll(root);
      animation-range: 0 130px;
    }
    @keyframes header-settle {
      to { background: rgba(251, 247, 240, .80); border-color: var(--border); }
    }
  }
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.nav__right { position: relative; display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
  position: relative;
  transition: color .15s ease;
}
.nav-links a:hover { color: var(--ink); }

/* Hamburger button — hidden on desktop (links show inline); shown <=768px. */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.nav-burger:hover,
.nav__right.nav-open .nav-burger { border-color: var(--accent); color: var(--accent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .5rem .95rem;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .18s ease, background-color .18s ease, transform .15s ease;
}
.pill:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.pill .arr { transition: transform .18s ease; }
.pill:hover .arr { transform: translate(1px, -1px); }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; overflow: clip; }
.hero::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: -10%;
  right: -5%;
  width: min(720px, 80vw);
  height: min(720px, 80vw);
  background: radial-gradient(circle at center, var(--accent-soft) 0%, rgba(244, 226, 210, 0) 66%);
  opacity: .5;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: glow-drift 26s ease-in-out infinite alternate; }
  @keyframes glow-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-3%, 3%) scale(1.06); }
  }
}
.hero .container { position: relative; z-index: 1; }
.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(1rem, 4vh, 3rem);
}
.hero__grid > * { min-width: 0; }
.hero__copy .eyebrow { margin-bottom: 1.25rem; }
.hero__copy h1 { margin-bottom: 1.5rem; }
.hero__copy .lead { margin-bottom: 2rem; }
.hero__art { display: flex; justify-content: center; }

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.5fr 1fr; }
}

/* ---- Idea (etymology) -------------------------------------------------- */
.idea__grid { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (min-width: 860px) {
  .idea__grid { grid-template-columns: 0.82fr 1.18fr; }
}
.etym {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: var(--warm-shadow);
}
.etym__vee { margin: 0 auto 1.75rem; width: 76px; height: 76px; }
.root + .root { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.root__word {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 460;
  color: var(--ink);
  display: inline-block;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 3px;
  line-height: 1.2;
}
.root__gloss { margin-top: .55rem; }

/* ---- Work cards -------------------------------------------------------- */
.cards {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  box-shadow: var(--warm-shadow);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #DCCBB4; box-shadow: var(--warm-shadow-lg); }
.card__meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.1rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot--live { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot--dev { background: var(--ink-faint); }
.dot--open { background: transparent; border: 1.5px solid var(--accent); }
.card h3 { margin-bottom: .75rem; }
.card p { color: var(--ink-soft); font-size: 1rem; }
.card__foot { margin-top: auto; padding-top: 1.4rem; }
.card--flag { position: relative; }
.card--flag .mark--sm { position: absolute; top: clamp(1.5rem,2.5vw,2rem); right: clamp(1.5rem,2.5vw,2rem); width: 28px; height: 28px; opacity: .9; }

/* ---- Principles -------------------------------------------------------- */
.principles__grid { display: grid; gap: 0; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .principles__grid { grid-template-columns: repeat(2, 1fr); column-gap: clamp(2rem, 5vw, 4.5rem); }
}
.principle {
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-top: 1px solid var(--border);
}
.principle__num {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--accent);
  display: block;
  margin-bottom: .85rem;
}
.principle h3 { margin-bottom: .6rem; }
.principle p { color: var(--ink-soft); max-width: 46ch; }

/* ---- Company ----------------------------------------------------------- */
.company__panel {
  background: #FFFDF9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(2rem, 5vw, 4rem);
  box-shadow: var(--warm-shadow);
  max-width: 920px;
}
.company__panel h2 { margin-bottom: 1.5rem; }
.company__panel .lead { color: var(--ink-soft); }
.company__tags {
  margin-top: 1.75rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- Contact ----------------------------------------------------------- */
.contact { text-align: center; }
.contact__inner { max-width: 640px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; }
.contact .mark--lg { margin-bottom: 2rem; }
.contact h2 { margin-bottom: 1.25rem; }
.contact p { margin-inline: auto; text-align: center; }
.contact .actions { justify-content: center; margin-top: 2rem; }
.contact__secondary { margin-top: 1.75rem; font-size: .95rem; color: var(--ink-soft); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 760px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr; align-items: center; }
}
.footer__brand .brand { margin-bottom: .85rem; }
.footer__tag { color: var(--ink-faint); font-size: .95rem; font-style: italic; font-family: var(--serif); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; justify-content: flex-start; }
@media (min-width: 760px) { .footer__nav { justify-content: flex-end; } }
.footer__nav a { color: var(--ink-soft); text-decoration: none; font-size: .95rem; font-weight: 500; }
.footer__nav a:hover { color: var(--ink); }
.footer__legal {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: .8125rem;
  color: var(--ink-faint);
}
.footer__legal a { color: var(--ink-faint); text-decoration: none; }
.footer__legal a:hover { color: var(--ink-soft); text-decoration: underline; }
.footer__legal-links { display: flex; gap: 1.25rem; }

/* ---- Scroll reveal (progressive, content visible by default) ----------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      opacity: 0;
      transform: translateY(14px);
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }
    @keyframes reveal-in { to { opacity: 1; transform: none; } }
  }
}

/* ---- Logo "resolve" on load (hero mark only) --------------------------- */
.mark .cell { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .mark--hero .cell {
    opacity: 0;
    animation: cell-in .55s cubic-bezier(.16, 1, .3, 1) both;
  }
  .mark--hero .cell:nth-child(1) { animation-delay: .10s; }
  .mark--hero .cell:nth-child(2) { animation-delay: .17s; }
  .mark--hero .cell:nth-child(3) { animation-delay: .24s; }
  .mark--hero .cell:nth-child(4) { animation-delay: .31s; }
  .mark--hero .cell:nth-child(5) { animation-delay: .42s; }
  .mark--hero .cell:nth-child(6) { animation-delay: .31s; }
  .mark--hero .cell:nth-child(7) { animation-delay: .24s; }
  .mark--hero .cell:nth-child(8) { animation-delay: .17s; }
  .mark--hero .cell:nth-child(9) { animation-delay: .10s; }
  @keyframes cell-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---- Mobile menu (pure-CSS <details> disclosure) ----------------------- */
@media (max-width: 768px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .5rem;
    box-shadow: var(--warm-shadow-lg);
  }
  .nav__right.nav-open .nav-links { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    width: 100%;
    padding: .7rem .85rem;
    border-radius: 9px;
    font-size: 1rem;
  }
  .nav-links a:hover { background: var(--accent-soft); }
}
@media (max-width: 420px) {
  .brand__word { font-size: 1.15rem; }
}

/* ---- 404 --------------------------------------------------------------- */
.notfound {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.notfound__inner { max-width: 540px; }
.notfound .mark--lg { margin: 0 auto 2rem; }
.notfound .eyebrow { margin-bottom: 1rem; }
.notfound h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 1.1rem; }
.notfound p { margin: 0 auto 2rem; }
.notfound .actions { justify-content: center; }

/* ---- Legal pages (privacy / terms) ------------------------------------- */
.legal { padding-block: clamp(2.5rem, 6vh, 4.5rem); }
.legal__inner { max-width: 720px; margin-inline: auto; }
.legal .back { margin-bottom: 2.5rem; display: inline-flex; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); margin-bottom: .75rem; }
.legal__meta { color: var(--ink-faint); font-size: .9rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: 1.4rem; margin-top: 2.5rem; margin-bottom: .85rem; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { margin: 1rem 0 0 1.1rem; }
.legal li + li { margin-top: .55rem; }
.legal a { color: var(--accent); }
