/* ============================================================================
   da1yn — one composition.
   White paper. Black ink. One red caret that never stops working.
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --ghost: #ddd9d4;   /* untyped words */
  --muted: #8a857f;
  --red: #e10600;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: var(--font-mono); }
::selection { background: var(--red); color: #fff; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

/* the red tick — the "1", everywhere the name is written */
.tick {
  display: inline-block;
  width: 0.28em;
  height: 0.8em;
  margin: 0 0.07em;
  border-radius: 1px;
  background: var(--red);
  transform: translateY(0.08em);
  animation: blink 1.3s steps(1) infinite;
}
.tick--s { width: 0.24em; }

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.12; }
}

/* ---------------------------------------------------------------------------
   Bar — invisible until the wordmark is gone, then quietly present
--------------------------------------------------------------------------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  font-size: 0.85rem;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
  pointer-events: none;
}
.bar.on { opacity: 1; transform: none; pointer-events: auto; }

.bar__link {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.25s ease;
}
.bar__link:hover { color: var(--red); }

/* ---------------------------------------------------------------------------
   Hero — the wordmark, alone, full stage
--------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.wm {
  font-variation-settings: "opsz" 144, "wght" 560, "SOFT" 0, "WONK" 0;
  font-weight: normal;
  font-size: clamp(5rem, 21vw, 15rem);
  line-height: 1;
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  user-select: none;
}

.wm__l {
  display: inline-block;
  transition: font-variation-settings 0.45s var(--ease), color 0.3s ease;
}
@media (hover: hover) {
  .wm__l:hover {
    font-variation-settings: "opsz" 144, "wght" 800, "SOFT" 100, "WONK" 1;
    color: var(--red);
  }
}

.wm__caret {
  display: inline-block;
  width: 0.14em;
  height: 0.68em;
  margin: 0 0.05em;
  border-radius: 0.02em;
  background: var(--red);
  transform: translateY(0.045em);
  animation: blink 1.3s steps(1) infinite 1.4s;
}

/* load: letters rise from the baseline, staggered */
.js .wm__l, .js .wm__caret {
  opacity: 0;
  transform: translateY(0.55em);
  animation: rise 0.9s var(--ease) forwards;
  animation-delay: calc(0.1s + var(--i) * 0.07s);
}
.js .wm__caret {
  animation-name: rise, blink;
  animation-duration: 0.9s, 1.3s;
  animation-timing-function: var(--ease), steps(1);
  animation-delay: calc(0.1s + var(--i) * 0.07s), 1.4s;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: forwards, none;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero__hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: hint-in 1s ease 2.2s forwards;
  transition: opacity 0.4s ease;
}
.hero__hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 2rem;
  margin: 0.6rem auto 0;
  background: var(--red);
  transform-origin: top;
  animation: drip 1.8s var(--ease) infinite 2.6s;
}
.hero__hint.off { opacity: 0 !important; }
@keyframes hint-in { to { opacity: 1; } }
@keyframes drip {
  0% { transform: scaleY(0); }
  45%, 60% { transform: scaleY(1); }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------------------------------------------------------------------------
   The scrub — the caret types the studio's story as you scroll
--------------------------------------------------------------------------- */
.scrub { height: 200vh; }

.scrub__pin {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 0 clamp(1.25rem, 6vw, 6rem);
}

.m {
  font-size: clamp(1.85rem, 5.4vw, 4.4rem);
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 100, "wght" 480;
  max-width: 22ch;
}

.m em {
  font-style: normal;
}

/* words: ghost until the caret reaches them */
.m .w {
  color: var(--ghost);
  transition: color 0.18s ease;
}
.m .w.on { color: var(--ink); }
.m em .w.on { color: var(--red); }

@media (hover: hover) {
  .m .w.on {
    display: inline-block;
    transition: color 0.18s ease, font-variation-settings 0.35s var(--ease);
  }
  .m .w.on:hover {
    font-variation-settings: "opsz" 100, "wght" 750, "SOFT" 100, "WONK" 1;
  }
}

/* the working caret, re-seated after the last typed word */
.m__caret {
  display: inline-block;
  width: 0.1em;
  height: 0.72em;
  margin-left: 0.08em;
  border-radius: 1px;
  background: var(--red);
  vertical-align: baseline;
  transform: translateY(0.08em);
  animation: blink 1.1s steps(1) infinite;
}

/* no-js: the page is simply readable, fully inked */
.no-js .m .w, html:not(.js) .m .w { color: var(--ink); }
html:not(.js) .m em { color: var(--red); }

/* ---------------------------------------------------------------------------
   The receipts — five words, each one a working demo of itself
--------------------------------------------------------------------------- */
.verbs {
  padding: 14svh clamp(1.25rem, 6vw, 6rem) 6svh;
}

.verbs__cue {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.verbs__hush {
  font-size: 0.72rem;
  color: var(--ghost);
  margin-top: 1.4rem;
  transition: color 0.4s ease;
}
.verbs:hover .verbs__hush { color: var(--muted); }

.verbs__list {
  list-style: none;
  padding: 0;
}

.verbs__list li {
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--d) * 0.09s);
}
.verbs.in li { opacity: 1; transform: none; }
html:not(.js) .verbs__list li { opacity: 1; transform: none; }

