:root {
  --bg: #000;
  --fg: #f2f2f2;
  --dim: rgba(242, 242, 242, 0.48);
  --line: rgba(242, 242, 242, 0.16);
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --pad: clamp(20px, 3vw, 44px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

html.inverted {
  --bg: #f2f2f2;
  --fg: #000;
  --dim: rgba(0, 0, 0, 0.5);
  --line: rgba(0, 0, 0, 0.18);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow: hidden;
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
  -webkit-font-smoothing: antialiased;
}

@media (pointer: fine) {
  html, body, a, button { cursor: none; }
}

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

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }

/* ---------- backdrop ---------- */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, var(--bg) 22%, transparent 66%),
    linear-gradient(180deg, var(--bg) 0%, transparent 16%, transparent 80%, var(--bg) 100%);
  opacity: 0.92;
  transition: opacity 0.6s;
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(128,128,128,0.045) 3px, rgba(128,128,128,0.045) 4px);
  mix-blend-mode: overlay;
}

/* ---------- layout ---------- */
.top, .bottom {
  position: fixed;
  left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
}
.top { top: 0; }
.bottom { bottom: 0; color: var(--dim); }

/* the logo in the top left corner is the music toggle */
.mark { display: block; width: 34px; height: 34px; color: var(--fg); transition: transform 0.8s var(--ease), opacity 0.3s; }
.mark:hover { transform: rotate(180deg); }
.mark svg { display: block; }
/* playing: the logo slowly spins and its centre dot pulses */
.mark.on svg { animation: spin 9s linear infinite; }
.mark.on .mark-dot { animation: pulse 1.2s ease-in-out infinite; }
.mark.missing { opacity: 0.4; }
@keyframes spin { to { transform: rotate(360deg); } }

.top-meta { display: flex; align-items: center; gap: 10px; color: var(--dim); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.15; } }

.stage {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
}

.hero {
  width: min(560px, 100%);
  margin-left: clamp(0px, 12vw, 300px);
}

.eyebrow { color: var(--dim); margin-bottom: 22px; }

.name {
  font-weight: 500;
  font-size: clamp(54px, 9.4vw, 148px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
  white-space: nowrap;
}

.role {
  margin-top: 30px;
  font-size: 13px;
  letter-spacing: 0.08em;
  line-height: 1.9;
  text-transform: none;
  min-height: 1.9em;
}
.role-line { display: block; }
.role-line::after {
  content: "";
  display: inline-block;
  width: 0.55em; height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: var(--fg);
  opacity: 0;
}
.role-line.typing::after { opacity: 1; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- socials ---------- */
.links {
  margin-top: 52px;
  border-top: 1px solid var(--line);
}

.link {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr auto 22px;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(14px);
  transition: color 0.35s var(--ease), padding 0.5s var(--ease);
}
.link.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), color 0.35s var(--ease), padding 0.5s var(--ease);
}

.link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease);
}
.link:hover, .link:focus-visible { color: var(--bg); padding-left: 14px; padding-right: 14px; outline: none; }
.link:hover::before, .link:focus-visible::before { transform: scaleY(1); }

.link-idx { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; opacity: 0.5; }
.link-name { font-size: 20px; font-weight: 400; letter-spacing: -0.01em; }
.link-handle { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; opacity: 0.55; text-align: right; }
.link:hover .link-handle { opacity: 1; }

.link-arrow { width: 16px; height: 16px; transition: transform 0.5s var(--ease); }
.link:hover .link-arrow { transform: translate(3px, -3px); }

/* ---------- bottom ---------- */
.clock { display: flex; gap: 14px; }
.bottom-mid { position: absolute; left: 50%; transform: translateX(-50%); opacity: 0.6; }

.toggle { display: flex; align-items: center; gap: 12px; color: var(--dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; transition: color 0.3s; }
.toggle:hover { color: var(--fg); }
.toggle-ring {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transition: transform 0.7s var(--ease);
}
html.inverted .toggle-ring { transform: rotate(180deg); }

/* ---------- cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
  will-change: transform;
}
.cursor-h, .cursor-v { position: absolute; background: currentColor; transition: transform 0.35s var(--ease); }
.cursor-h { width: 22px; height: 1px; left: -11px; top: 0; }
.cursor-v { width: 1px; height: 22px; left: 0; top: -11px; }
.cursor.hot .cursor-h { transform: scaleX(2.2); }
.cursor.hot .cursor-v { transform: scaleY(2.2); }
.cursor-xy {
  position: absolute;
  left: 18px; top: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0.8;
}
/* small "click!" that follows the mouse until the first click (fragg.org only) */
.cursor-hint {
  position: absolute;
  left: 18px; top: -30px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.cursor.hint-on .cursor-hint { opacity: 0.6; animation: hintPulse 2.6s ease-in-out infinite; }
@keyframes hintPulse { 50% { opacity: 0.28; } }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: #000; color: #f2f2f2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: clip-path 1.1s var(--ease), opacity 0.4s 0.9s;
  clip-path: inset(0 0 0 0);
}
.boot.done { clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none; }
.boot-count { font-family: var(--mono); font-size: 13px; letter-spacing: 0.3em; }
.boot-bar { width: 160px; height: 1px; background: rgba(242,242,242,0.2); position: relative; overflow: hidden; }
.boot-bar i { position: absolute; inset: 0; background: #f2f2f2; transform: scaleX(0); transform-origin: left; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  html, body { overflow-y: auto; }
  .stage { align-items: flex-start; padding-top: 18vh; padding-bottom: 110px; min-height: 100%; }
  .hero { margin-left: 0; }
  .vignette { background: linear-gradient(180deg, transparent 0%, var(--bg) 78%); opacity: 0.7; }
  .bottom-mid { display: none; }
  .link { grid-template-columns: 28px 1fr 22px; }
  .link-handle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .role-line::after, .mark.on svg, .mark.on .mark-dot, .cursor.hint-on .cursor-hint { animation: none; }
  .link { opacity: 1; transform: none; }
}
