/* Malia Myatt — site styles
   A dark graphite "portal" that opens toward daylight, mirroring the path home:
   graphite and bronze sections for the inside and the passage, a pale sky for "beyond",
   and warm off-white editorial sections. Colors are tokens; dark mode swaps the light-section tokens. */

:root {
  color-scheme: light dark;

  /* dark sections */
  --graphite-0: #0f1214;
  --graphite: #16191b;
  --graphite-2: #1d2124;
  --dusk: #262420;
  --dusk-2: #322e27;
  --cream: #f4f1e8;
  --on-dark-muted: #a6ada3;
  --bronze: #a8916b;
  --champagne: #d8c8a6;
  --dark-line: #2f3336;

  /* light sections */
  --paper: #f3f1ec;
  --surface: #faf9f5;
  --ink: #232624;
  --muted: #5a6158;
  --rule: #d7d2c6;
  --field-line: #8b8f86;

  /* the "beyond" sky (fixed in both modes) */
  --sky-top: #c9d5db;
  --sky-mid: #e6e4da;
  --sky-low: #f3f1ec;

  --font: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --measure: 58ch;
  --pad: clamp(20px, 5vw, 64px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1d1f;
    --surface: #202427;
    --ink: #f1eee5;
    --muted: #b0b5ad;
    --rule: #33383b;
    --field-line: #6f756f;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

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

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  background: var(--cream);
  color: var(--graphite);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Type */

h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(3rem, 9vw, 7rem);
}

h2 {
  font-size: clamp(2.3rem, 6vw, 4.6rem);
}

h3 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

/* Two-tone headlines: the second line is quieter */
.tone {
  display: block;
  color: var(--tone-2, var(--muted));
}

p {
  margin: 0 0 1em;
}

.label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.label .num {
  opacity: 0.75;
}

.label .num + span {
  padding-left: 12px;
  border-left: 1px solid currentColor;
}

.caption {
  font-size: 1rem;
  max-width: var(--measure);
}

/* Header (sits over the dark hero) */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  color: var(--cream);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-block: 22px;
}

.wordmark {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
}

.site-nav ul {
  display: flex;
  gap: 4px 24px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: currentColor;
}

@media (max-width: 560px) {
  .site-nav {
    flex-basis: 100%;
  }
}

/* Dark sections */

.on-dark {
  background: var(--graphite);
  color: var(--cream);
  --tone-2: var(--on-dark-muted);
}

.on-dark .caption,
.on-dark p {
  color: var(--on-dark-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 22px 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.btn-light {
  background: var(--cream);
  color: var(--graphite);
}

.btn-light:hover {
  background: var(--champagne);
}

.btn-dark {
  background: var(--ink);
  color: var(--paper);
}

.btn-dark:hover {
  background: var(--muted);
}

.link-line {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

/* The portal: one window with concentric bronze-lined frames (box-shadow rings) */

.portal-window {
  --w: 220px;
  position: relative;
  width: var(--w);
  aspect-ratio: 3 / 4;
  border-radius: calc(var(--w) * 0.12);
  background:
    radial-gradient(120% 70% at 50% 110%, #fff7e6 0%, #f1dfba 32%, transparent 62%),
    linear-gradient(180deg, #c9d5db 0%, #e6dcc6 55%, #d8bf8f 100%);
  box-shadow:
    0 0 0 2px rgb(216 200 166 / 0.95),
    0 0 0 calc(var(--w) * 0.08) #1f1e1b,
    0 0 0 calc(var(--w) * 0.08 + 2px) rgb(168 145 107 / 0.8),
    0 0 0 calc(var(--w) * 0.18) #1d1d1b,
    0 0 0 calc(var(--w) * 0.18 + 2px) rgb(168 145 107 / 0.62),
    0 0 0 calc(var(--w) * 0.30) #1b1c1b,
    0 0 0 calc(var(--w) * 0.30 + 2px) rgb(168 145 107 / 0.48),
    0 0 0 calc(var(--w) * 0.45) #191b1b,
    0 0 0 calc(var(--w) * 0.45 + 2px) rgb(168 145 107 / 0.36),
    0 0 0 calc(var(--w) * 0.63) #181a1b,
    0 0 0 calc(var(--w) * 0.63 + 2px) rgb(168 145 107 / 0.26),
    0 0 0 calc(var(--w) * 0.85) #17191b,
    0 0 0 calc(var(--w) * 0.85 + 2px) rgb(168 145 107 / 0.18),
    0 0 0 calc(var(--w) * 1.12) var(--graphite),
    0 0 0 calc(var(--w) * 1.12 + 2px) rgb(168 145 107 / 0.1);
}

/* Hero */

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: radial-gradient(90% 80% at 70% 45%, #1f2326 0%, var(--graphite) 55%, var(--graphite-0) 100%);
  display: flex;
  flex-direction: column;
}

.hero-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding-top: 120px;
  padding-bottom: 40px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin-bottom: 26px;
}

.hero .lead {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 22px;
  color: var(--cream);
}

.hero .lead .tone {
  color: var(--on-dark-muted);
}

.hero .caption {
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.hero-visual {
  position: relative;
  height: min(70vh, 640px);
  display: grid;
  place-items: center;
}

.hero-visual .portal-window {
  --w: clamp(150px, 17vw, 240px);
}

.hero-bar {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--dark-line);
}

.hero-bar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-block: 18px;
  font-size: 0.78rem;
  color: var(--on-dark-muted);
}

.hero-bar .scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-bar .scroll-cue::after {
  content: "";
  width: 1px;
  height: 14px;
  background: currentColor;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 150px;
  }

  .hero-visual {
    order: -1;
    height: 260px;
    overflow: hidden;
  }

  .hero-visual .portal-window {
    --w: 120px;
  }
}

/* Gentle scroll-linked opening of the portal, where supported */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-visual .portal-window {
      animation: portal-open linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    @keyframes portal-open {
      to {
        transform: scale(1.35);
      }
    }
  }
}

/* The path: four chapters from inside to beyond */

.path-intro .wrap {
  padding-block: clamp(80px, 12vw, 150px) clamp(40px, 6vw, 70px);
}

.path-intro .caption {
  margin-top: 26px;
}

.chapters {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
}

.chapter .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding-block: clamp(72px, 10vw, 120px);
}

