/* Sage Jarrow Young — design system
   Direction: cool limestone + ink + forest teal. Light-first. */

@import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #e6ebf1;
  --bg-elev: #f3f5f8;
  --ink: #12161c;
  --muted: #4d5868;
  --line: rgba(18, 22, 28, 0.12);
  --accent: #0f6b5c;
  --accent-hover: #0a5246;
  --accent-soft: rgba(15, 107, 92, 0.12);
  --shadow: 0 18px 40px rgba(18, 22, 28, 0.08);
  --radius: 4px;
  --container: 1120px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 36px;
  --space-6: 56px;
  --space-7: 88px;
  --space-8: 120px;
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
}

[data-theme="dark"] {
  --bg: #12161c;
  --bg-elev: #1a2029;
  --ink: #e8ecf1;
  --muted: #9aa5b5;
  --line: rgba(232, 236, 241, 0.14);
  --accent: #3dbaa0;
  --accent-hover: #5dceb8;
  --accent-soft: rgba(61, 186, 160, 0.14);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(15, 107, 92, 0.08), transparent 55%),
    radial-gradient(700px 480px at 92% 0%, rgba(18, 22, 28, 0.06), transparent 50%),
    linear-gradient(180deg, #dfe5ed 0%, var(--bg) 28%, var(--bg) 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(61, 186, 160, 0.08), transparent 55%),
    radial-gradient(700px 480px at 92% 0%, rgba(255, 255, 255, 0.03), transparent 50%),
    var(--bg);
}

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

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  background: var(--bg-elev);
  color: var(--ink);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #f3f5f8;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: clamp(18px, 2.2vw, 28px);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.82;
  transition: opacity 0.2s var(--ease);
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.nav-list a:hover {
  opacity: 1;
}

.nav-list a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle .nav-toggle-bar,
.nav-toggle .nav-toggle-bar::before,
.nav-toggle .nav-toggle-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  margin: 0 auto;
}

.nav-toggle .nav-toggle-bar::before,
.nav-toggle .nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle .nav-toggle-bar::before { top: -6px; }
.nav-toggle .nav-toggle-bar::after { top: 6px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
}

.theme-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background:
    linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* Hero — one composition, brand-first, full-bleed portrait */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: stretch;
  overflow: clip;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  min-height: inherit;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.4vh, 28px);
  padding:
    clamp(56px, 10vh, 120px)
    clamp(32px, 5vw, 64px)
    clamp(56px, 10vh, 120px)
    clamp(24px, 4vw, 32px);
  width: 100%;
  max-width: 640px;
  margin-left: max(24px, calc((100vw - var(--container)) / 2));
  margin-right: auto;
  box-sizing: border-box;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.2vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
  max-width: 11ch;
}

.hero h1 {
  font-family: var(--font-body);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin: 0;
  max-width: 28ch;
  color: var(--ink);
}

.lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.7;
  font-weight: 400;
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(8px, 1.5vh, 16px);
}

.hero-media {
  position: relative;
  min-height: 100%;
  margin: 0;
  background: #0a0c10;
  overflow: hidden;
}

.hero-media picture {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in oklab, var(--bg) 55%, transparent) 10%, transparent 28%);
  pointer-events: none;
}

[data-theme="dark"] .hero-media::after {
  background: linear-gradient(90deg, var(--bg) 0%, transparent 18%);
}

/* Reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

.hero-media.reveal {
  transform: translateX(24px);
}

.hero-media.reveal.is-visible {
  transform: none;
}

/* Sections */
.section {
  padding: clamp(64px, 10vh, 112px) 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(36px, 5vh, 56px);
}

.section-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 var(--space-3);
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

/* About — no cards */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-6);
  align-items: start;
}

.about-copy p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: 17px;
  max-width: 52ch;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.principles {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.principles li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.principles .num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.about-quote {
  margin: 0;
  padding: var(--space-5) 0 0 var(--space-4);
  border-left: 2px solid var(--accent);
}

.about-quote p {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--ink);
}

.about-quote footer {
  color: var(--muted);
  font-size: 14px;
}

/* Focus — rows, not cards */
.focus-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.focus-item {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
  transition: padding-left 0.3s var(--ease);
}

.focus-item:hover {
  padding-left: 8px;
}

.focus-item h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.focus-item p {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
}

/* Projects — link containers (interaction) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.project {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
  min-height: 100%;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: color-mix(in oklab, var(--bg-elev) 88%, var(--accent-soft));
}

.project .eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.project h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.project p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.project-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-top: var(--space-2);
}

.project:hover .project-cta {
  color: var(--accent-hover);
}

/* Writing */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.post-list li {
  border-bottom: 1px solid var(--line);
}

.post-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px 4px;
  text-decoration: none;
  color: var(--ink);
  transition: padding-left 0.25s var(--ease);
}

.post-link:hover {
  padding-left: 10px;
}

.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  transition: color 0.2s var(--ease);
}

.post-link:hover .post-title {
  color: var(--accent);
}

.post-link time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  white-space: nowrap;
}

.section-cta {
  margin-top: var(--space-5);
}

/* Contact */
.cta {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 var(--space-3);
}

.cta > p {
  margin: 0 0 var(--space-5);
  color: var(--muted);
  font-size: 18px;
  max-width: 40ch;
}

.cta-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.socials {
  display: flex;
  gap: var(--space-2);
}

.socials a {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer */
.site-footer {
  padding: var(--space-5) 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: var(--space-3);
  font-size: 14px;
}

.site-footer nav a:hover {
  color: var(--ink);
}

/* Article pages */
.article {
  padding: var(--space-7) 0;
}

.article-header {
  margin-bottom: var(--space-5);
  max-width: 760px;
}

.article-header .eyebrow {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.article h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.article-meta {
  margin-top: var(--space-3);
  color: var(--muted);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 14px;
}

.prose {
  max-width: 720px;
  color: var(--ink);
}

.prose p {
  margin: 0 0 var(--space-3);
  color: var(--ink);
  font-size: 17px;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: var(--space-5) 0 var(--space-2);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol {
  margin: 0 0 var(--space-3);
  padding-left: 22px;
}

.prose blockquote {
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.button.primary {
  color: #f3f5f8;
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 960px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .focus-item {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }
}

@media (max-width: 800px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 52svh;
    order: -1;
  }

  .hero-media::after {
    background: linear-gradient(180deg, transparent 48%, var(--bg) 100%);
  }

  .hero-content {
    margin-left: 0;
    max-width: none;
    gap: 20px;
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .hero-brand {
    font-size: clamp(34px, 10vw, 48px);
  }

  .hero h1 {
    max-width: none;
  }

  .lead {
    max-width: none;
  }

  .header-inner {
    height: 64px;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .nav-list {
    position: absolute;
    right: var(--space-4);
    top: 64px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    flex-direction: column;
    gap: var(--space-2);
    align-items: stretch;
    display: none;
    min-width: 200px;
    box-shadow: var(--shadow);
  }

  .nav-list.open {
    display: flex;
  }

  .nav-list a::after {
    display: none;
  }

  .post-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer nav a {
    margin-left: 0;
    margin-right: var(--space-3);
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

.sr-only {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  -webkit-clip-path: inset(50%) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}
