/* ==========================================================================
   avorobev.com — design tokens
   ========================================================================== */

:root {
  --bg: #f4f1ea;
  --bg-2: #ebe7dd;
  --surface: #fbf9f5;
  --ink: #16171b;
  --ink-2: #3a3c43;
  --muted: #6d6f77;
  --line: rgba(22, 23, 27, 0.1);
  --line-strong: rgba(22, 23, 27, 0.2);
  --accent: #2b44e0;
  --accent-2: #0e9384;
  --accent-3: #e07a3c;
  --orb-a: #5b74ff;
  --orb-b: #3cc9b8;
  --orb-c: #ffb37a;
  --dot: rgba(22, 23, 27, 0.08);
  --header-bg: rgba(244, 241, 234, 0.78);
  --grain-opacity: 0.35;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f;
    --bg-2: #111217;
    --surface: #14151b;
    --ink: #edebe5;
    --ink-2: #c6c4be;
    --muted: #8a8c94;
    --line: rgba(237, 235, 229, 0.09);
    --line-strong: rgba(237, 235, 229, 0.18);
    --accent: #8c9bff;
    --accent-2: #4fd6c4;
    --accent-3: #ffa66b;
    --orb-a: #3a4fe0;
    --orb-b: #12998b;
    --orb-c: #c9652f;
    --dot: rgba(237, 235, 229, 0.06);
    --header-bg: rgba(11, 12, 15, 0.72);
    --grain-opacity: 0.18;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-2: #111217;
  --surface: #14151b;
  --ink: #edebe5;
  --ink-2: #c6c4be;
  --muted: #8a8c94;
  --line: rgba(237, 235, 229, 0.09);
  --line-strong: rgba(237, 235, 229, 0.18);
  --accent: #8c9bff;
  --accent-2: #4fd6c4;
  --accent-3: #ffa66b;
  --orb-a: #3a4fe0;
  --orb-b: #12998b;
  --orb-c: #c9652f;
  --dot: rgba(237, 235, 229, 0.06);
  --header-bg: rgba(11, 12, 15, 0.72);
  --grain-opacity: 0.18;
  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

/* graph-paper dots, fading out toward the bottom of the viewport */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

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

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

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

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 8px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, var(--orb-a) 0%, transparent 60%),
    radial-gradient(120% 120% at 100% 100%, var(--orb-c) 0%, transparent 60%),
    var(--orb-b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

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

.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--line);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.3s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.theme-toggle .sun {
  display: none;
}
.theme-toggle .moon {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .moon {
    display: none;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent-2);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}

.hero h1 em {
  font-style: italic;
  color: var(--muted);
}

.lede {
  margin: 28px 0 0;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--ink-2);
}

.bio {
  margin: 22px 0 0;
  max-width: 58ch;
  font-size: 16.5px;
  color: var(--ink-2);
}

.bio p {
  margin: 0 0 14px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease);
}

.btn:hover {
  border-color: var(--ink);
}

