/* kerneldotcreative.com
   Layout is fixed; every colour that changes between products flows from the
   --accent custom properties, which app.js sets on <html> when the active
   product changes. The canvas itself is derived from the accent, so the whole
   page shifts to a pastel of whatever is selected. */

:root {
  --paper: #FCFBF9;
  --ink: #14130F;
  --muted: #6f6a63;

  /* Overwritten by app.js per product. --accent-rgb exists so we can build
     translucent tints without color-mix(). --accent-alt is a second brand
     colour where a product has one (ROMA's forecourt yellow). */
  --accent: #7A2BF5;
  --accent-rgb: 122 43 245;
  --accent-alt: #7A2BF5;

  /* Pastel wash of the active colour — the page background. */
  --canvas: color-mix(in srgb, var(--accent) 7%, var(--paper));
  --line: rgb(var(--accent-rgb) / 0.16);

  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 620ms var(--ease);
}
body.is-locked { overflow: hidden; }

/* The texture: a fine engineering grid (technical) under two soft colour
   blooms (creative), with a grain pass over the top so it reads as paper
   rather than as a flat fill. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(62rem 42rem at 84% 4%, rgb(var(--accent-rgb) / 0.16), transparent 64%),
    radial-gradient(52rem 38rem at 6% 96%, rgb(var(--accent-rgb) / 0.12), transparent 64%),
    repeating-linear-gradient(to right, rgb(var(--accent-rgb) / 0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgb(var(--accent-rgb) / 0.05) 0 1px, transparent 1px 72px);
  transition: background-image 620ms var(--ease);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.09'/%3E%3C/svg%3E");
}

a { color: inherit; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: clamp(20px, 2.6vw, 30px) var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin-right: auto;
}
/* The wordmark is the thesis: mono "kernel" + serif "creative", joined by a
   dot that takes the active product's colour. */
.wordmark__kernel { font-family: var(--mono); font-weight: 500; }
.wordmark__creative { font-family: var(--serif); font-weight: 400; font-size: 1.24em; }
.wordmark__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 3px;
  transform: translateY(-1px);
  transition: background 480ms var(--ease);
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
}

.masthead__link {
  border: 0;
  background: none;
  padding: 0 0 3px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms, color 200ms;
}
.masthead__link:hover { color: var(--accent); border-color: var(--accent); }

/* ── Product rail ─────────────────────────────────────────────────────── */

.rail-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: clamp(8px, 1.6vw, 16px) 0 0;
  /* Semi-transparent so the page texture continues through the sticky bar
     instead of a flat band cutting across it. */
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: background-color 620ms var(--ease);
}
.rail-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 30px;
  pointer-events: none;
  background: linear-gradient(var(--canvas), transparent);
}

.rail-track { position: relative; }

