/* Borg PhD maintenance page. Design tokens and layout. No inline styles anywhere (CSP style-src 'self'). */

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/bodoni-moda-latin-opsz-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/bodoni-moda-latin-opsz-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --ink: #0A0B0F;
  --ink-2: #11131A;
  --navy: #0E1A35;
  --gold: #E0BB63;
  --gold-deep: #C9A24A;
  --gold-light: #F2D58A;
  --ivory: #F3EEE3;
  --muted: #A9A395;
  --display: "Bodoni Moda", Georgia, serif;
  --text: "Inter", system-ui, sans-serif;
  --gutter: 16px;
  --mono: clamp(104px, 11vw, 160px);
  --word-size: clamp(3.25rem, min(10.5vw, 17vh), 11.5rem);
}
@media (min-width: 768px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 48px; }
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 45%, var(--ink-2) 0%, var(--ink) 60%) fixed, var(--ink);
  color: var(--ivory);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain: part of the background layer, behind all content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

main, .site-footer { position: relative; z-index: 1; }

img { display: block; max-width: none; }

p { margin: 0; }

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.label {
  font-family: var(--text);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 20px max(var(--gutter), env(safe-area-inset-left));
  pointer-events: none;
}
/* Header scrim: under the header text, above the art. Invisible on plain ink. */
.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(10, 11, 15, 0.92) 0%, rgba(10, 11, 15, 0.92) 55%, rgba(10, 11, 15, 0) 100%);
  pointer-events: none;
}
@media (min-width: 768px) {
  .site-header::before { height: 88px; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mono {
  width: 32px;
  height: 32px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ivory);
}
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

/* Shared type */
.phrase {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, min(6vw, 10vh), 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ivory);
}
.body {
  font-family: var(--text);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 38rem;
  color: var(--ivory);
}
.link {
  color: var(--gold);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.link:focus { outline: none; }
.link:focus-visible,
.again:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Static version (no JavaScript, or reduced motion) */
.static {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 112px var(--gutter) 64px;
}
.static-mono {
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
}
.static-words {
  margin-top: 24px;
  max-width: 60rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.35;
  color: var(--muted);
}
.struck {
  text-decoration-line: line-through;
  text-decoration-color: var(--gold-deep);
  text-decoration-thickness: 1.5px;
}
.static-final {
  margin-top: 16px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--word-size);
  line-height: 1;
  white-space: nowrap;
  color: var(--gold);
}

/* Film (added by film.js only when prefers-reduced-motion is no-preference) */
.stage { display: none; }
html.film .static { display: none; }
html.film .stage {
  display: block;
  position: relative;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
}
html.film:not(.film-ready) .stage { visibility: hidden; }
html.film .brand-mono { opacity: 0; }

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.world-wrap { overflow: hidden; }
.world,
.world-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.world {
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.world .w { opacity: 0; }
.world-top { fill: none; stroke: none; }
.world-top .t { opacity: 0; }
.fold-ring {
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.25;
  opacity: 0;
}

/* Art text: its own layer above the hush, opacity 1 at rest. */
.art-label {
  font-family: var(--text);
  font-weight: 400;
  font-size: 0.75rem;
  fill: var(--muted);
  stroke: none;
}
.art-label--caps { letter-spacing: 0.16em; }
.art-note {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.75rem;
  fill: var(--gold);
  stroke: none;
}
.stamp-text {
  font-family: var(--text);
  font-weight: 600;
  fill: var(--gold);
  stroke: none;
  text-transform: uppercase;
}
.stamp-ring-text { font-size: 13px; letter-spacing: 0.08em; }
.stamp-ring-text--small { font-size: 11px; }
.stamp-center { font-size: 22px; letter-spacing: 0.12em; }
.stamp-center--small { font-size: 12px; letter-spacing: 0.14em; }
.bbox-pad { fill: none; stroke: none; }

.sheen-band {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, rgba(242, 213, 138, 0) 30%, rgba(242, 213, 138, 0.18) 50%, rgba(242, 213, 138, 0) 70%);
  opacity: 0;
}

.history-scrim {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: linear-gradient(to right, rgba(10, 11, 15, 0.9) 0%, rgba(10, 11, 15, 0.9) 65%, rgba(10, 11, 15, 0) 100%);
  pointer-events: none;
}
@media (min-width: 1100px) {
  .history-scrim { display: block; }
}

/* ACCEPTED stamp: on screens 5:3 and wider the phrase is large next to the art, so the stamp is
   drawn at 0.8 around its own center to keep 24 px clear of every letter (measured 2026-09-27). */
@media (min-aspect-ratio: 5/3) {
  .stamp-fit--ring-accepted {
    transform: scale(0.8);
    transform-box: fill-box;
    transform-origin: 50% 50%;
  }
}

