/* Liam Allerton. Monochrome, pure greys, calm motion.
   The page is complete without motion: every animated state falls back to its finished look. */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --card: #141414;
  --line: #232323;
  --line-2: #2e2e2e;
  --text: #f2f2f2;
  --muted: #8f8f8f;
  --faint: #5c5c5c;
  --dot: 242, 242, 242;
  --display: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --hdr: 64px;
  --r: 12px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-2: #ececec;
  --card: #ffffff;
  --line: #e0e0e0;
  --line-2: #d2d2d2;
  --text: #0d0d0d;
  --muted: #666666;
  --faint: #9a9a9a;
  --dot: 13, 13, 13;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--hdr); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--text); color: var(--bg); }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.02; margin-bottom: 48px; }
h3 { font-size: 22px; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: .02em;
  color: var(--muted); margin-bottom: 18px;
}

section { position: relative; padding: 140px 0; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--hdr);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.bar.is-scrolled { border-bottom-color: var(--line); }
.bar__in { max-width: 1160px; margin: 0 auto; padding: 0 28px; height: 100%; display: flex; align-items: center; gap: 32px; }
.name { font-family: var(--display); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 500 12px var(--sans); color: var(--muted); }
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { font-size: 14px; color: var(--muted); padding: 6px 10px; border-radius: 8px; transition: color .2s ease, background-color .2s ease; }
.links a:hover { color: var(--text); background: var(--bg-2); }
.bar__end { display: flex; align-items: center; gap: 8px; }

