/* tjabell.com — "Marble and Discipline"
   Classical light theme, locked. Ink on marble, one terracotta accent.
   Display: Cormorant Garamond. Body: Albert Sans. One radius family: soft 2px
   (near-sharp, like cut stone) with the arch as the single curved exception. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../assets/fonts/cormorant-italic-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Albert Sans";
  src: url("../assets/fonts/albert-sans-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --marble: #f4f2ee;
  --marble-deep: #ebe8e2;
  --marble-shadow: #e0dcd4;
  --ink: #22242a;
  --ink-soft: #5d5f66;
  --terracotta: #a8502f;
  --terracotta-deep: #8e4227;
  --terracotta-wash: rgba(168, 80, 47, 0.08);
  --line: rgba(34, 36, 42, 0.14);
  --line-soft: rgba(34, 36, 42, 0.08);
  --radius: 2px;
  --display: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slow: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

body {
  background:
    radial-gradient(140% 90% at 50% -10%, #faf9f7 0%, var(--marble) 55%, var(--marble-deep) 100%)
    fixed,
    var(--marble);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 380;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--terracotta); color: var(--marble); }

.container {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 480;
  letter-spacing: 0.005em;
  line-height: 1.1;
  padding-bottom: 0.06em; /* italic descender reserve (Cormorant y/g/p) */
  text-wrap: balance;
}

h1 em, h2 em, .story-pull em {
  font-style: italic;
  font-weight: 480;
  color: var(--terracotta);
}

h2 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h3 { font-size: 1.6rem; line-height: 1.2; }

a { color: inherit; }

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

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.9rem 1.7rem;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
              background-color 0.3s var(--ease), transform 0.18s var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--marble);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-slow);
  z-index: -1;
}

.btn-primary { z-index: 0; }
.btn-primary:hover::after { transform: scaleX(1); }
.btn-primary:hover { color: var(--marble); }

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

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--marble) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.nav.is-scrolled { border-bottom-color: var(--line-soft); }

.nav-inner {
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease);
}

.nav-links a:hover { color: var(--terracotta-deep); }

.btn-nav { padding: 0.6rem 1.2rem; font-size: 0.78rem; }

/* ---------- Hero: inscription beside the goddess ---------- */

.hero {
  padding-top: clamp(3rem, 8vh, 5.5rem);
  padding-bottom: clamp(3.5rem, 9vh, 6rem);
  overflow: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 1.8rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 4.7vw, 3.9rem);
  font-weight: 420;
  margin-bottom: 1.6rem;
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 1.16rem;
  max-width: 34rem;
  margin-bottom: 2.4rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Niches: lit alcoves holding sculpture ---------- */

.niche {
  position: relative;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #55555a 0%, #3c3c40 55%, #2e2e33 100%);
  border: 1px solid rgba(34, 36, 42, 0.22);
  box-shadow:
    inset 0 14px 34px rgba(0, 0, 0, 0.42),
    inset 0 -10px 26px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 30px 60px -38px rgba(34, 36, 42, 0.55);
}

.niche img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.niche-hero {
  aspect-ratio: 4 / 5.3;
  transform:
    perspective(900px)
    rotateY(calc(var(--tilt-x, 0) * 4deg))
    rotateX(calc(var(--tilt-y, 0) * -3deg));
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.niche-hero img {
  transform:
    scale(1.08)
    translate(calc(var(--tilt-x, 0) * -8px), calc(var(--tilt-y, 0) * -6px));
  transition: transform 0.25s ease-out;
}

.niche-small { aspect-ratio: 4 / 5; max-width: 17rem; }

.niche-caption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.hero-art { position: relative; }

/* ---------- Epigraph ---------- */

/* ---------- Panels over the frieze + chapter numerals ---------- */

.panel {
  position: relative;
  background: color-mix(in srgb, var(--marble) 88%, transparent);
  border-block: 1px solid var(--line-soft);
  box-shadow: 0 30px 70px -50px rgba(34, 36, 42, 0.4);
}

.chapter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 1.8rem);
  margin-block: clamp(9rem, 22vh, 15rem) clamp(2.2rem, 5vh, 3.5rem);
}

.chapter i {
  width: clamp(2.6rem, 8vw, 6.5rem);
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
}

.chapter span {
  font-family: var(--display);
  font-weight: 470;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--terracotta-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.hero.panel { border-top: 0; }

.footer {
  background: color-mix(in srgb, var(--marble) 90%, transparent);
  border-top: 1px solid var(--line-soft);
  margin-top: clamp(7rem, 16vh, 11rem);
}

/* ---------- Epigraph (enshrined at the story's head) ---------- */

.epigraph-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: stretch;
  max-width: 62rem;
  margin-inline: auto;
}

