/* =========================================================
   Anthelic — an AI research lab
   Deep, atmospheric, cinematic. Halo (anthelion) motif.
   Single shared stylesheet for all pages.
   ========================================================= */

/* ---- Design tokens ---- */
:root {
  /* Surfaces — deep cosmic near-black */
  --bg:        #08080e;
  --bg-1:      #0c0c15;
  --bg-2:      #12121d;
  --bg-3:      #16161f;

  /* Ink — warm off-white for cinematic warmth */
  --ink:       #eceae2;
  --ink-soft:  #c6c4cd;
  --muted:     #8b8a97;
  --faint:     #5b5b68;

  /* Lines */
  --line:        rgba(236, 234, 226, 0.10);
  --line-strong: rgba(236, 234, 226, 0.20);

  /* Accent — the anthelion: a warm halo of light */
  --gold:      #e9b872;
  --gold-soft: #f2d29b;
  --gold-deep: #c8963e;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Rhythm */
  --maxw: 1080px;
  --readw: 680px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- Atmospheric backdrop: the halo ---- */
/* A luminous ring of light — an anthelion against the deep sky. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.sky::before {
  /* soft warm halo glow, high up */
  content: "";
  position: absolute;
  top: -28vmax;
  left: 50%;
  width: 78vmax;
  height: 78vmax;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at center,
      rgba(233, 184, 114, 0.00) 30%,
      rgba(233, 184, 114, 0.14) 43%,
      rgba(233, 184, 114, 0.05) 52%,
      rgba(233, 184, 114, 0.00) 62%);
  filter: blur(6px);
  animation: breathe 14s var(--ease) infinite;
}
.sky::after {
  /* deep cool counter-glow low on the page */
  content: "";
  position: absolute;
  bottom: -40vmax;
  left: 50%;
  width: 90vmax;
  height: 90vmax;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at center,
      rgba(90, 110, 180, 0.10) 0%,
      rgba(40, 50, 90, 0.05) 40%,
      rgba(8, 8, 14, 0) 70%);
}
/* faint star/grain field */
.sky .grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255,255,255,0.7) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
}

@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateX(-50%) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .sky::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Layout ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
}
section { position: relative; }

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(8,8,14,0.85), rgba(8,8,14,0.55));
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand .mark { width: 22px; height: 22px; flex: none; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--gold);
}

/* ---- Shared type helpers ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
  color: var(--ink);
}
.lead {
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.65;
}

/* ---- Hero ---- */
.hero { padding: 108px 0 84px; }
.hero .eyebrow { margin-bottom: 26px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
  font-size: clamp(2.8rem, 6.4vw, 5.1rem);
  max-width: 15ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold-soft);
}
.hero .lead {
  margin-top: 30px;
  max-width: 52ch;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

/* ---- Subscribe ---- */
.subscribe {
  margin-top: 40px;
  display: flex;
  gap: 10px;
  max-width: 460px;
  flex-wrap: wrap;
}
.subscribe input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.subscribe input::placeholder { color: var(--faint); }
.subscribe input:focus {
  outline: none;
  border-color: var(--gold-deep);
  background: var(--bg-3);
}
.subscribe .note {
  flex-basis: 100%;
  margin-top: 12px;
  font-size: 13px;
  color: var(--faint);
}
.subscribe .note.ok { color: var(--gold-soft); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary {
  background: var(--gold);
  color: #1a1206;
}
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-soft); transform: translateY(-1px); }

/* ---- Section header ---- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 26px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}
.section-head a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.section-head a:hover { color: var(--gold); }

/* ---- Writing list ---- */
.writing { padding: 40px 0 30px; }
.posts { display: flex; flex-direction: column; }
.post-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 26px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease), padding-inline 0.25s var(--ease);
}
.post-row:hover { background: rgba(236,234,226,0.02); }
.post-row .date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-top: 5px;
}
.post-row .body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  transition: color 0.2s var(--ease);
}
.post-row:hover .body h3 { color: var(--gold-soft); }
.post-row .body p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  max-width: 60ch;
}
.post-row .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* ---- Feature strip (values / focus areas) ---- */
.strip { padding: 78px 0; }
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cell {
  background: var(--bg-1);
  padding: 34px 30px;
}
.cell .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.cell h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  margin: 16px 0 10px;
}
.cell p { color: var(--muted); font-size: 15px; }

/* ---- Footer ---- */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 60px 0 70px;
}
.footer .cols {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer .brand { font-size: 19px; margin-bottom: 14px; }
.footer .tagline { color: var(--muted); font-size: 14px; max-width: 34ch; }
.footer .flinks { display: flex; gap: 46px; flex-wrap: wrap; }
.footer .flinks h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 14px;
  font-weight: 500;
}
.footer .flinks a {
  display: block;
  color: var(--ink-soft);
  font-size: 14px;
  padding: 5px 0;
  transition: color 0.2s var(--ease);
}
.footer .flinks a:hover { color: var(--gold); }
.footer .fine {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 12.5px;
  font-family: var(--font-mono);
}

/* =========================================================
   Article / prose (blog post pages)
   ========================================================= */
.article { padding: 72px 0 40px; }
.article .back {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 34px;
  transition: color 0.2s var(--ease);
}
.article .back:hover { color: var(--gold); }
.article-head { max-width: var(--readw); margin-bottom: 46px; }
.article-head .meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}
.article-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
}
.article-head .standfirst {
  margin-top: 22px;
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1.55;
  font-family: var(--font-display);
  font-style: italic;
}

.prose { max-width: var(--readw); }
.prose > * + * { margin-top: 24px; }
.prose p { color: var(--ink-soft); }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  margin-top: 52px;
  color: var(--ink);
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin-top: 38px;
  color: var(--ink);
}
.prose a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--gold-deep);
}
.prose a:hover { color: var(--gold-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  border-left: 2px solid var(--gold-deep);
  padding-left: 22px;
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
}
.prose ul, .prose ol { padding-left: 22px; color: var(--ink-soft); }
.prose li { margin-top: 8px; }
.prose li::marker { color: var(--gold-deep); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--gold-soft);
}
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 46px 0;
}
.article-foot {
  max-width: var(--readw);
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

/* ---- About page ---- */
.page-head { padding: 96px 0 24px; }
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 16ch;
}
.page-head .lead { margin-top: 26px; max-width: 54ch; }

/* ---- Responsive ---- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .nav-links { gap: 18px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 72px 0 56px; }
  .grid-3 { grid-template-columns: 1fr; }
  .post-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .post-row .date { padding-top: 0; }
  .post-row .tag { display: none; }
  .footer .cols { flex-direction: column; }
}
