/* ============================================================
   andnikolaou.com — dark editorial
   ============================================================ */

:root {
  --bg: #06101e;
  --bg-2: #0a1628;
  --fg: #eef0f4;
  --fg-dim: #a0a8b8;
  --fg-mute: #6b7589;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #5b8cff;
  --grain-opacity: 0.18;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad-x: clamp(24px, 6vw, 96px);
  --gap: clamp(80px, 18vh, 200px);
}

[data-density="compact"] {
  --gap: clamp(48px, 10vh, 120px);
  --pad-x: clamp(20px, 4vw, 64px);
}
[data-density="spacious"] {
  --gap: clamp(120px, 26vh, 300px);
  --pad-x: clamp(32px, 8vw, 140px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* subtle radial vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(91, 140, 255, 0.08), transparent 60%),
    radial-gradient(80% 60% at 0% 100%, rgba(91, 140, 255, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* grain noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1   0 0 0 0 1   0 0 0 0 1   0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 60;
  animation: grain 1.2s steps(2) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -1%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, 0); }
}

/* ============================================================
   Scroll progress
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 70;
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.6);
}

/* ============================================================
   Custom cursor
   ============================================================ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 80;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--fg);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s, width 0.2s, height 0.2s,
    margin 0.2s;
  mix-blend-mode: difference;
}
.cursor-dot.is-hover {
  background: var(--accent);
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}
.cursor-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease,
    border-color 0.25s ease, background 0.25s ease;
}
.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
}

/* ============================================================
   Top bar
   ============================================================ */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 22px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  mix-blend-mode: normal;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
  font-style: italic;
  color: var(--fg);
  line-height: 1;
}
.mark__slash {
  color: var(--accent);
  margin: 0 1px;
  transform: translateY(-1px);
}
.meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-dim);
}
.meta__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.meta__sep { color: var(--fg-mute); }
.meta__time { color: var(--fg); font-variant-numeric: tabular-nums; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 0 var(--pad-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  will-change: opacity, transform;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.hero__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 13vw, 220px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28em;
}
.hero__name .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: heroIn 0.9s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero__name .word:nth-child(2) { animation-delay: 0.18s; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero__tagline {
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 40px);
  line-height: 1.25;
  font-weight: 400;
  color: var(--fg-dim);
  max-width: 28ch;
  margin: 0;
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.9s 0.36s cubic-bezier(.2,.8,.2,1) forwards;
}
.ital {
  font-style: italic;
  color: var(--accent);
  font-feature-settings: "ss01" on;
}
.hero__scrollhint {
  position: absolute;
  left: var(--pad-x);
  bottom: 40px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  opacity: 0;
  animation: heroIn 1.2s 0.9s ease forwards;
}
.hero__scrollhint .line {
  width: 56px;
  height: 1px;
  background: var(--fg-mute);
  position: relative;
  overflow: hidden;
}
.hero__scrollhint .line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: lineSweep 2.4s ease-in-out infinite;
}
@keyframes lineSweep {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ============================================================
   Bio
   ============================================================ */
.bio {
  position: relative;
  z-index: 1;
  padding: var(--gap) var(--pad-x);
  max-width: 1100px;
}
.bio__lead {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 52px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 0.6em 0;
  text-wrap: pretty;
}
.bio__lead em {
  font-style: italic;
  color: var(--accent);
}
.bio__follow {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.3;
  color: var(--fg-dim);
  margin: 0;
  max-width: 32ch;
}

/* ============================================================
   Reveal
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(.2,.8,.2,1),
              transform 0.9s cubic-bezier(.2,.8,.2,1);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
}
.marquee__track {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 3vw, 38px);
  color: var(--fg-dim);
  animation: marquee 40s linear infinite;
}
.marquee__item { display: inline-block; padding-right: 32px; }
.marquee__item .dot { color: var(--accent); margin: 0 6px; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   Chapters
   ============================================================ */
.chapters {
  position: relative;
  z-index: 1;
  padding: var(--gap) var(--pad-x);
}
.chapters__head, .links__head {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 48px;
}
.chapters__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.chapter {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  transition: border-color 0.4s ease;
}
.chapter:last-child { border-bottom: 1px solid var(--line); }
.chapter:hover { border-top-color: var(--line-strong); }
.chapter__year {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.chapter__title {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.2;
  color: var(--fg);
}
.chapter__meta {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
  letter-spacing: 0.01em;
}

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

/* ============================================================
   Links
   ============================================================ */
.links {
  position: relative;
  z-index: 1;
  padding: var(--gap) var(--pad-x);
}
.links__list {
  display: flex;
  flex-direction: column;
}
.link-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg);
  font-family: var(--serif);
  font-size: clamp(36px, 7vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.link-row:last-child { border-bottom: 1px solid var(--line); }
.link-row:hover { border-top-color: var(--accent); }
.link-row:hover + .link-row { border-top-color: var(--accent); }
.link-row__num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  align-self: start;
  padding-top: 14px;
}
.link-row__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 24px;
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), color 0.3s;
  will-change: transform;
}
.link-row:hover .link-row__label {
  color: var(--accent);
  font-style: italic;
}
.link-row__arrow {
  font-family: var(--serif);
  font-size: 0.4em;
  color: var(--fg-mute);
  transform: translate(0, -0.4em);
  transition: transform 0.3s ease, color 0.3s ease;
}
.link-row:hover .link-row__arrow {
  transform: translate(8px, -0.5em);
  color: var(--accent);
}
.link-row__meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  text-align: right;
  align-self: start;
  padding-top: 14px;
}

/* ============================================================
   Footer
   ============================================================ */
.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 28px var(--pad-x);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.foot__col--center { text-align: center; }
.foot__col--right { text-align: right; }
.dim { color: var(--fg-mute); }

@media (max-width: 640px) {
  .foot {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .foot__col--center, .foot__col--right { text-align: left; }
  .hero__scrollhint { display: none; }
}