.story .epigraph-grid { padding-top: clamp(3.5rem, 8vh, 5.5rem); }

.epigraph-grid blockquote {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
  align-self: center;
  padding-block: 1.5rem;
}

/* CSS-drawn Doric pillars: capital, fluted shaft, base */
.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 230px;
}

.pillar::before,
.pillar::after {
  content: "";
  width: 74px;
  height: 11px;
  background: linear-gradient(180deg, #eeeae2, #ddd8ce);
  border: 1px solid rgba(34, 36, 42, 0.16);
  border-radius: 1px;
}

.pillar::before {
  box-shadow: 0 5px 0 -2px #e4dfd5, 0 6px 0 -2px rgba(34, 36, 42, 0.14);
}

.pillar::after {
  box-shadow: 0 -5px 0 -2px #e4dfd5, 0 -6px 0 -2px rgba(34, 36, 42, 0.14);
}

.pillar i {
  flex: 1;
  width: 48px;
  background:
    linear-gradient(90deg, rgba(34, 36, 42, 0.14), transparent 22% 78%, rgba(34, 36, 42, 0.16)),
    repeating-linear-gradient(90deg,
      rgba(34, 36, 42, 0.1) 0 1.5px,
      transparent 1.5px 4.5px,
      rgba(255, 255, 255, 0.65) 4.5px 6px,
      transparent 6px 8px),
    linear-gradient(180deg, #ece8e0, #e2ddd3);
  border-inline: 1px solid rgba(34, 36, 42, 0.14);
}

.epigraph-grid blockquote p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 420;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.3;
  padding-bottom: 0.4rem;
}

.epigraph-grid cite {
  display: block;
  margin-top: 1.4rem;
  font-family: var(--body);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.epigraph-grid cite span { color: var(--terracotta); }

/* ---------- Stat row (the record, at the story's foot) ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-soft);
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.stat {
  padding: clamp(2rem, 4.5vw, 3.2rem) clamp(1rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.stat + .stat { border-left: 1px solid var(--line-soft); }

.stat-num {
  font-family: var(--display);
  font-weight: 440;
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  line-height: 1;
  color: var(--terracotta);
}

.stat-label {
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 24ch;
  margin-inline: auto;
}

/* ---------- Story ---------- */

.story { padding-block: clamp(5rem, 12vh, 8.5rem); }

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.story h2 { margin-bottom: 2rem; }

.story-copy p { color: var(--ink-soft); max-width: 58ch; }
.story-copy p + p { margin-top: 1.3rem; }

.has-dropcap::first-letter {
  font-family: var(--display);
  font-weight: 480;
  font-size: 4.4em;
  line-height: 0.78;
  float: left;
  padding-right: 0.12em;
  padding-top: 0.06em;
  color: var(--terracotta);
}

.story-pull {
  color: var(--ink) !important;
  font-family: var(--display);
  font-weight: 460;
  font-size: 1.7rem;
  line-height: 1.35;
  border-left: 2px solid var(--terracotta);
  padding-left: 1.5rem;
  padding-block: 0.2rem;
  margin-block: 2rem !important;
}

.story-media { position: sticky; top: 104px; }

/* Arch frame: the one curve on the page */
.arch-frame { position: relative; }

.arch-slot {
  aspect-ratio: 4 / 5.4;
  border-radius: 999px 999px var(--radius) var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, #fbfaf8 0%, var(--marble-deep) 78%, var(--marble-shadow) 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 24px 48px -32px rgba(34, 36, 42, 0.35);
}

.arch-slot img { width: 100%; height: 100%; object-fit: cover; }

.arch-mark {
  font-family: var(--display);
  font-weight: 420;
  font-size: clamp(2.6rem, 4.5vw, 3.6rem);
  letter-spacing: 0.14em;
  color: rgba(34, 36, 42, 0.14);
}

.arch-caption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- Disciplines ---------- */

.disciplines {
  padding-block: clamp(5rem, 12vh, 8.5rem);
}

.disciplines-head {
  max-width: 44rem;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.disciplines-head h2 { margin-bottom: 1.1rem; }
.disciplines-sub { color: var(--ink-soft); }

.ledger {
  list-style: none;
  counter-reset: none;
}

.ledger-row {
  display: grid;
  grid-template-columns: clamp(4.5rem, 9vw, 7rem) 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.8rem, 4vh, 2.6rem);
  transition: background-color 0.3s var(--ease);
}

.ledger-row + .ledger-row { border-top: 1px solid var(--line-soft); }

.ledger-row:hover { background: var(--terracotta-wash); }

.ledger-num {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1;
  color: var(--terracotta);
  text-align: right;
  padding-right: 0.4rem;
  transition: transform 0.35s var(--ease-slow);
}

.ledger-row:hover .ledger-num { transform: translateX(-4px); }

.ledger-body h3 { margin-bottom: 0.5rem; }

.ledger-body p {
  color: var(--ink-soft);
  max-width: 56ch;
  font-size: 1rem;
}

/* ---------- Giving back ---------- */

.giving { padding-block: clamp(5rem, 12vh, 8.5rem); }

.giving-head {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.6rem, 6vh, 4rem);
}

.giving-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  max-width: 62rem;
  margin-inline: auto;
}