.rail {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 46px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-block: clamp(6px, 1.2vw, 12px);
  cursor: grab;
  /* Dissolve items at the edges instead of letting them hard-clip. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 11%, #000 89%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 11%, #000 89%, transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }

.rail__item {
  scroll-snap-align: center;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  border: 0;
  background: none;
  padding: 0.14em 0.4em;
  border-radius: 999px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 3.7vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.012em;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
  /* Scale rather than font-size: keeps the rail's layout width constant, so
     snapping never fights a reflow. */
  transform: scale(0.56);
  opacity: 0.26;
  transition: transform 480ms var(--ease), opacity 420ms var(--ease),
              color 420ms var(--ease), background-color 480ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.rail__item:hover { opacity: 0.55; }

/* The "bubble": a soft tint of the product's own colour, with the name itself
   in the solid shade. */
.rail__item.is-active {
  transform: scale(1);
  opacity: 1;
  color: var(--item-accent);
  background-color: rgb(var(--item-accent-rgb) / 0.11);
}
/* An active title that goes nowhere shouldn't claim to be clickable. */
.rail__item.is-active { cursor: default; }
.rail__item.is-active:hover { opacity: 1; }

/* An active title that DOES go somewhere becomes an unmistakable button on
   hover: solid fill, white text, lifted. */
.rail__item--linked.is-active { cursor: pointer; }
.rail__item--linked.is-active:hover {
  background-color: var(--item-accent);
  color: #fff;
  transform: scale(1) translateY(-2px);
  box-shadow: 0 14px 30px -14px rgb(var(--item-accent-rgb) / 0.9);
}

/* The arrow occupies its slot at all times — only its opacity changes — so
   activating an item never alters the rail's layout width. */
.rail__go {
  font-family: var(--sans);
  font-size: 0.44em;
  opacity: 0;
  transform: translate(-3px, 0);
  transition: opacity 380ms var(--ease), transform 380ms var(--ease);
}
/* A periodic nudge draws the eye to the arrow without anything moving
   constantly. Hover takes over and stops it. */
.rail__item.is-active .rail__go {
  opacity: 0.8;
  transform: none;
  animation: nudge 3.6s ease-in-out infinite;
}
.rail__item.is-active:hover .rail__go {
  opacity: 1;
  transform: translate(3px, -3px);
  animation: none;
}
@keyframes nudge {
  0%, 86%, 100% { transform: none; }
  91% { transform: translate(3px, -3px); }
  95% { transform: translate(1px, -1px); }
}

.rail-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 200ms, border-color 200ms, color 200ms;
}
.rail-arrow:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.rail-arrow[disabled] { opacity: 0.12; cursor: default; }
.rail-arrow--prev { left: 12px; }
.rail-arrow--next { right: 12px; }

@media (hover: none), (max-width: 720px) {
  .rail-arrow { display: none; }
}

.rail__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: clamp(8px, 1.4vw, 14px) var(--gutter) clamp(4px, 0.8vw, 8px);
}

/* Reads as a tooltip pointing back up at the title, not as a page caption.
   Stays mounted when empty so switching products never shifts the panel. */
.rail__hint {
  position: relative;
  margin: 0;
  padding: 6px 14px;
  /* Holds its own height when empty (border-box), so moving between a shipped
     and an unreleased product never jolts the panel below. */
  min-height: calc(1.6em + 12px);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.12);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-align: center;
  transition: opacity 320ms var(--ease);
}
/* Visible by default and hidden only when app.js leaves it empty (an unreleased
   product). Keying off :empty rather than a toggled class means the pill is
   never waiting on a transition to become visible. */
.rail__hint:empty { opacity: 0; }

/* Caret aiming at the bubble above. A border triangle rather than a rotated
   square, so it sits wholly outside the pill and its alpha can't double up
   against the pill's own translucent fill. */
.rail__hint::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgb(var(--accent-rgb) / 0.12);
}

.rail__progress { display: flex; gap: 6px; }
.rail__dot {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: rgb(var(--accent-rgb) / 0.2);
  transition: background 380ms var(--ease), width 380ms var(--ease);
}
.rail__dot.is-active { background: var(--accent); width: 32px; }

/* ── Product panel ────────────────────────────────────────────────────── */

