:root {
  --bg: #f4f2ed;
  --ink: #1c1b18;
  --ink-soft: #57544c;
  --ink-faint: #8c887d;
  --line: rgba(28, 27, 24, 0.14);
  --accent: #b8503e;
  --accent-soft: rgba(184, 80, 62, 0.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Grain overlay — fixed, non-scrolling, pointer-safe */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* Entrance motion is handled by GSAP (see index.html).
   Elements stay visible by default so the page degrades gracefully. */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none !important;
  }
  .status-dot::after {
    animation: none !important;
  }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: "Fraunces", serif;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.topbar-meta {
  display: flex;
  gap: 0.6rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.divider {
  opacity: 0.45;
}

/* ---------- Hero ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.hero {
  padding: clamp(3.5rem, 9vw, 7.5rem) clamp(1.25rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
}

.kicker {
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.display {
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 5.6vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  max-width: 24ch;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  color: var(--accent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: start;
  }
  /* asymmetry: bio pushed right */
  .bio {
    grid-column: 2;
  }
  .status {
    grid-column: 1;
    margin-top: 0.35rem;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-soft);
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3e7d5a;
  flex-shrink: 0;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid #3e7d5a;
  opacity: 0;
  animation: breathe 2.6s ease-out infinite;
}

@keyframes breathe {
  0% { transform: scale(0.4); opacity: 0.8; }
  70%, 100% { transform: scale(1.3); opacity: 0; }
}

.bio {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 58ch;
}

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  user-select: none;
}

.marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: scroll 36s linear infinite;
  will-change: transform;
}

.marquee-track span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Link rows ---------- */
.links {
  display: flex;
  flex-direction: column;
}

.link-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "index label arrow"
    "index note arrow";
  column-gap: clamp(1rem, 3vw, 2.5rem);
  row-gap: 0.2rem;
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.1rem) clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: color 0.35s var(--ease-out);
}

.link-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out);
  z-index: 0;
}

.link-row:hover::before,
.link-row:focus-visible::before {
  transform: translateY(0);
}

.link-row > * {
  position: relative;
  z-index: 1;
}

.link-row:hover,
.link-row:focus-visible {
  color: var(--bg);
}

.link-row:active {
  transform: scale(0.995);
}

.link-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.index {
  grid-area: index;
  color: var(--accent);
  transition: color 0.35s var(--ease-out);
}

.link-row:hover .index,
.link-row:focus-visible .index {
  color: var(--bg);
  opacity: 0.6;
}

.link-label {
  grid-area: label;
  font-family: "Fraunces", serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.link-note {
  grid-area: note;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--ink-faint);
  transition: color 0.35s var(--ease-out);
}

.link-row:hover .link-note,
.link-row:focus-visible .link-note {
  color: var(--bg);
  opacity: 0.65;
}

.arrow {
  grid-area: arrow;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: transform 0.45s var(--ease-out), border-color 0.35s var(--ease-out), background 0.35s var(--ease-out);
}

.link-row:hover .arrow,
.link-row:focus-visible .arrow {
  transform: translate(3px, -3px);
  border-color: rgba(244, 242, 237, 0.35);
  background: rgba(244, 242, 237, 0.06);
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 4rem);
}

.contact-kicker {
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
}

.contact-link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.contact-email {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.5rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-all;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.5s var(--ease-out), color 0.35s var(--ease-out);
  padding-bottom: 0.12em;
}

.contact-link:hover .contact-email,
.contact-link:focus-visible .contact-email {
  color: var(--accent);
  background-size: 100% 2px;
}

.contact-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem clamp(1.25rem, 5vw, 4rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .arrow {
    width: 36px;
    height: 36px;
  }
  .link-row {
    grid-template-areas:
      "index label arrow"
      "note note note";
    row-gap: 0.5rem;
  }
}