.label-back {
  fill: var(--ink);
  opacity: 0.9;
  stroke: none;
}

.hush {
  background: radial-gradient(ellipse 60% 35% at 50% 50%, rgba(10, 11, 15, 0.85), transparent);
  pointer-events: none;
}

/* The safe box: the small viewport height, so centered content stays visible behind mobile bars. */
.safe {
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter);
}

.sentence {
  position: relative;
  text-align: center;
  width: 100%;
}
.mono-slot {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 24px);
  width: var(--mono);
  height: var(--mono);
  margin-left: calc(var(--mono) / -2);
}
.mono-fly {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.mono-glow-wrap {
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
}
.mono-glow {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 187, 99, 0.18) 0%, rgba(224, 187, 99, 0) 62%);
}
.mono-img {
  position: relative;
  width: 100%;
  height: 100%;
}

.film-phrase .pword,
.film-phrase .pchar { display: inline-block; }

.words {
  display: grid;
}
.word {
  grid-area: 1 / 1;
  justify-self: center;
  position: relative;
  white-space: nowrap;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: calc(var(--word-size) * var(--word-scale, 1));
  line-height: 1;
  color: var(--gold);
}
/* Gold foil: one continuous sheet across the word (JS sets --ww, --cx, --sheen). */
.word .char {
  display: inline-block;
  padding: 0.12em 0.16em;
  margin: -0.12em -0.16em;
  background-image: linear-gradient(100deg, #C9A24A 0%, #E0BB63 35%, #F2D58A 50%, #E0BB63 65%, #C9A24A 100%);
  background-size: var(--ww, 100%) 100%;
  background-position: calc(var(--sheen, 0px) - var(--cx, 0px)) 0;
  background-repeat: repeat-x;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html.foil-off .word .char {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--gold);
}

.counter {
  font-family: var(--text);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.counter-inline {
  display: inline-block;
  margin-top: 20px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(10, 11, 15, 0.9); /* ink backing pill so the art never runs behind the counter */
}

.history,
.rail { display: none; }

.history {
  position: absolute;
  left: var(--gutter);
  top: 50%;
  width: 180px;
  transform: translateY(-50%);
}
.history-label { color: var(--gold); }
.history-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.history-list li {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--muted);
  opacity: 0;
}
.h-word {
  position: relative;
  display: inline-block;
}
.strike {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 56%;
  height: 1.5px;
  background: var(--gold-deep);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.rail {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  width: 12px;
  height: 40vh;
  transform: translateY(-50%);
}
.rail-line,
.rail-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
}
.rail-line { background: var(--gold-deep); }
.rail-fill {
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: 50% 0;
}
.tick {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 1px;
  margin-left: -3.5px;
  margin-top: -0.5px;
  background: var(--gold-deep);
}
.tick.is-current {
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--gold);
}

@media (min-width: 1100px) {
  .history,
  .rail { display: block; }
  .counter-inline { display: none; }
}

.cue {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
}
.cue-track {
  position: relative;
  width: 1px;
  height: 48px;
  overflow: hidden;
}
.cue-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 48px;
  background: var(--gold);
  transform: translateY(-100%);
  animation: cue-draw 2.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes cue-draw {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Ending */
.ending {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 112px var(--gutter) 64px;
  overflow: hidden; /* the monogram glow is wider than a phone screen */
  background: radial-gradient(ellipse 48% 42% at 50% 52%, rgba(14, 26, 53, 1) 0%, rgba(14, 26, 53, 0.6) 45%, rgba(14, 26, 53, 0) 100%);
}
.ending-mono {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 32px;
}
.ending-glow {
  position: absolute;
  top: -60%;
  left: -60%;
  width: 220%;
  height: 220%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 187, 99, 0.18) 0%, rgba(224, 187, 99, 0) 62%);
}
.ending-mono img {
  position: relative;
  width: 200px;
  height: 200px;
}
.eyebrow { color: var(--gold); }
.ending-title {
  margin: 16px 0 24px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ivory);
}
.ending .body:not(.contact) { text-wrap: pretty; }
.contact { margin-top: 16px; }
.again-wrap { margin-top: 40px; }
.again {
  font-family: var(--text);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-deep);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}
.again:hover,
.again:focus-visible { background: rgba(224, 187, 99, 0.08); }
.again:focus { outline: none; }
.again:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Footer */
.site-footer {
  padding: 32px var(--gutter) max(32px, env(safe-area-inset-bottom));
  text-align: center;
  font-family: var(--text);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

/* 404 */
.nf {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 112px var(--gutter) 64px;
}
.nf .body { margin-top: 0; }
.nf .nf-link { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  .cue-line { animation: none; transform: none; }
}