.btn:hover svg {
  transform: translate(2px, -2px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* pipeline motif */
.pipeline {
  margin-top: 44px;
  max-width: 560px;
}

.pipeline svg {
  width: 100%;
  height: 28px;
  overflow: visible;
}

.pipeline .track {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.pipeline .flow {
  stroke: url(#flowGradient);
  stroke-width: 1.5;
  stroke-dasharray: 3 7;
  animation: flow 1.6s linear infinite;
}

.pipeline .node {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 1;
}

.pipeline .node.done {
  fill: var(--ink);
}

@keyframes flow {
  to {
    stroke-dashoffset: -20;
  }
}

.pipeline-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
}

.pipeline-labels span:nth-child(2) {
  text-align: center;
  transform: translateX(-16%);
}
.pipeline-labels span:nth-child(3) {
  text-align: center;
  transform: translateX(16%);
}
.pipeline-labels span:last-child {
  text-align: right;
}

/* portrait */
.portrait {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 400px;
}

.orb {
  position: absolute;
  inset: -14% -12% -10%;
  z-index: -1;
  background:
    radial-gradient(38% 38% at 28% 30%, var(--orb-a), transparent 70%),
    radial-gradient(40% 40% at 74% 38%, var(--orb-b), transparent 70%),
    radial-gradient(46% 42% at 50% 78%, var(--orb-c), transparent 72%);
  filter: blur(42px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(25deg) scale(1.06);
  }
}

.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 15% 10%, var(--orb-a) 0%, transparent 60%),
    radial-gradient(80% 70% at 90% 95%, var(--orb-c) 0%, transparent 60%),
    linear-gradient(160deg, var(--orb-b), var(--orb-a));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 30px 60px -30px rgba(10, 12, 30, 0.45);
}

.frame .monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(120px, 16vw, 180px);
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.04em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.caption {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: clamp(56px, 8vw, 104px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.section-head h2 em {
  color: var(--muted);
}

.section-head p {
  margin: 12px 0 0;
  max-width: 48ch;
  color: var(--muted);
}

/* "Currently" — three shelves */
.shelves {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.shelf {
  position: relative;
  padding: 22px 22px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease);
}

.shelf:hover {
  border-color: var(--line-strong);
}

.shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.shelf-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.shelf-title .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.shelf[data-kind="listening"] .swatch {
  background: var(--accent);
}
.shelf[data-kind="watching"] .swatch {
  background: var(--accent-3);
}
.shelf[data-kind="reading"] .swatch {
  background: var(--accent-2);
}

.shelf ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  border-bottom: 0;
}

.item.has-thumb {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.item-thumb {
  position: relative;
  display: block;
  width: 60px;
  aspect-ratio: 2 / 3;
  margin-top: 4px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 18px -10px rgba(10, 12, 30, 0.45);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.shelf[data-kind="listening"] .item-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item:hover .item-thumb {
  transform: translateY(-2px) rotate(-1.5deg);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 14px 24px -12px rgba(10, 12, 30, 0.5);
}

.item-thumb.is-missing {
  background:
    radial-gradient(90% 70% at 15% 10%, var(--orb-a) 0%, transparent 60%),
    linear-gradient(160deg, var(--orb-b), var(--orb-c));
  opacity: 0.6;
}

.item-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.item-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s var(--ease);
}

.item-title a:hover {
  background-size: 100% 1px;
}

.item-by {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.item-note {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.progress-track {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left;
}

/* ==========================================================================
   Writing index
   ========================================================================== */

.page-head {
  padding: clamp(56px, 9vw, 112px) 0 clamp(32px, 5vw, 56px);
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 120px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.page-head h1 em {
  color: var(--muted);
}

.page-head p {
  margin: 22px 0 0;
  max-width: 52ch;
  font-size: 18px;
  color: var(--ink-2);
}

.posts {
  list-style: none;
  margin: 0 0 clamp(64px, 10vw, 128px);
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.post-row a {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.35s var(--ease);
}

.post-row h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.post-row p {
  margin: 8px 0 0;
  max-width: 62ch;
  color: var(--muted);
}

.post-row .arrow {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

.post-row a:hover .arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.post-row a:hover h2 {
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Article
   ========================================================================== */

.article {
  max-width: 700px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 10vw, 128px);
}

.back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
  transition: color 0.2s var(--ease);
}

.back:hover {
  color: var(--ink);
}

.article h1 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.article .standfirst {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 27px);
  line-height: 1.3;
  color: var(--ink-2);
}

.prose {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-2);
}

.prose h2 {
  margin: 2.2em 0 0.4em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
}

.prose p {
  margin: 0 0 1.2em;
}

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

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  margin: 1.8em 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.35;
  color: var(--ink);
}

.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--line);
  font-family: var(--mono);
  font-size: 0.85em;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

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

/* ==========================================================================
   Motion
   ========================================================================== */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .shelves {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .portrait {
    justify-self: start;
    max-width: 168px;
    order: -1;
  }
  .portrait .frame {
    aspect-ratio: 1;
    border-radius: 20px;
  }
  .portrait .monogram {
    font-size: 88px;
  }
  .portrait .caption {
    display: none;
  }
  .hero-grid {
    gap: 28px;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .brand-name {
    display: none;
  }
  .post-row a {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .post-row .arrow {
    display: none;
  }
  .pipeline-labels span {
    font-size: 10px;
  }
}
