/* ryansite.org — "Trailhead": a dawn ridge with one main trail (Ascend)
   and painted trail blazes marking every other path. Self-hosted, no JS. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2-variations"),
    url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens: night-to-dawn alpine (default) ------------------------------ */
:root {
  color-scheme: dark;
  --sky-top: #0c1a2e;
  --sky-mid: #1b3050;
  --horizon: #6b5a68;
  --sun: #ffd7a0;
  --glow: #f3b26b;
  --ridge-far: #2c4a72;
  --ridge-mid: #1b3253;
  --snow: #dfeaf3;
  --ground: #12233b;
  --text: #f1f4f7;
  --muted: #b3c2d3;
  --faint: #8396ad;
  --line: rgba(207, 227, 239, 0.13);
  --hover: rgba(207, 227, 239, 0.05);
  --cta-bg: #f3b26b;
  --cta-hover: #f7c487;
  --cta-text: #14213a;
  --focus: #ffd7a0;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --measure: 1080px;
  --gutter: clamp(18px, 5vw, 56px);
}

/* --- Tokens: morning (light) --------------------------------------------- */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --sky-top: #9fc1df;
    --sky-mid: #d7e3ee;
    --horizon: #f6d2ad;
    --sun: #fff1d6;
    --glow: #f7bd7d;
    --ridge-far: #87a3c2;
    --ridge-mid: #52739a;
    --snow: #ffffff;
    --ground: #f3f6f9;
    --text: #13233a;
    --muted: #44576f;
    --faint: #687b93;
    --line: rgba(19, 35, 58, 0.13);
    --hover: rgba(19, 35, 58, 0.04);
    --cta-bg: #13233a;
    --cta-hover: #22385a;
    --cta-text: #fbf3e6;
    --focus: #13233a;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

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

/* --- The sky: dawn gradient + ridge silhouette ---------------------------
   Everything is sized against the viewport height as well as the width so the
   whole page (hero + every path) fits above the fold on laptops and phones. */
.sky {
  --ridge-h: clamp(130px, min(30vw, 28vh), 400px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-mid) 55%, var(--horizon) 100%);
  padding-bottom: calc(var(--ridge-h) * 0.42);
}

.sky--short {
  --ridge-h: clamp(96px, min(16vw, 20vh), 280px);
  padding-bottom: calc(var(--ridge-h) * 0.62);
}

.ridge {
  position: absolute;
  inset: auto 0 -2px 0;
  width: 100%;
  height: calc(var(--ridge-h) + 2px);
  z-index: -1;
  display: block;
}

.ridge .far { fill: var(--ridge-far); }
.ridge .mid { fill: var(--ridge-mid); }
.ridge .near { fill: var(--ground); }
.ridge .snow { fill: var(--snow); opacity: 0.9; }
.ridge .disc { fill: var(--sun); }
.ridge .g0 { stop-color: var(--glow); stop-opacity: 0.75; }
.ridge .g1 { stop-color: var(--glow); stop-opacity: 0; }

.ridge .sun {
  animation: sunrise 2.4s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  transform-box: view-box;
}

@keyframes sunrise {
  from { transform: translateY(70px); opacity: 0.35; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- Masthead ------------------------------------------------------------ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(14px, 2.6vh, 26px);
  padding-bottom: clamp(4px, 1.2vh, 12px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 560;
  letter-spacing: 0.01em;
  color: var(--text);
}

.wordmark svg {
  width: 26px;
  height: 18px;
  flex: none;
}

.wordmark .mark-peak { fill: var(--glow); }

a.wordmark .chev {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  opacity: 0.7;
}

a.wordmark:hover {
  color: var(--glow);
}

/* --- Home hero: Ascend --------------------------------------------------- */
.hero-card {
  display: block;
  max-width: 720px;
  padding-top: clamp(4px, 3vh, 40px);
}

.hero-kicker {
  margin: 0 0 2px;
  font-size: clamp(16px, 2.4vh, 19px);
  font-weight: 450;
  color: var(--muted);
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(60px, min(13vw, 15vh), 168px);
  font-weight: 640;
  font-variation-settings: "opsz" 144;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--text);
}

.hero-card .lead {
  margin: clamp(8px, 1.6vh, 18px) 0 clamp(14px, 2.6vh, 26px);
  max-width: 44ch;
  text-wrap: balance;
  font-size: clamp(17px, min(2.2vw, 2.8vh), 22px);
  line-height: 1.4;
  font-weight: 380;
  color: var(--text);
}

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

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: clamp(10px, 1.6vh, 14px) 24px clamp(10px, 1.6vh, 14px) 26px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-size: 18px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.cta-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  transition: transform 0.2s ease;
}

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

