/* Tokens borrowed from Flint's landing page: white page, #f0f0f0 ground,
   near-black ink, navy night, bloom blue. */
:root {
  --bg: #ffffff;
  --ground: #f0f0f0;
  --ink: #0a0a0a;
  --text-2: #5c5c5c;
  --text-3: #8a8a8a;
  --line: #e6e6e6;
  --night: #000032;
  --bloom-1: #5aa7d4;
  --bloom-2: #8bc0df;
  --sky-1: #c6d9e6;
  --sky-2: #faf1eb;
  --accent-deep: #1a5681;
  --red: #e5484d;
  --display: "Inter Tight", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter Tight", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3.4vw, 40px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: baseline; gap: clamp(20px, 6vw, 96px);
  padding: 28px var(--gutter) 24px;
  font: italic 400 clamp(20px, 2.2vw, 26px)/1 var(--display);
  letter-spacing: -0.02em;
}
.nav a:first-child { margin-right: auto; }
.nav a:hover i { color: var(--text-3); }
.nav .n { font: 600 11px var(--mono); font-style: normal; color: var(--text-2); margin-right: 3px; }
.clock { font: 11px var(--mono); color: var(--text-2); font-style: normal; letter-spacing: 0; white-space: nowrap; }
.clock time { color: var(--ink); margin-left: 6px; }

/* ---------- hero grid ---------- */
.hero {
  --cols: 8;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  margin: 0 var(--gutter);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.cell {
  aspect-ratio: 1;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fdfdfd;
  display: grid; place-items: center;
  position: relative;
}
.plus {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M6 0v12M0 6h12' stroke='%23b8b8b8'/%3E%3C/svg%3E") 25% 25% / 12px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M6 0v12M0 6h12' stroke='%23b8b8b8'/%3E%3C/svg%3E") 75% 25% / 12px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M6 0v12M0 6h12' stroke='%23b8b8b8'/%3E%3C/svg%3E") 25% 75% / 12px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M6 0v12M0 6h12' stroke='%23b8b8b8'/%3E%3C/svg%3E") 75% 75% / 12px no-repeat,
    linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat,
    #fdfdfd;
}
.icon { width: 21%; height: auto; }
.mono-stack { font: 11px/1.7 var(--mono); color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.vlabel {
  writing-mode: vertical-rl;
  font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3);
}
.glyph { width: 40%; color: var(--ink); }
.name {
  grid-column: 1 / -1;
  position: relative;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(8px, 2vw, 24px) 0 clamp(4px, 1vw, 12px) clamp(12px, 4vw, 64px);
  font: 500 clamp(64px, 14.2vw, 196px)/0.92 var(--display);
  letter-spacing: -0.055em;
  white-space: nowrap;
  overflow: hidden;
}
.name em { font-style: italic; font-weight: 400; letter-spacing: -0.04em; }
/* the one coloured shape on the page, after rauno.me's yellow disc */
.bloom {
  position: absolute; z-index: -1;
  width: clamp(120px, 21vw, 290px); aspect-ratio: 1; border-radius: 50%;
  right: clamp(8px, 7vw, 120px); top: 50%; transform: translateY(-50%);
  background: radial-gradient(circle at 35% 35%, var(--bloom-2), var(--bloom-1));
}
.name { isolation: isolate; }

/* hero toy (bubbles.js): multiply keeps the grid lines and type showing through */
.hero { position: relative; }
.bubbles { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; overflow: hidden; }
.bubble {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  pointer-events: auto; cursor: grab; touch-action: none; will-change: transform;
}
.bubble.held { cursor: grabbing; }
.bubble.popping { transition: opacity .25s, scale .25s; opacity: 0; scale: 1.25; }
.name .bloom { cursor: grab; touch-action: none; }
.plus { cursor: copy; }
.hint { font: 11px var(--mono); color: var(--text-3); }
.intro {
  grid-column: span 2; aspect-ratio: auto;
  display: block;
  padding: 14px 16px;
  font-size: 15px; line-height: 1.4;
}
.intro a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--bloom-1); }

