:root {
  --bg: #0b0a0d;
  --bg-deep: #06050a;
  --fg: #ece5d3;
  --fg-soft: #c8c0ad;
  --fg-muted: #7a7567;
  --fg-faint: #4a463c;
  --ember: #ffb866;
  --ember-glow: rgba(255, 184, 102, 0.55);
  --hairline: rgba(236, 229, 211, 0.1);
  --hairline-strong: rgba(236, 229, 211, 0.18);

  --serif: "Fraunces", "Times New Roman", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "Menlo", monospace;
}

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

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 14,
    "wght" 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  position: relative;
  overflow-x: hidden;
}

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

/* ─────────────────────────────────────── ambient layers */

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 18% 12%, rgba(255, 184, 102, 0.05), transparent 65%),
    radial-gradient(ellipse 60% 50% at 88% 90%, rgba(120, 90, 200, 0.045), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  animation: drift 28s ease-in-out infinite alternate;
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-1.5%, 1%);
  }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ─────────────────────────────────────── layout */

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 5vw, 3.5rem);
}

/* ─────────────────────────────────────── content */

.content {
  align-self: center;
  padding: clamp(3rem, 8vh, 6rem) 0;
  max-width: 38rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings:
    "opsz" 144,
    "wght" 360;
  font-size: clamp(4.5rem, 13vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  color: var(--fg);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wordmark em {
  font-style: italic;
  font-variation-settings:
    "opsz" 144,
    "wght" 350,
    "SOFT" 100;
  display: inline-block;
  /* a hair of forward lean for personality */
  transform: translateX(-0.04em);
}

.wordmark-domain {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-left: 0.25rem;
}

.bio {
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 18,
    "wght" 380;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.55;
  color: var(--fg-soft);
  margin: 2.75rem 0 1.5rem;
  max-width: 34rem;
  text-wrap: pretty;
}

.bio em {
  font-style: italic;
  color: var(--fg);
  font-variation-settings:
    "opsz" 18,
    "wght" 380;
}

.links {
  font-family: var(--serif);
  font-variation-settings:
    "opsz" 14,
    "wght" 380;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-muted);
  margin-top: 2rem;
}

a {
  color: var(--fg);
  text-decoration: none;
  background-image: linear-gradient(var(--hairline-strong), var(--hairline-strong));
  background-position: 0 100%;
  background-size: 100% 1px;
  background-repeat: no-repeat;
  transition:
    color 240ms ease,
    background-image 240ms ease;
}

a:hover,
a:focus-visible {
  color: var(--ember);
  background-image: linear-gradient(var(--ember), var(--ember));
  outline: none;
}

/* ─────────────────────────────────────── status / footer */

.status {
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

.status-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-label {
  color: var(--fg-faint);
}

.status-rule {
  display: block;
  height: 1px;
  background: linear-gradient(to right, var(--hairline) 0%, var(--hairline-strong) 50%, transparent 100%);
}

.status-value {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--fg);
  white-space: nowrap;
}

.status-time {
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.status-time[data-state="loading"],
.status-time[data-state="error"] {
  color: var(--fg-faint);
}

.status-sep {
  color: var(--fg-faint);
}

.status-relative {
  color: var(--fg-muted);
  font-style: normal;
}

/* ─────────────────────────────────────── motion */

.fade-in {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(4px);
  animation: rise 1.4s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.7s;
}
.delay-4 {
  animation-delay: 0.95s;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .ambient {
    animation: none;
  }
  .fade-in {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ─────────────────────────────────────── responsive */

@media (max-width: 540px) {
  main {
    padding: 1.25rem 1.25rem 1.5rem;
  }
  .topbar {
    font-size: 0.65rem;
    padding-bottom: 1.25rem;
  }
  .wordmark {
    font-size: clamp(3.5rem, 18vw, 5rem);
  }
  .wordmark-domain {
    font-size: 0.7rem;
  }
  .bio {
    font-size: 1.05rem;
    margin-top: 2rem;
  }
  .status-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .status-rule {
    display: none;
  }
  .status-value {
    flex-wrap: wrap;
  }
}