.cta-btn:hover svg {
  transform: translateX(3px);
}

.domain-hint {
  font-size: 15px;
  color: var(--muted);
}

/* --- Sub-page title in the sky ------------------------------------------- */
.sub-header {
  max-width: 720px;
  padding-top: clamp(4px, 2.4vh, 32px);
}

.sub-header h1 {
  margin: 0 0 clamp(6px, 1.2vh, 14px);
  font-size: clamp(42px, min(9vw, 11vh), 104px);
  font-weight: 620;
  font-variation-settings: "opsz" 144;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.sub-header p {
  margin: 0;
  max-width: 48ch;
  text-wrap: balance;
  hyphens: manual;
  font-size: clamp(16px, min(2vw, 2.6vh), 21px);
  line-height: 1.45;
  font-weight: 380;
  color: var(--text);
}

/* --- Directory of paths -------------------------------------------------- */
.trails {
  padding-top: clamp(4px, 1.2vh, 14px);
  padding-bottom: clamp(36px, 6vh, 72px);
}

.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  column-gap: clamp(20px, 3vw, 40px);
}

.directory > li {
  border-top: 1px solid var(--line);
}

.path {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: clamp(10px, 1.8vh, 18px) 10px;
  margin: 0 -10px;
  border-radius: 12px;
  transition: background 0.18s ease;
}

.path:hover {
  background: var(--hover);
}

.blaze {
  width: 7px;
  height: 100%;
  min-height: 36px;
  max-height: 52px;
  border-radius: 3px;
  background: var(--blaze, var(--glow));
  box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.12);
}

.path h2 {
  margin: 0;
  font-size: clamp(20px, min(2vw, 3vh), 25px);
  font-weight: 560;
  font-variation-settings: "opsz" 72;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.path p {
  margin: 3px 0 0;
  text-wrap: pretty;
  font-size: clamp(14.5px, 2vh, 16px);
  line-height: 1.42;
  color: var(--muted);
}

.path .path-short {
  display: none;
}

.path .go {
  width: 16px;
  height: 16px;
  stroke: var(--faint);
  stroke-width: 2;
  fill: none;
  transition: transform 0.18s ease, stroke 0.18s ease;
}

.path:hover .go {
  transform: translateX(4px);
  stroke: var(--text);
}

.sub-note {
  margin: clamp(10px, 2vh, 22px) 0 0;
  font-size: 15.5px;
  color: var(--faint);
}

/* --- Footer: every path, one line ---------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 28px;
  font-size: 15px;
  color: var(--faint);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}

.site-foot a:hover,
.site-foot a[aria-current="page"] {
  color: var(--text);
}

/* --- Tablets: two columns ------------------------------------------------ */
@media (max-width: 900px) {
  .directory {
    grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr));
  }
}

/* --- Phones: short lines, compact tiles ---------------------------------- */
@media (max-width: 600px) {
  .sky {
    --ridge-h: clamp(110px, 20vh, 160px);
    padding-bottom: calc(var(--ridge-h) * 0.5);
  }
  .sky--short {
    --ridge-h: clamp(80px, 13vh, 110px);
    padding-bottom: calc(var(--ridge-h) * 0.66);
  }
  .hero-card h1 {
    font-size: clamp(54px, min(17vw, 10vh), 72px);
  }
  .domain-hint {
    display: none;
  }
  .directory {
    grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr));
    column-gap: 14px;
  }
  .directory[style*="--cols:3"]:has(> li:nth-child(3):last-child) {
    grid-template-columns: 1fr;
  }
  .path {
    grid-template-columns: 6px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 6px;
    margin: 0 -6px;
  }
  .path .go {
    display: none;
  }
  .blaze {
    width: 6px;
    min-height: 30px;
  }
  .path h2 {
    font-size: 18.5px;
  }
  .path .path-long {
    display: none;
  }
  .path .path-short {
    display: block;
    margin-top: 1px;
    font-size: 13.5px;
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
