/* Subpage components shared by /platform, /ai and /features: centered hero, pinned sequence, facts, filters and bento,
   plus the code tabs and manifest explorer of the platform page. Builds on landing.css. */

@property --spot-x { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --spot-y { syntax: "<percentage>"; inherits: false; initial-value: 50%; }

/* Reading progress, driven by the scroll timeline where supported. */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--blue); transform-origin: left; transform: scaleX(0); z-index: 60; }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* Hero */
.p-hero { position: relative; min-height: 100svh; display: grid; align-items: center; isolation: isolate; text-align: center; overflow: hidden; }
.p-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.p-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 28%; background: linear-gradient(transparent, var(--ink)); z-index: -1; }
.p-hero-in { padding-block: 164px 80px; display: grid; justify-items: center; }
.p-hero .eyebrow::before { display: none; }
.p-hero h1 { font-size: clamp(52px, 11vw, 148px); line-height: 0.94; letter-spacing: -0.055em; font-weight: 660; margin-top: 22px; }
.p-hero h1 em { font-style: normal; background: linear-gradient(100deg, #f5f3ec 0%, #189eff 55%, #8fd0ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.p-lead { margin-top: 30px; max-width: 620px; font-size: clamp(18px, 1.7vw, 22px); color: var(--muted); }
.p-hero .hero-cta { justify-content: center; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .p-hero-in { animation: recede linear both; animation-timeline: view(); animation-range: exit 0% exit 80%; }
    @keyframes recede { to { opacity: 0; transform: scale(0.94) translateY(-4%); } }
  }
}

/* Pinned architecture */
.pin { height: 560vh; }
.pin-stick { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.pin-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 64px); align-items: center; height: 100%; padding-top: 108px; }
.pin-copy h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 640; margin-top: 18px; }
.pin-steps { list-style: none; margin: 34px 0 0; padding: 0; position: relative; min-height: 190px; }
.pin-steps li { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(18px); transition: opacity 0.45s, transform 0.45s; pointer-events: none; }
.pin-steps li.on { opacity: 1; transform: none; pointer-events: auto; }
.pin-steps b { font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.025em; font-weight: 640; color: var(--blue); display: block; }
.pin-steps p { margin-top: 12px; color: var(--muted); font-size: clamp(16px, 1.3vw, 18.5px); max-width: 440px; }
.pin-count { font: 600 12.5px var(--mono); letter-spacing: 0.12em; color: var(--faint); margin-top: 26px; }
.pin-count span { color: var(--text); }
.pin-stage { height: min(78svh, 760px); }
.pin-stage canvas { width: 100%; height: 100%; }
.pin.static { height: auto; padding-block: 96px; }
.pin.static .pin-stick { position: static; height: auto; }
.pin.static .pin-steps { min-height: 0; display: grid; gap: 22px; }
.pin.static .pin-steps li { position: static; opacity: 1; transform: none; }
.pin.static .pin-count { display: none; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 64px; border-top: 1px solid rgba(23, 27, 24, 0.16); }
.fact { padding: 30px 26px 30px 0; border-right: 1px solid rgba(23, 27, 24, 0.16); }
.fact + .fact { padding-left: 26px; }
.fact:last-child { border-right: 0; }
.fact b { font: 660 clamp(72px, 9vw, 128px)/0.9 var(--sans); letter-spacing: -0.06em; display: block; color: var(--blue-text); }
.fact h3 { font-size: 19px; letter-spacing: -0.02em; margin-top: 18px; }
.fact p { font-size: 15px; color: rgba(23, 27, 24, 0.7); margin-top: 8px; }