.panel {
  padding: clamp(22px, 3.4vw, 44px) var(--gutter) clamp(44px, 6vw, 88px);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
.panel.is-swapping { opacity: 0; transform: translateY(10px); }

.lede {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(26px, 4.6vw, 70px);
  align-items: center;
}

.lede__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(12px, 1.8vw, 18px);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent-rgb) / 0.3);
  color: var(--accent);
}
.status__led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* Live products get a slow pulse; in-development ones stay static. */
.status--live .status__led { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.45); }
  50% { opacity: 0.75; box-shadow: 0 0 0 5px rgb(var(--accent-rgb) / 0); }
}

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
.tag--flagship { background: var(--accent); color: #fff; }
.tag--free { background: rgb(var(--accent-rgb) / 0.13); color: var(--accent); }

.lede__kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Expansion of an acronym product name (ROMA). */
.lede__expand {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.lede__tagline {
  margin: 0 0 clamp(12px, 1.8vw, 18px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(25px, 3.1vw, 40px);
  line-height: 1.16;
  letter-spacing: -0.015em;
  max-width: 18ch;
}

.lede__desc {
  margin: 0 0 clamp(20px, 2.6vw, 28px);
  color: var(--muted);
  font-size: clamp(14.5px, 1.05vw, 15.5px);
  max-width: 54ch;
}

.ask {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid rgb(var(--accent-rgb) / 0.35);
  transition: border-color 200ms;
}
.ask:hover { border-color: var(--accent); }
.ask span { transition: transform 220ms var(--ease); display: inline-block; }
.ask:hover span { transform: translateX(3px); }

/* ── Visual block ─────────────────────────────────────────────────────── */

.visual {
  aspect-ratio: 4 / 3;
  border-radius: clamp(14px, 1.8vw, 24px);
  background: var(--accent);
  color: var(--mark, #fff);
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.6vw, 36px);
  overflow: hidden;
  box-shadow: 0 24px 60px -34px rgb(var(--accent-rgb) / 0.85);
  transition: background 560ms var(--ease);
}
.visual svg { width: min(62%, 240px); height: auto; opacity: 0.94; }

/* Eva's showreel replaces the abstract mark. */
.reel {
  aspect-ratio: 16 / 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 2fr 1fr;
  gap: 8px;
  width: 100%;
  padding: 0;
  color: #fff;
  /* .visual centres its single child; the reel's slots must fill their cells
     instead, or they collapse to zero. */
  place-items: stretch;
}
.reel__slot {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.13);
  display: grid;
  place-items: center;
}
.reel__slot--hero { grid-column: 1 / -1; }
.reel__slot video, .reel__slot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.reel__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.6);
  border: 1px dashed rgb(255 255 255 / 0.3);
  border-radius: 10px;
}

@media (max-width: 900px) {
  .lede { grid-template-columns: 1fr; }
  .visual { order: -1; aspect-ratio: 16 / 10; }
  .lede__tagline { max-width: 100%; }
}

/* ── Invariants strip (Eva only) ──────────────────────────────────────── */

.invariants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(16px, 2.2vw, 24px);
}
.invariants__item {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent);
}

/* ── Detail bands ─────────────────────────────────────────────────────── */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(26px, 3.6vw, 60px);
  margin-top: clamp(40px, 5.4vw, 78px);
  padding-top: clamp(26px, 3.4vw, 40px);
  border-top: 1px solid var(--line);
}

.detail h2 {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.caps { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: clamp(20px, 3vw, 42px); }
.caps li {
  break-inside: avoid;
  display: flex;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 14px;
  line-height: 1.5;
}
.caps__idx {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  padding-top: 3px;
  flex-shrink: 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.tiers { display: flex; flex-direction: column; gap: 13px; }
.tier {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.tier:last-child { border-bottom: 0; padding-bottom: 0; }
.tier__name { font-size: 14px; }
.tier__price {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  color: var(--accent);
}
.tier__meta {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}
.tier__right { text-align: right; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; gap: 32px; }
  .caps { columns: 1; }
}

/* ── About overlay ────────────────────────────────────────────────────── */

.about { position: fixed; inset: 0; z-index: 50; }
.about__scrim {
  position: absolute;
  inset: 0;
  background: rgb(20 19 15 / 0.42);
  backdrop-filter: blur(3px);
}
.about__sheet {
  position: relative;
  margin: clamp(40px, 9vh, 110px) auto 0;
  max-width: 620px;
  width: calc(100% - 2 * var(--gutter));
  max-height: 76vh;
  overflow-y: auto;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: clamp(14px, 1.8vw, 22px);
  padding: clamp(26px, 3.4vw, 42px);
  box-shadow: 0 40px 90px -40px rgb(20 19 15 / 0.5);
}
.about__title {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}
.about__body p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.65;
}
.about__body p:first-child {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-bottom: 20px;
}
.about__body p:not(:first-child) { color: var(--muted); }
.about__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}
.about__close:hover { color: var(--accent); background: rgb(var(--accent-rgb) / 0.1); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--gutter) 38px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.footer__mark { font-family: var(--mono); display: inline-flex; align-items: center; }
.footer__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  margin: 0 3px;
  transition: background 480ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
