:root {
  --fg: #FEFEFE;
  --bg: #000000;
  /* Desktop: 16px + 20% of the viewport width, on the top and sides */
  --pad: calc(16px + 20vw);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  max-width: 100vw;
}

body {
  /* Keep the text anti-aliasing crisp */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#statement {
  box-sizing: border-box;
  padding: var(--pad) var(--pad) 16px;

  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px;

  font-family: "Times New Roman", Times, serif;
  font-size: 32px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: 0.96px;
  color: var(--fg);

  font-kerning: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

/* Each word/phrase token. white-space:pre keeps internal spacing intact
   (e.g. "is a photographer") while the 8px flex gap separates tokens. */
.tok {
  white-space: pre;
}

a.tok {
  /* Underline metrics, as a fraction of the font size (em == 100%). */
  --ul-thickness: 0.03em; /* 3% thickness */
  --ul-offset: 0.13em;    /* 13% offset below the baseline */

  position: relative;
  color: var(--fg);
  text-decoration: none;
}

/* The underline is drawn as a bar so it can animate. At rest it's full width
   (scaleX(1)); on hover it re-draws from the left. */
a.tok::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  /* Baseline sits ~0.27em above the line box bottom; drop by --ul-offset. */
  bottom: calc(0.27em - var(--ul-offset));
  height: var(--ul-thickness);
  background: currentColor;
  transform: scaleX(1);
  transform-origin: left center;
}

a.tok:hover::after {
  animation: underline-draw 0.35s ease;
}

@keyframes underline-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  a.tok:hover::after { animation: none; }
}

#scroll-spacer {
  width: 100%;
}

/* Mobile: 16px sides, with a tall top offset (top + 20% vw) */
@media screen and (max-width: 600px) {
  #statement {
    padding: calc(16px + 20vw + 24vh) 16px 16px;
  }
}

/* Honor reduced-motion: drop the fade-in entrance */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    -webkit-animation: none;
  }
}

.fade-in {
  animation: fadeIn ease 2s;
  -webkit-animation: fadeIn ease 2s;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@-webkit-keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
