:root {
  --nav-h: 4.75rem;
  --obsidian: #08090d;
  --bar: #0e1116;
  --ink: #f4f1ea;
  --muted: #c9c7bf;
  --accent: #3ee08a;
  --line: rgba(62, 224, 138, 0.22);
}

html {
  scroll-padding-top: var(--nav-h);
  color-scheme: dark;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background: var(--obsidian);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.7;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--accent);
  color: #04140c;
  padding: 0.6rem 1rem;
  font-weight: 600;
}
.skip-link:focus {
  top: 0.75rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.topbar-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.topbar-links-left {
  display: none;
  align-items: center;
  gap: 1.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.topbar-links-left a,
.topbar-links-right > a {
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.topbar-links-left a:hover,
.topbar-links-left a.is-active,
.topbar-links-right > a:hover,
.topbar-links-right > a.is-active {
  color: var(--accent);
}
.topbar-links-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  justify-self: end;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.topbar-links-right > a { display: none; }
@media (min-width: 768px) {
  .topbar-links-left { display: flex; }
  .topbar-links-right > a { display: inline-flex; }
}
.topbar-logo {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  justify-self: start;
}
@media (min-width: 768px) {
  .topbar-links { display: flex; }
  .topbar-logo { justify-self: center; }
}
.topbar-menu {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.08em;
  cursor: pointer;
}
@media (min-width: 768px) {
  .topbar-menu { display: none; }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}
.hero-pin > .absolute { z-index: 2; }
#hero-video {
  z-index: 1;
}
@media (max-width: 767px) {
  #hero-video { display: none; }
}
.phase-text { will-change: opacity, transform; }
.hero-pin {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loop-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pin-below-bar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}
.kicker {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  font-family: inherit;
}
.btn-line:hover { border-color: var(--accent); }
.btn-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.btn-text:hover { color: var(--ink); }
.text-titanium { color: var(--muted) !important; }
pre.doc {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #ddd9d0;
  margin: 0;
}
.nav-link-active { color: var(--accent); }

footer.site-foot {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 3.5rem 2rem;
}
footer.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  font-size: 1rem;
}
footer.site-foot a {
  color: var(--muted);
  text-decoration: none;
}
footer.site-foot a:hover { color: var(--ink); }

.blog-dash {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}
@media (min-width: 768px) {
  .blog-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .blog-dash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #10131a;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: inherit;
  min-height: 100%;
  transition: border-color 0.2s ease;
}
.blog-card:hover { border-color: var(--line); }
.blog-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.blog-card .blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.35rem 1.4rem 1.5rem;
}
.blog-card h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.blog-card p.excerpt {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.blog-card .meta {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}
.blog-related {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 3rem;
}
@media (min-width: 768px) {
  .blog-related { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.feed-item {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 1.4rem 0;
}
.feed-item .meta {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.feed-item h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
.feed-item h2 a { color: var(--ink); text-decoration: none; }
.feed-item h2 a:hover { color: var(--accent); }
.feed-item .excerpt { color: var(--muted); margin: 0; }
.faq details {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 1.15rem 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details p {
  margin: 0.75rem 0 0.25rem;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 300;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .phase-text { transform: none !important; }
  .hero-pin video,
  video.loop-video { display: none; }
}

img, video {
  max-width: 100%;
}
img {
  height: auto;
}
table {
  max-width: 100%;
}
.overflow-x-auto,
pre.doc {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 767px) {
  :root { --nav-h: 4.25rem; }
  html, body { font-size: 16px; }
  .topbar-nav { padding: 0 max(0.85rem, env(safe-area-inset-right)) 0 max(0.85rem, env(safe-area-inset-left)); }
  .topbar-logo span.font-serif { font-size: 1.7rem; }
  .hero-pin h1,
  .hero-pin h2 {
    font-size: clamp(1.65rem, 7.2vw, 2.35rem) !important;
    line-height: 1.2 !important;
  }
  .phase-text {
    left: 1rem !important;
    right: 1rem !important;
    max-width: none !important;
  }
  #phase-0 { bottom: 4.5rem !important; top: auto !important; }
  #phase-1 { top: 26% !important; bottom: auto !important; }
  #phase-2 { bottom: 4.5rem !important; top: auto !important; }
  #hero-section { height: 220vh; }
  .pin-below-bar {
    position: relative;
    top: auto;
    height: min(70vh, 32rem);
  }
  footer.site-foot { padding: 2.25rem 1rem calc(2rem + env(safe-area-inset-bottom)); }
  .blog-card h2 { font-size: 1.3rem; }
  #menu-drawer aside {
    max-width: 100%;
    padding-top: max(2.5rem, env(safe-area-inset-top));
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }
  #menu-drawer .menu-link {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
  }
  h1, h2, h3 {
    overflow-wrap: break-word;
  }
  .font-mono,
  pre.doc {
    overflow-wrap: anywhere;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  html, body { font-size: 17px; }
}