/* Small, sleek, rounded rectangles. */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 9px;
  font: 500 14px var(--sans); color: var(--text); background: transparent; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { border-color: var(--text); transform: scale(1.03); }
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--solid:hover { background: transparent; color: var(--text); }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid transparent; background: none; color: var(--text); cursor: pointer;
  transition: border-color .2s ease, transform .2s var(--ease-out);
}
.icon-btn:hover { border-color: var(--line-2); transform: scale(1.06); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-btn .fill { fill: currentColor; stroke: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; padding: calc(var(--hdr) + 80px) 0 120px;
  display: flex; align-items: center; overflow: clip;
}
.hero__dots { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__in { position: relative; width: 100%; }
.hero__name {
  font-size: clamp(72px, 15.5vw, 220px); line-height: .86; letter-spacing: -.045em; font-weight: 700;
  margin: 8px 0 40px;
}
.hero__name .line { display: block; white-space: nowrap; }
.hero__punch { font-family: var(--display); font-size: clamp(24px, 3vw, 34px); font-weight: 600; letter-spacing: -.02em; margin-bottom: 18px; }
.hero__lede { max-width: 50ch; color: var(--muted); font-size: 18px; }
.hero__cta { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 36px; width: 22px; height: 34px; margin-left: -11px;
  border: 1px solid var(--line-2); border-radius: 11px;
}
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 2px; height: 6px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.motion .hero__scroll span { animation: wheel 2.2s var(--ease-in-out) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* While the dots are forming the name, the real type waits underneath. */
.motion.dots-run .hero__name { opacity: 0; }
.motion.dots-done .hero__name { opacity: 1; transition: opacity .7s ease; }

/* ---------- Numbers ---------- */
.numbers { padding: 40px 0 100px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); }
.stats > div { padding: 28px 24px 0 0; }
.stats dt { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stats dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(44px, 6vw, 76px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

/* ---------- Statement (word by word) ---------- */
.statement { padding: 80px 0 160px; }
.statement__text {
  font-family: var(--display); font-weight: 600; letter-spacing: -.025em;
  font-size: clamp(30px, 4.4vw, 58px); line-height: 1.12; max-width: 22ch;
}
.statement__text .w { transition: opacity .35s ease; }
.motion .statement__text .w { opacity: .16; }
.motion .statement__text .w.on { opacity: 1; }

/* ---------- Work: stacking cards ---------- */
.work { padding-top: 60px; }
.work__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.work__head h2 { margin-bottom: 20px; }
.work__head .muted { max-width: 34ch; }
@media (min-width: 960px) { .work__head { position: sticky; top: calc(var(--hdr) + 48px); } }

.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.card {
  position: sticky; top: calc(var(--hdr) + 32px + var(--i) * 16px);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 32px 28px; min-height: 380px;
  display: flex; flex-direction: column;
  box-shadow: 0 -20px 40px -32px rgba(0, 0, 0, .6);
}
[data-theme="light"] .card { box-shadow: 0 -20px 40px -34px rgba(0, 0, 0, .22); }
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.idx { font: 500 12px var(--sans); color: var(--faint); font-variant-numeric: tabular-nums; }
.card h3 { font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 14px; }
.card > p { color: var(--muted); max-width: 58ch; }
.facts { list-style: none; padding: 0; margin: 24px 0 22px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.facts li { padding: 14px 12px 0 0; font-size: 15px; }
.facts span { display: block; font-size: 12px; color: var(--faint); margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chips span { font-size: 12px; color: var(--muted); background: var(--bg-2); border-radius: 6px; padding: 4px 9px; }
.card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 500; align-self: flex-start; }
.card__link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform .25s var(--ease-out); }
.card__link:hover svg { transform: translate(2px, -2px); }

.also { margin-top: 100px; }
.also ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); }
.also li { padding-top: 20px; color: var(--muted); font-size: 15px; }
.also strong { display: block; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 18px; margin-bottom: 4px; }

/* ---------- Timeline: the drawn line ---------- */
.timeline h2 { margin-bottom: 72px; }
.line { --q: clamp(0, (var(--p, 1) - .1) / .55, 1); position: relative; display: grid; gap: 56px; }
.line__rail { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line-2); }
.line__fill { position: absolute; inset: 0; background: var(--text); transform-origin: top; transform: scaleY(var(--q)); }
.line__item { position: relative; width: calc(50% - 56px); }
.line__item:nth-of-type(odd) { justify-self: start; text-align: right; }
.line__item:nth-of-type(even) { justify-self: end; }
.line__node {
  position: absolute; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--text);
  transition: background-color .4s ease .25s, transform .5s var(--ease-out) .25s;
}
.line__item:nth-of-type(odd) .line__node { right: -61.5px; }
.line__item:nth-of-type(even) .line__node { left: -61.5px; }
.line__item.is-in .line__node, html:not(.motion) .line__node { background: var(--text); }
.motion .line__item.is-in .line__node { animation: stamp .6s var(--ease-out) .2s backwards; }
@keyframes stamp { from { transform: scale(2.2); opacity: 0; } }
.when { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.line__item h3 { margin-bottom: 2px; }
.org { font-size: 15px; margin-bottom: 10px; }
.line__item p:last-child { color: var(--muted); font-size: 15px; }
.line__item:nth-of-type(odd) p:last-child { margin-left: auto; }
.line__item p:last-child { max-width: 44ch; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.tile {
  grid-column: span 2; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px; transition: transform .35s var(--ease-out), border-color .35s ease;
}
.tile:hover { transform: translateY(-3px); border-color: var(--line-2); }
.tile--wide { grid-column: span 3; padding: 34px; }
.tile--wide h3 { font-size: 28px; }
.tile h3 { margin-bottom: 8px; }
.tile p:last-child { color: var(--muted); font-size: 15px; }
.tiles--3 .tile { grid-column: span 2; }
.tile__icon { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 26px; }

/* ---------- Contact ---------- */
.contact { padding: 180px 0 140px; }
.contact__big { font-size: clamp(48px, 9vw, 128px); line-height: .92; letter-spacing: -.045em; margin-bottom: 28px; max-width: 12ch; }
.contact .muted { margin-bottom: 28px; max-width: 46ch; }
.mail {
  font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.2vw, 40px); letter-spacing: -.02em;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .5s var(--ease-out); padding-bottom: 4px;
}
.mail:hover { background-size: 100% 1px; }
.socials { display: flex; gap: 22px; margin-top: 30px; }
.socials a { color: var(--muted); font-size: 15px; transition: color .2s ease; }
.socials a:hover { color: var(--text); }

.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

/* ---------- Reveals (played once, leave nothing behind) ---------- */
.motion [data-reveal]:not(.is-in) { opacity: 0; }
.motion [data-reveal].is-in { animation: rise .82s var(--ease-out) var(--d, 0ms) backwards; }
.motion [data-reveal="scale"].is-in { animation-name: grow; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes grow { from { opacity: 0; transform: scale(.94); } }
.motion [data-reveal].shown { opacity: 1; animation: none; }

/* Theme switch spreads out of the button. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Small screens: still layouts ---------- */
@media (max-width: 960px) {
  .work__grid { grid-template-columns: 1fr; gap: 40px; }
  .card { min-height: 0; }
}
@media (max-width: 760px) {
  section { padding: 96px 0; }
  .links { display: none; }
  .bar__end { margin-left: auto; }
  .status { display: none; }
  .wrap, .bar__in { padding: 0 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 8px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .card { padding: 24px 22px; }
  .also ul { grid-template-columns: 1fr; gap: 0; }
  .line__rail { left: 5px; }
  .line__item, .line__item:nth-of-type(odd), .line__item:nth-of-type(even) { width: auto; justify-self: stretch; text-align: left; padding-left: 36px; }
  .line__item:nth-of-type(odd) .line__node, .line__item:nth-of-type(even) .line__node { left: 0; right: auto; }
  .line__item:nth-of-type(odd) p:last-child { margin-left: 0; }
  .tiles { grid-template-columns: 1fr; }
  .tile, .tile--wide, .tiles--3 .tile { grid-column: auto; }
  .foot { flex-direction: column; }
}
@media (hover: none) {
  .btn:hover, .icon-btn:hover, .tile:hover { transform: none; }
}