.chapter-visual {
  position: relative;
  height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chapter .caption {
  margin-top: 24px;
}

.ch-1 {
  background: var(--graphite);
}

.ch-1 .portal-window {
  --w: 110px;
}

.ch-2 {
  background: linear-gradient(180deg, var(--graphite) 0%, var(--dusk) 100%);
}

.ch-2 .portal-window {
  --w: 160px;
}

.ch-3 {
  background: linear-gradient(180deg, var(--dusk) 0%, var(--dusk-2) 100%);
}

.ch-3 .portal-window {
  --w: 220px;
}

/* Beyond: open sky with a bronze arch */
.ch-4 {
  background:
    radial-gradient(40% 30% at 20% 30%, rgb(255 255 255 / 0.7), transparent 70%),
    radial-gradient(35% 25% at 80% 20%, rgb(255 255 255 / 0.6), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 60%, var(--sky-low) 100%);
  color: #232624;
  --tone-2: #5a6158;
}

.ch-4 p {
  color: #4a5048;
}

.arch {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 2 / 1;
  border: 10px solid #e9e1d0;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-shadow: inset 0 0 0 2px #a8916b;
}

.arch::before,
.arch::after {
  content: "";
  position: absolute;
  border: 2px solid #a8916b;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.arch::before {
  inset: 18px 18px 0;
  opacity: 0.7;
}

.arch::after {
  inset: 38px 38px 0;
  opacity: 0.45;
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a8916b 30%, #a8916b 70%, transparent);
  opacity: 0.6;
}

@media (max-width: 860px) {
  .chapter .wrap {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chapter-visual {
    height: 240px;
  }

  .ch-1 .portal-window { --w: 70px; }
  .ch-2 .portal-window { --w: 95px; }
  .ch-3 .portal-window { --w: 120px; }
}

/* Chapter bar, stuck to the bottom of the screen while the path is in view */
.chapter-nav {
  position: sticky;
  bottom: 14px;
  z-index: 10;
  display: flex;
  justify-content: center;
  margin-top: -64px;
  height: 64px;
  align-items: center;
  pointer-events: none;
}

.chapter-nav ol {
  pointer-events: auto;
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgb(22 25 27 / 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgb(216 200 166 / 0.25);
}

.chapter-nav a {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
}

.chapter-nav a span {
  color: var(--on-dark-muted);
  font-size: 0.7rem;
}

.chapter-nav a:hover {
  background: rgb(244 241 232 / 0.12);
}

@media (max-width: 560px) {
  .chapter-nav a {
    padding: 8px 9px;
  }

  .chapter-nav a span {
    display: none;
  }
}

/* Editorial (light) sections */

.section > .wrap {
  padding-block: clamp(80px, 11vw, 140px);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--rule);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.on-dark .section-head {
  border-bottom-color: var(--dark-line);
  color: var(--on-dark-muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px 72px;
  align-items: start;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.glance {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.glance div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.glance dt {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.glance dd {
  margin: 0;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .glance div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.areas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 28px;
}

.area-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.area h3 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.area p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .areas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .areas {
    grid-template-columns: 1fr;
  }
}

/* Contact (dark) */

.contact .caption {
  margin-top: 26px;
}

.contact-links {
  margin-top: 30px;
}

.contact-form {
  display: grid;
  gap: 26px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 4px;
}

.field label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.field .opt {
  text-transform: none;
  letter-spacing: 0;
}

.field input,
.field textarea {
  font: inherit;
  font-size: 1.05rem;
  width: 100%;
  min-height: 46px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid #6f746f;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-bottom: 2px solid var(--champagne);
}

.form-note {
  font-size: 0.85rem;
  margin: 0;
}

.hidden-field {
  display: none;
}

/* Footer */

.site-footer {
  background: var(--graphite-0);
  color: var(--on-dark-muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-block: 32px;
}

.site-footer .wordmark {
  color: var(--cream);
}

.site-footer p {
  margin: 0;
}

/* Short pages (thanks, 404) */

body:has(.message-page) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--graphite);
}

.message-page {
  flex: 1;
  display: flex;
  align-items: center;
  background: radial-gradient(80% 80% at 75% 50%, #1f2326 0%, var(--graphite) 60%, var(--graphite-0) 100%);
  color: var(--cream);
  --tone-2: var(--on-dark-muted);
  overflow: hidden;
}

.message-page .wrap {
  padding-top: 120px;
  padding-bottom: 80px;
}

.message-page .wrap > * {
  max-width: 720px;
}

.message-page p {
  font-size: 1.1rem;
  color: var(--on-dark-muted);
  margin: 24px 0 32px;
}

/* Fade the outer portal rings into whatever background the section has */
.hero-visual,
.chapter-visual:has(.portal-window) {
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