.v {
  display: inline-block;
  font-size: clamp(2.4rem, 8.5vw, 6.2rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "wght" 500;
  cursor: default;
  position: relative;
}
.v .l { display: inline-block; }

/* design — the word gets art-directed live, letter by letter */
.v--design .l { transition: font-variation-settings 0.4s var(--ease), color 0.4s ease; }

/* web — the word becomes a link in front of you */
.v--web { transition: color 0.3s ease; }
.v--web::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.06em;
  height: 0.05em;
  border-radius: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.v--web.demo { color: var(--red); }
.v--web.demo::after { transform: scaleX(1); }
.v__proto {
  font-size: 0.3em;
  color: var(--muted);
  vertical-align: 0.55em;
  opacity: 0;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  max-width: 0;
  transform: translateX(-0.4em);
  transition: opacity 0.4s ease, transform 0.45s var(--ease), max-width 0.45s var(--ease), margin-right 0.45s var(--ease);
}
.v--web.demo .v__proto { opacity: 1; transform: none; max-width: 5em; margin-right: 0.25em; }

/* mobile — the word puts itself in a phone */
.v--mobile {
  transition: transform 0.4s var(--ease), border-color 0.4s ease, padding 0.4s var(--ease);
  border: 0.045em solid transparent;
  border-radius: 0.55em;
  padding: 0 0.1em;
}
.v--mobile.demo {
  border-color: var(--ink);
  padding: 0.02em 0.3em;
  transform: rotate(-2.5deg);
}
.v--mobile::after {
  content: "";
  display: inline-block;
  width: 0.07em;
  height: 0.07em;
  border-radius: 50%;
  background: var(--red);
  margin-left: 0.18em;
  vertical-align: 0.32em;
  opacity: 0;
  transition: opacity 0.3s ease 0.15s;
}
.v--mobile.demo::after { opacity: 1; }

/* interactive — the letters dodge your cursor (js) */
.v--interactive .l { transition: transform 0.35s var(--ease), color 0.3s ease; }
.v--interactive.demo .l { color: var(--red); }

/* storefronts — hover rings it up */
.v__tag {
  position: absolute;
  top: -0.25em;
  right: -0.4em;
  font-size: 0.16em;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--red);
  padding: 0.5em 0.9em;
  border-radius: 999px;
  transform: rotate(6deg) scale(0);
  transform-origin: bottom left;
  transition: transform 0.35s var(--ease);
  white-space: nowrap;
}
.v--store.demo .v__tag { transform: rotate(6deg) scale(1); }

@media (max-width: 44em) {
  .v__tag { right: auto; left: 60%; }
}

/* ---------------------------------------------------------------------------
   Outro — one enormous handshake
--------------------------------------------------------------------------- */
.outro {
  min-height: 72svh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.6rem;
  padding: 0 clamp(1.25rem, 6vw, 6rem);
}

.outro__cue {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* the type-back box: an invisible input drives a giant mirrored line */
.type {
  position: relative;
  width: 100%;
  cursor: text;
  padding-bottom: 0.12em;
  border-bottom: 1px solid var(--ghost);
  transition: border-color 0.3s ease;
  font-size: clamp(2.6rem, 10vw, 8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "wght" 520;
}
.type.focus { border-color: var(--red); }

.type__mirror { white-space: pre-wrap; overflow-wrap: anywhere; }
.type__mirror .t { display: inline-block; animation: key-pop 0.22s var(--ease); }
.type__mirror.ghost { color: var(--ghost); }
@media (hover: hover) {
  .type__mirror .t { transition: font-variation-settings 0.35s var(--ease), color 0.3s ease; }
  .type__mirror .t:hover { font-variation-settings: "opsz" 144, "wght" 800, "SOFT" 100, "WONK" 1; color: var(--red); }
}
@keyframes key-pop {
  from { transform: translateY(0.18em); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* the brand caret, handed over */
.type__caret {
  display: inline-block;
  width: 0.09em;
  height: 0.72em;
  margin-left: 0.06em;
  border-radius: 2px;
  background: var(--red);
  vertical-align: baseline;
  transform: translateY(0.07em);
  animation: blink 1.1s steps(1) infinite;
}

/* the real input sits invisibly on top so every tap and key lands in it */
.type__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 18px; /* >=16px so iOS does not zoom on focus */
  cursor: text;
}

/* flash when the message goes out */
.type.sent .type__mirror { color: var(--red); transition: color 0.2s ease; }

.outro__small {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}
.outro__small:hover { color: var(--red); }

/* ---------------------------------------------------------------------------
   Foot
--------------------------------------------------------------------------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.4rem clamp(1.25rem, 4vw, 2.5rem) 2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Cursor companion — a small red caret that works the room (desktop, js)
--------------------------------------------------------------------------- */
.cc {
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  width: 4px;
  height: 18px;
  border-radius: 1px;
  background: var(--red);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.12s ease-out, height 0.25s var(--ease), width 0.25s var(--ease);
  animation: blink 1.3s steps(1) infinite;
  mix-blend-mode: multiply;
}
.cc.live { opacity: 1; }
.cc.big { width: 6px; height: 30px; }
@media (hover: none), (pointer: coarse) { .cc { display: none; } }

/* ---------------------------------------------------------------------------
   Reduced motion — everything lands, the carets may still breathe
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .wm__l, .js .wm__caret { opacity: 1; transform: translateY(0.045em); animation: none; }
  .js .wm__l { transform: none; }
  .wm__caret, .js .wm__caret { animation: blink 1.3s steps(1) infinite 0.4s !important; }
  .hero__hint { animation: none; opacity: 1; }
  .hero__hint::after { animation: none; transform: scaleY(1); }
  .scrub { height: auto; }
  .scrub__pin { position: static; }
  .m .w { color: var(--ink); }
  .m em .w { color: var(--red); }
  .cc { display: none; }
}
