/* Kevin Le Tran — black and white, one typeface, one splash of color. */

/* Apple devices use SF Pro and never fetch this; everyone else gets Inter. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --black: #000;
  --light: #f5f5f7;
  --ink: #1d1d1f;
  --gray: #86868b;
  --gray-2: #6e6e73;

  /* The one color: dusk. */
  --dusk-1: #f56300;
  --dusk-2: #e0245e;
  --dusk-3: #9b30ff;
  --dusk: linear-gradient(90deg, var(--dusk-1) 0%, var(--dusk-2) 52%, var(--dusk-3) 100%);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

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

html {
  background: var(--black);
  color: var(--light);
  font-family: var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body { overflow-x: clip; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 6px; border-radius: 4px; }
::selection { background: rgba(134, 134, 139, .4); }

.backdrop { display: none; }

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 0 24px;
  text-align: center;
}

/* ——— Name ——— */

.hero { background: var(--black); }

.name {
  position: relative;
  font-size: clamp(44px, 12.4vw, 236px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.045em;
  white-space: nowrap;
  color: var(--light);
}

.word { display: inline-block; }

/* An empty inline-block sits on the baseline: its offsetTop is the baseline. */
.probe { display: inline-block; width: 0; height: 0; }

.hint { display: none; }

/* ——— Statement ——— */

.about { background: var(--light); color: var(--ink); }

.statement {
  position: relative;
  font-size: clamp(30px, 5.6vw, 88px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.statement .line { display: block; text-wrap: balance; }

.statement .dusk {
  padding: 0 .06em;
  background-image: var(--dusk);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

a.dusk { transition: filter .5s ease; }
a.dusk:hover { filter: brightness(1.12) saturate(1.15); }
a.dusk:focus-visible { outline-color: var(--dusk-2); }

/* ——— Hello ——— */

.hello { position: relative; background: var(--black); }

.hello h2 {
  font-size: clamp(44px, 9vw, 148px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.045em;
}

.email {
  display: inline-block;
  margin-top: 1.1em;
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -.012em;
  color: var(--gray);
  transition: color .5s ease;
}

.elsewhere {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 30px;
  font-size: 14px;
  letter-spacing: .005em;
  color: var(--gray); /* #86868b on black: 5.8:1, passes AA at 14px */
}

.elsewhere a { transition: color .5s ease; }
.email:hover, .elsewhere a:hover { color: var(--light); }

/* ——————————————————————————————————————————————
   Motion. Only when JS runs and motion is welcome;
   everything above is the complete, static page.
   —————————————————————————————————————————————— */

.js .backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--black);
}

.js main { position: relative; z-index: 1; }

/* The hero is see-through so the dive can hand off to the backdrop. The statement
   keeps its own white: it only ever enters after the T has filled the screen. */
.js .hero { background: transparent; }
.js .hero { height: 230vh; }
.js .about { height: 280vh; }

/* Night rises over the pinned statement like a curtain, with a hard edge. */
.js .hello { z-index: 1; margin-top: -100vh; margin-top: -100svh; }

.js .hero .stage, .js .about .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

/* The name settles into focus, word by word. */
.js .name .word {
  opacity: 0;
  filter: blur(18px);
  transform: translateY(.04em);
  transition:
    opacity 1.8s var(--ease-out),
    filter 1.8s var(--ease-out),
    transform 2.2s var(--ease-out);
}
.js .name .word:nth-child(2) { transition-delay: .12s; }
.js .name .word:nth-child(3) { transition-delay: .24s; }
.js.ready .name .word { opacity: 1; filter: none; transform: none; }

/* Once split into words, each word carries its slice of the gradient. */
.js .statement .dusk.split { background: none; padding: 0; }
.js .statement .dusk.split > span {
  display: inline-block;
  /* Paint room for overhangs and descenders (the g), without moving any glyph. */
  padding: .1em .06em .28em;
  margin: -.1em -.06em -.28em;
  background-image: var(--dusk);
  background-repeat: no-repeat;
  background-size: var(--bw, 100%) 100%;
  background-position: var(--bx, 0) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.js .hint {
  display: block;
  position: absolute;
  left: 50%;
  bottom: max(36px, env(safe-area-inset-bottom));
  width: 1px;
  height: 44px;
  margin-left: -.5px;
  overflow: hidden;
  background: rgba(245, 245, 247, .14);
  opacity: 0;
  transition: opacity .8s ease;
}
.js .hint::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, var(--light));
  animation: hint 2.8s cubic-bezier(.76, 0, .24, 1) infinite;
}
@keyframes hint {
  from { transform: translateY(-100%); }
  to   { transform: translateY(200%); }
}

.js .hello .stage { opacity: 0; }