/* ---------- index strip ---------- */
.strip {
  display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin-top: 64px;
  padding: 40px var(--gutter) 34px;
  background: var(--ground);
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.tile {
  flex: 0 0 clamp(220px, 23vw, 300px);
  aspect-ratio: 5 / 3;
  background: #fff;
  position: relative;
  scroll-snap-align: start;
  transition: transform .2s ease;
  /* clip the content to the tile but leave room above for the label */
  clip-path: inset(-20px 0 0 0);
}
.tile::before {
  content: attr(data-label);
  position: absolute; top: -15px; left: 0;
  font: 9px var(--mono); color: var(--text-2);
  white-space: nowrap;
}
.tile .big {
  position: absolute; left: 4px; bottom: -0.2em;
  font: 500 clamp(110px, 11vw, 150px)/1 var(--display);
  letter-spacing: -0.06em;
  white-space: nowrap;
}
.tile .dot { position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%; right: -12%; top: 50%; transform: translateY(-50%); }
.tile .dot.night { background: var(--night); }
.tile .dot.bloom { background: radial-gradient(circle at 35% 35%, var(--bloom-2), var(--bloom-1)); }
.tile-center { display: grid; place-items: center; }
.elo { font: 500 54px var(--mono); letter-spacing: -0.04em; }
.scribble { width: 70%; }
.tile-links {
  display: grid; grid-template-columns: 1fr 1fr; align-content: space-between;
  padding: 14px 16px; font-size: 17px;
}
.tile-links > :nth-child(2) { grid-column: 2; justify-self: end; grid-row: 2; }
.tile-links .y { grid-column: 1; grid-row: 3; }
.tile-links > :nth-child(3) { grid-column: 2; grid-row: 3; justify-self: end; }
.tile-links a:hover, .tile-links button:hover { color: var(--accent-deep); }
a.tile:hover { transform: translateY(-3px); }

/* ---------- work ---------- */
.label {
  font: 500 11px var(--mono);
  color: var(--text-2);
  margin-bottom: 28px;
}
.work {
  max-width: 960px; margin: 0 auto;
  padding: 120px var(--gutter) 40px;
}
.frame {
  border-radius: 14px;
  background: var(--ground);
  overflow: hidden;
  position: relative;
}
.frame-flint {
  aspect-ratio: 16 / 10;
  background: linear-gradient(170deg, var(--sky-1) 0%, var(--sky-2) 58%, #b3d1e4 100%);
  display: flex; justify-content: center; align-items: flex-start; gap: 3%;
  padding-top: 7%;
}
.frame-flint img {
  width: 25%; height: auto;
  border-radius: clamp(10px, 2.6vw, 28px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 50, .35), 0 0 0 1px rgba(0,0,0,.06);
}
.frame-flint img:nth-child(2) { margin-top: 6%; }
.frame-flint img:nth-child(3) { margin-top: 12%; }
.feature { margin-bottom: 96px; }
.meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 16px; }
.wordmark { height: 26px; width: auto; margin: 2px 0 6px; }
h3 { font: 600 15px/1.3 var(--sans); }
.sub { font-size: 13.5px; color: var(--text-2); }
.sub a { text-decoration: underline; text-underline-offset: 2px; }
.tag { font: 11px var(--mono); padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--text-2); white-space: nowrap; }
.points {
  list-style: none; margin-top: 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px;
  font-size: 15px; color: #3a3a3a; max-width: 860px;
}
.points li { padding-top: 12px; border-top: 1px solid var(--line); }

.pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; align-items: start; margin-bottom: 96px; }
.pair .card:nth-child(2) { margin-top: 120px; }
.card h3 { margin-top: 14px; }
.desc { font-size: 15px; color: #3a3a3a; margin-top: 10px; max-width: 54ch; }
.stack { font: 11px var(--mono); color: var(--text-3); margin-top: 10px; }

.frame-pipe { aspect-ratio: 4 / 3; padding: 9% 8%; display: flex; flex-direction: column; justify-content: space-between; }
.pipe { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: a; }
.pipe li {
  font: 12px var(--mono); background: #fff; padding: 7px 10px; border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line);
}
.pipe li.critic { background: var(--night); color: #fff; box-shadow: none; }
.sse { font: 11px/1.7 var(--mono); color: var(--text-2); }

.frame-board { aspect-ratio: 1; display: grid; place-items: center; padding: 10%; background: #12193c; }
.board { width: 100%; border-collapse: collapse; font: 13px var(--mono); color: #fff; }
.board td { padding: 10px 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.board td:first-child { color: rgba(255,255,255,.5); width: 2ch; }
.board td:nth-child(3) { text-align: right; }
.board td:last-child { text-align: right; width: 5ch; }
.board .up { color: #8fe0ad; }
.board .dn { color: #fecaca; }

.wide { max-width: 640px; margin-left: auto; }
.wide-left { max-width: 760px; margin-bottom: 96px; }
.frame-oyster { padding: 7% 7% 6%; display: flex; flex-direction: column; gap: 28px; }
.scan { list-style: none; font: 12px var(--mono); background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.scan li { display: grid; grid-template-columns: 9ch 1fr auto; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.scan li:last-child { border-bottom: 0; }
.scan li span:first-child { color: var(--text-3); }
.scan b { font-weight: 400; color: var(--text-2); }
.scan b.hi { color: #aa2328; }
.scan b.md { color: var(--accent-deep); }
.explain { font: italic 400 15px/1.45 var(--display); max-width: 52ch; color: #3a3a3a; }
.list a:hover { color: var(--accent-deep); }
.frame-wit { aspect-ratio: 2 / 1; display: grid; place-items: center; }
.flash {
  position: absolute; width: 52%; aspect-ratio: 5 / 3; background: #fff; border-radius: 10px;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.25);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  transform: rotate(-3deg); z-index: 1;
}
.flash span { font: 500 20px var(--display); letter-spacing: -0.02em; }
.flash svg { width: 70%; }
.flash.back { transform: rotate(5deg) translate(8%, 4%); z-index: 0; background: #fafafa; }

/* ---------- experience list ---------- */
.lists {
  max-width: 1200px; margin: 0 auto; padding: 40px var(--gutter) 96px;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start;
}
#more .what b { display: block; margin-bottom: 2px; }
.facts { background: var(--ground); border-radius: 4px; padding: 24px 24px 28px; margin-top: 44px; }
.facts h2 { font: italic 400 26px/1 var(--display); letter-spacing: -0.02em; margin-bottom: 20px; }
.facts dt { font: 600 15px var(--sans); margin-top: 14px; }
.facts dd { font-size: 14.5px; color: #3a3a3a; }
.list ul { list-style: none; }
.list li {
  display: grid; grid-template-columns: 90px 1fr auto; gap: 20px;
  padding: 14px 0; border-top: 1px solid var(--line);
  font-size: 15px;
}
.list li:last-child { border-bottom: 1px solid var(--line); }
.when { font: 12px/1.9 var(--mono); color: var(--text-2); }
.what { color: #3a3a3a; }
.what b { color: var(--ink); font-weight: 600; }
.where { font-size: 13.5px; color: var(--text-3); text-align: right; }

/* ---------- AI band ---------- */
.ai {
  background: var(--night); color: #fff;
  margin: 24px 0 96px;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 56px 32px;
}
.ai-head { grid-column: 1 / 8; }
.ai-head h2 { font: 500 clamp(44px, 6.4vw, 92px)/0.95 var(--display); letter-spacing: -0.045em; }
.ai-head em { font-style: italic; font-weight: 400; color: var(--bloom-2); }
.ai-head p { margin-top: 28px; max-width: 46ch; font-size: 17px; color: rgba(255,255,255,.78); }
.ai-org { grid-column: 8 / 13; grid-row: 1 / 3; align-self: end; border-top: 1px solid rgba(255,255,255,.2); padding-top: 20px; }
.ai-num { font: 500 clamp(96px, 13vw, 180px)/0.85 var(--display); letter-spacing: -0.06em; }
.ai-cap { font: 12px var(--mono); color: var(--bloom-2); margin: 14px 0 18px; }
.ai-body { font-size: 15px; color: rgba(255,255,255,.78); max-width: 44ch; }
.ai-ways { grid-column: 1 / 8; display: grid; grid-template-columns: 9.5rem 1fr; border-top: 1px solid rgba(255,255,255,.2); }
.ai-ways dt, .ai-ways dd { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.ai-ways dt { font: 600 15px var(--sans); }
.ai-ways dd { font-size: 14.5px; color: rgba(255,255,255,.72); }
.ai-body code { font: 13px var(--mono); color: var(--bloom-2); }

/* ---------- skills ---------- */
.skills {
  display: grid; grid-template-columns: repeat(5, 1fr);
  margin: 0 var(--gutter);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.skills > div { padding: 22px 20px 56px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skills h2 { font: 11px var(--mono); color: var(--text-2); margin-bottom: 14px; font-weight: 400; }
.skills p { font: 500 19px/1.35 var(--display); letter-spacing: -0.015em; }

/* ---------- footer ---------- */
.foot { padding: 120px var(--gutter) 24px; overflow: hidden; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.big-mail {
  font: italic 400 clamp(28px, 4.6vw, 60px)/1 var(--display); letter-spacing: -0.03em;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px;
  text-align: left;
}
.big-mail:hover { color: var(--accent-deep); }
.foot-links { display: flex; gap: 24px; font-size: 15px; }
.foot-links a:hover { color: var(--accent-deep); }
.foot-name {
  font: 500 clamp(80px, 18.5vw, 280px)/0.8 var(--display);
  letter-spacing: -0.065em;
  white-space: nowrap;
  margin: 72px 0 0 -0.05em;
  color: var(--ink);
}
.foot-fine { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; font: 11px var(--mono); color: var(--text-2); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .clock { display: none; }
  .nav a:first-child { margin-right: 0; }
  .nav { justify-content: space-between; }
  .hero { --cols: 4; }
  .hero .cell:nth-child(n+5):nth-child(-n+8),
  .hero > div.cell:nth-last-of-type(-n+2) { display: none; }
  .name { font-size: 15.5vw; padding-left: 12px; }
  .intro { grid-column: span 4; order: 0; font-size: 16px; }
  .pair { grid-template-columns: 1fr; gap: 56px; }
  .pair .card:nth-child(2) { margin-top: 0; }
  .points { grid-template-columns: 1fr; }
  .frame-flint { aspect-ratio: 4 / 3.4; }
  .frame-flint img { width: 29%; }
  .lists { grid-template-columns: 1fr; }
  .facts { margin-top: 0; }
  .list li { grid-template-columns: 1fr; gap: 2px; }
  .where { text-align: left; }
  .skills { grid-template-columns: 1fr 1fr; }
  .skills > div:last-child { grid-column: 1 / -1; }
  .ai { grid-template-columns: 1fr; gap: 48px; }
  .ai > * { grid-column: auto !important; grid-row: auto !important; }
  .ai-ways { grid-template-columns: 1fr; }
  .ai-ways dt { border-bottom: 0; padding-bottom: 2px; }
  .ai-ways dd { padding-top: 0; }
  .skills > div { padding-bottom: 32px; }
  .skills p { font-size: 16px; }
  .work { padding-top: 88px; }
}
@media (max-width: 420px) {
  .skills { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile { transition: none; }
}