.giving-col h3 {
  font-family: var(--body);
  color: var(--terracotta);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.giving-list { list-style: none; }

.giving-list li {
  padding-block: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.giving-list li + li { border-top: 1px solid var(--line-soft); }

.giving-org {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.25;
}

.giving-note { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Contact ---------- */

.contact {
  padding-block: clamp(5rem, 12vh, 8.5rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.contact-copy h2 { margin-bottom: 1.4rem; }
.contact-copy p { color: var(--ink-soft); max-width: 44ch; }
.contact-copy p + p { margin-top: 1.1rem; }

.contact-direct a {
  color: var(--terracotta-deep);
  text-decoration-color: rgba(168, 80, 47, 0.35);
  text-underline-offset: 3px;
}

.contact-art { margin-top: 2.6rem; }

.contact-form { display: flex; flex-direction: column; gap: 1.3rem; }

.field { display: flex; flex-direction: column; gap: 0.5rem; }

.field label {
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  padding: 0.9rem 1rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.field input:hover,
.field textarea:hover { border-color: rgba(34, 36, 42, 0.3); }

.field input:focus,
.field textarea:focus {
  border-color: var(--terracotta);
  background: rgba(255, 255, 255, 0.85);
  outline: none;
}

.field textarea { resize: vertical; min-height: 8.5rem; }

.field-error { color: var(--terracotta-deep); font-size: 0.85rem; }

.field.has-error input,
.field.has-error textarea { border-color: var(--terracotta); }

/* honeypot: visually gone, present for bots */
.field-hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.btn-submit { align-self: flex-start; padding-inline: 2.2rem; }
.btn-submit[disabled] { opacity: 0.6; cursor: wait; }

.form-status { font-size: 0.95rem; }
.form-status.ok { color: #4a6741; }
.form-status.err { color: var(--terracotta-deep); }

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

.footer { padding-block: 3rem; }

.footer-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-id { display: flex; flex-direction: column; }

.footer-name { font-family: var(--display); font-weight: 560; font-size: 1.2rem; }
.footer-loc { color: var(--ink-soft); font-size: 0.85rem; }

.footer-links { display: flex; gap: 1.5rem; margin-left: auto; }

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.footer-links a:hover { color: var(--terracotta-deep); }

.footer-fine { width: 100%; color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {

  .anim-1, .anim-2, .anim-3, .anim-4 {
    opacity: 0;
    transform: translateY(22px);
    animation: rise 1.1s var(--ease-slow) forwards;
  }
  .anim-1 { animation-delay: 0.1s; }
  .anim-2 { animation-delay: 0.25s; }
  .anim-3 { animation-delay: 0.45s; }
  .anim-4 { animation-delay: 0.62s; }

  @keyframes rise {
    to { opacity: 1; transform: none; }
  }

  /* the goddess recedes slightly as you scroll past her */
  @supports (animation-timeline: view()) {
    .hero-art {
      animation: recede linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }
    @keyframes recede {
      to { transform: translateY(-34px) scale(0.985); }
    }
  }

  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease-slow), transform 0.9s var(--ease-slow);
    transition-delay: calc(var(--i, 0) * 110ms);
  }

  .reveal.is-visible { opacity: 1; transform: none; }

  /* gentle parallax drift on the arch as it scrolls through the viewport */
  @supports (animation-timeline: view()) {
    .arch-frame {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    @keyframes drift {
      from { transform: translateY(28px); }
      to   { transform: translateY(-28px); }
    }
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid,
  .story-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .hero-art { max-width: 22rem; margin-inline: auto; }

  .story-media { position: static; max-width: 22rem; margin-inline: auto; }

  .epigraph-grid { grid-template-columns: 1fr; }
  .pillar { display: none; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }

  .hero h1 { font-size: clamp(2.6rem, 11vw, 3.4rem); }

  .stat-row { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line-soft); }

  .chapter { margin-block: 5.5rem 2rem; }

  .ledger-row { grid-template-columns: 3.2rem 1fr; gap: 1rem; }
  .ledger-num { font-size: 2rem; }

  .giving-grid { grid-template-columns: 1fr; }

  .footer-links { margin-left: 0; }
}