/* Filters and bento */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.filters button { font: 600 13.5px var(--sans); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.filters button:hover { color: var(--text); border-color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--paper); color: var(--graphite); border-color: var(--paper); }
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; gap: 14px; margin-top: 26px; }
.tile {
  --accent: #189eff; --accent-rgb: 24,158,255;
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 232px; padding: 22px;
  border-radius: 22px; text-decoration: none; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, rgba(245, 243, 236, 0.055), rgba(245, 243, 236, 0.02));
  border: 1px solid var(--line);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.3s, box-shadow 0.35s;
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(340px circle at var(--spot-x) var(--spot-y), rgba(var(--accent-rgb), 0.24), transparent 65%);
}
/* Accent line that draws in from the left on hover, and the arrow that says the tile is a link. */
.tile::after {
  content: "↗"; position: absolute; right: 20px; bottom: 16px; font: 600 16px var(--mono); color: var(--accent);
  opacity: 0; transform: translate(-6px, 6px); transition: opacity 0.3s, transform 0.3s;
}
.tile:hover { transform: translateY(-4px); border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 28px 60px -34px rgba(var(--accent-rgb), 0.7), inset 0 1px 0 rgba(var(--accent-rgb), 0.5); }
.tile:hover::before { opacity: 1; }
.tile:hover::after { opacity: 1; transform: none; }
.tile-glyph { width: 63px; height: 63px; margin-bottom: 14px; flex: none; }
.tile i { position: absolute; top: 24px; right: 22px; max-width: calc(100% - 110px); text-align: right; font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); opacity: 0.85; font-style: normal; }
.tile h3 { font-size: 22px; letter-spacing: -0.025em; font-weight: 640; }
/* Without the script-drawn symbol the label would sit on the title; keep them apart. */
.tile:not(:has(.tile-glyph)) h3 { padding-top: 24px; }
.tile p { font-size: 14.5px; color: var(--muted); padding-right: 14px; }
.tile-l { grid-column: span 2; background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(245, 243, 236, 0.02) 55%); }
.tile-l .tile-glyph { width: 81px; height: 81px; }
.tile-l h3 { font-size: 27px; }
.tile-l p { font-size: 15.5px; max-width: 460px; }
.tile-xl { grid-column: span 2; grid-row: span 2; background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.03) 60%); border-color: rgba(var(--accent-rgb), 0.4); }
.tile-xl .tile-glyph { width: 126px; height: 126px; margin-bottom: 22px; }
.tile-xl h3 { font-size: clamp(34px, 4vw, 54px); letter-spacing: -0.045em; }
.tile-xl p { font-size: 16.5px; max-width: 380px; }
.tile-vis { margin-top: auto; display: grid; gap: 7px; padding-top: 18px; }
.tile-vis span { height: 10px; border-radius: 6px; background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-rgb), 0.15)); transform-origin: left; }
.tile-vis span:nth-child(2) { width: 78%; opacity: 0.7; }
.tile-vis span:nth-child(3) { width: 52%; opacity: 0.45; }
.tile[hidden] { display: none; }
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Code */
.code { margin-top: 52px; border-radius: 22px; border: 1px solid var(--line-strong); background: #0a0c0b; overflow: hidden; box-shadow: 0 50px 110px -50px rgba(24, 158, 255, 0.4); }
.code-tabs { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.code-tabs button { font: 600 13px var(--mono); padding: 8px 14px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.code-tabs button[aria-selected="true"] { background: rgba(245, 243, 236, 0.1); color: var(--text); }
.code-tabs .code-copy { margin-left: auto; color: var(--blue); }
.code-body { margin: 0; padding: 24px; min-height: 290px; font: 500 14px/1.75 var(--mono); color: var(--text); overflow-x: auto; tab-size: 2; view-transition-name: code-body; }
.code-body .k { color: #8fd0ff; }
.code-body .s { color: #9fe3bd; }
.code-body .c { color: var(--faint); }
.code-body .f { color: #ffcf8f; }
.code-note { margin: 0; padding: 14px 24px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

.entry { margin-top: 72px; }
.entry h3, .h3-xl { font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.03em; font-weight: 640; line-height: 1.1; }
.entry-table { margin-top: 26px; border-top: 1px solid var(--line-strong); }
.entry-table [role="row"] { display: grid; grid-template-columns: 1.2fr 0.9fr 1.3fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 15.5px; }
.entry-head { font: 600 11.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.entry-table code { font: 600 14px var(--mono); color: var(--blue); }
.entry-table [role="cell"]:last-child { color: var(--muted); }
.muted { color: var(--muted); margin-top: 16px; }

/* Manifest explorer */
.manifest { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; margin-top: 56px; align-items: stretch; }
.mf-code { border-radius: 22px; border: 1px solid var(--line-strong); background: #0a0c0b; overflow: hidden; display: flex; flex-direction: column; }
.mf-bar { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font: 500 12px var(--mono); color: var(--faint); }
.mf-block { all: unset; display: block; cursor: pointer; padding: 6px 18px; border-left: 2px solid transparent; opacity: 0.42; transition: opacity 0.3s, background 0.3s, border-color 0.3s; }
.mf-block pre { margin: 0; font: 500 13.5px/1.7 var(--mono); color: var(--text); white-space: pre; overflow-x: auto; }
.mf-block:hover { opacity: 0.8; }
.mf-block.on { opacity: 1; background: rgba(24, 158, 255, 0.1); border-left-color: var(--blue); }
.mf-block:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.mf-map { display: grid; gap: 10px; }
.mf-target { border-radius: 18px; border: 1px solid var(--line); padding: 16px 20px; display: grid; grid-template-columns: 34px 1fr; column-gap: 6px; opacity: 0.45; transition: opacity 0.3s, border-color 0.3s, background 0.3s, transform 0.3s; }
.mf-target i { font: 600 12px var(--mono); color: var(--blue); font-style: normal; grid-row: span 2; padding-top: 4px; }
.mf-target b { font-size: 17px; letter-spacing: -0.015em; }
.mf-target p { font-size: 14.5px; color: var(--muted); margin-top: 4px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.4s, opacity 0.3s; }
.mf-target.on { opacity: 1; border-color: var(--blue); background: rgba(24, 158, 255, 0.08); transform: translateX(4px); }
.mf-target.on p { max-height: 120px; opacity: 1; }

.track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 72px; border-top: 1px solid var(--line-strong); }
.track.track-4 { grid-template-columns: repeat(4, 1fr); }
.track-item { padding: 26px 26px 0 0; position: relative; }
.track-item::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.track-item i { font: 600 12px var(--mono); color: var(--blue); font-style: normal; }
.track-item h3 { font-size: 21px; letter-spacing: -0.02em; margin-top: 8px; }
.track-item p { font-size: 15px; color: var(--muted); margin-top: 8px; }
.apps-run { margin-top: 80px; align-items: start; }
.workshops { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.workshops li { display: grid; grid-template-columns: 44px 1fr; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.workshops span { font: 600 12px var(--mono); color: var(--blue); }
.workshops a { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; text-decoration: none; transition: color 0.2s; }
.workshops a:hover { color: var(--blue); }

@media (max-width: 900px) {
  .pin-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 8px; padding-top: 120px; align-items: start; }
  .pin-copy h2 { font-size: 26px; margin-top: 10px; }
  .pin-steps { margin-top: 16px; min-height: 150px; }
  .pin-steps b { font-size: 20px; }
  .pin-steps p { font-size: 15px; margin-top: 6px; }
  .pin-count { display: none; }
  .pin-stage { height: 100%; min-height: 0; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact, .fact + .fact { padding: 24px 16px 24px 0; border-right: 0; border-bottom: 1px solid rgba(23, 27, 24, 0.16); }
  .bento { grid-template-columns: 1fr 1fr; }
  .manifest { grid-template-columns: 1fr; }
  .track, .track.track-4 { grid-template-columns: 1fr; }
  .track-item { padding-bottom: 20px; }
  .entry-table [role="row"] { grid-template-columns: 1fr; gap: 4px; }
  .entry-head { display: none !important; }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: 1fr; }
  .tile-l, .tile-xl { grid-column: auto; }
  .tile { min-height: 0; }
  .facts { grid-template-columns: 1fr; }
  .code-body { font-size: 12.5px; padding: 18px; }
  .mf-block pre { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile::after, .mf-target, .mf-block, .pin-steps li { transition: none; }
  ::view-transition-group(*) { animation: none; }
}
