/*
 * Kason Extensions: a dark-first neon HUD look (the Kason family style).
 * Inspired by the cyberpunk genre; every rule here is our own. Fonts are self-hosted
 * (SIL Open Font License, see /fonts/OFL-*.txt).
 *
 * Clipped corners are painted on ::before/::after layers behind unclipped elements,
 * because clip-path also clips an element's own outline: focus rings must survive.
 */

@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/chakra-petch-700.woff2?v=3c2433eb16') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500.woff2?v=615a7673d3') format('woff2');
}

/* Light: paper and ink. Volt is only ever a fill here (on paper it would be invisible). */
:root {
  color-scheme: light dark;
  --bg: #f3f1e8;
  --surface: #fbfaf5;
  --surface-2: #ebe8dc;
  --text: #101015;
  --muted: #4f4d5c;
  --line: #d6d2c2; /* decorative */
  --line-strong: #8e8a78; /* edges of controls, 3:1 */
  --mark: #101015; /* small brand marks and bullets */
  --volt: #f3e600;
  --on-volt: #101015;
  --link: #00687a;
  --link-hover: #004f5d;
  --focus: #00687a;
  --hover-line: #101015;
  --btn-bg: #101015;
  --btn-text: #f3e600;
  --btn-bg-hover: #2a2a33;
  --btn-bg-active: #050507;
  --hazard: rgb(16 16 21 / 10%);
  --grid: rgb(16 16 21 / 7%);
  --scan: rgb(16 16 21 / 3%);
  --glow-a: rgb(0 104 122 / 45%);
  --glow-b: rgb(176 16 63 / 35%);
  --display: 'Chakra Petch', 'Arial Narrow', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cut: 16px;
  --cut-sm: 10px;
  --shape: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  --shape-sm: polygon(0 0, calc(100% - var(--cut-sm)) 0, 100% var(--cut-sm), 100% 100%, var(--cut-sm) 100%, 0 calc(100% - var(--cut-sm)));
  font-family: var(--body);
}

/* Dark: ink and neon. The primary look. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0f;
    --surface: #14141c;
    --surface-2: #1c1c27;
    --text: #ecebf2;
    --muted: #a3a2b4;
    --line: #2a2a38;
    --line-strong: #6f6e85;
    --mark: #f3e600;
    --volt: #f3e600;
    --on-volt: #0b0b0f;
    --link: #00d9ff;
    --link-hover: #7debff;
    --focus: #00d9ff;
    --hover-line: #f3e600;
    --btn-bg: #f3e600;
    --btn-text: #0b0b0f;
    --btn-bg-hover: #fff35c;
    --btn-bg-active: #d6ca00;
    --hazard: rgb(243 230 0 / 18%);
    --grid: rgb(243 230 0 / 6%);
    --scan: rgb(255 255 255 / 2.5%);
    --glow-a: rgb(0 217 255 / 70%);
    --glow-b: rgb(255 79 123 / 60%);
  }
}

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

html {
  scroll-padding-top: 88px; /* anchors land below the sticky header */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Faint scanlines over everything. Decorative only: never catches a click. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px);
}

main {
  overflow-x: clip; /* the full-bleed hero grid must never widen the page */
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: var(--volt);
  color: var(--on-volt);
}

/* Links: default, hover, pressed, focus (disabled links don't exist here). */
a {
  color: var(--link);
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

a:hover {
  color: var(--link-hover);
}

a:active {
  opacity: 0.75;
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.1;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding-top: 72px;
}

/* HUD labels */
.hud,
.eyebrow {
  margin: 0 0 8px;
  color: var(--link);
  font: 500 13px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  gap: 16px;
  align-items: center;
}

.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line-strong), transparent);
}

.hud::after {
  content: '▌';
  margin-left: 4px;
  color: var(--mark);
}

@media (prefers-reduced-motion: no-preference) {
  .hud::after {
    animation: blink 1.1s steps(1) infinite;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Header and footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: max(24px, calc(50% - 540px + 24px)); /* under the brand mark, wherever the content starts */
  width: min(240px, 40vw);
  height: 2px;
  background: var(--mark);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font: 700 18px/1 var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--mark);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 55% 100%, 0 100%);
}

.brand:hover {
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 24px;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a:active {
  color: var(--link);
}

.site-footer {
  margin-top: 96px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 12px/1.6 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer .contact {
  text-transform: none;
}

/* Home */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: 96px;
  padding-bottom: 32px;
}

/* A full-bleed grid behind the hero that fades out downwards. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0 auto -64px 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}

.hero h1 {
  max-width: 13em;
  margin: 8px 0 24px;
  font-size: clamp(34px, 7vw, 76px);
  line-height: 1.02;
  text-shadow:
    2px 0 var(--glow-b),
    -2px 0 var(--glow-a);
}

.lead {
  max-width: 40em;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* Cards: an edge layer (::before) and a face layer (::after), both clipped. */
.card {
  position: relative;
  isolation: isolate;
  padding: 24px;
  transition: transform 150ms ease;
}

.card::before,
.card::after {
  content: '';
  position: absolute;
  z-index: -1;
  clip-path: var(--shape);
}

.card::before {
  inset: 0;
  background: var(--line-strong);
  transition: background-color 150ms ease;
}

.card::after {
  inset: 1px;
  background: var(--surface);
}

.card:hover {
  transform: translateY(-2px);
}

.card:hover::before {
  background: var(--hover-line);
}

.card:active {
  transform: translateY(0);
}

/* The whole card is one link; its focus ring goes around the card. */
.card:has(.card-link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.card-link:focus-visible {
  outline: none;
}

.card img {
  display: block;
  width: 64px;
  height: 64px;
}

.card h3 {
  margin: 16px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.card-link {
  color: var(--text);
  text-decoration: none;
}

.card-link:hover {
  color: var(--text);
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.price {
  color: var(--muted);
  font: 500 13px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card .price {
  margin: 16px 0 0;
}

.price strong {
  display: inline-block;
  padding: 4px 12px 4px 10px;
  background: var(--volt);
  color: var(--on-volt);
  font-weight: 500;
  clip-path: polygon(0 0, 100% 0, 100% 55%, calc(100% - 8px) 100%, 0 100%);
}

.bundle {
  position: relative;
  isolation: isolate;
  padding: 32px;
}

.bundle::before,
.bundle::after {
  content: '';
  position: absolute;
  z-index: -1;
  clip-path: var(--shape);
}

.bundle::before {
  inset: 0;
  background: var(--hover-line);
}

.bundle::after {
  inset: 2px;
  background: var(--surface);
}

.bundle h2,
.bundle h3 {
  margin: 0 0 8px;
  font-size: 28px;
}

.bundle-list {
  margin: 16px 0 24px;
  padding-left: 24px;
}

.faq {
  display: grid;
  grid-template-columns: minmax(0, 18em) minmax(0, 1fr);
  gap: 16px 32px;
  margin: 0;
}

.faq dt {
  font: 700 18px/1.4 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.faq dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 640px) {
  .faq {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .faq dd {
    margin-bottom: 16px;
  }
}

/* Buttons: default, hover, pressed, focus (:focus-visible above) and disabled. */
.button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 28px;
  border: 0;
  background: none;
  color: var(--text);
  font: 700 15px/1.2 var(--display);
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 150ms ease,
    color 150ms ease;
}

.button::before,
.button::after {
  content: '';
  position: absolute;
  z-index: -1;
  clip-path: var(--shape-sm);
}

.button::before {
  inset: 0;
  background: var(--line-strong);
  transition: background-color 150ms ease;
}

.button::after {
  inset: 1px;
  background: var(--bg);
}

.button:hover {
  color: var(--text);
}

.button:hover::before {
  background: var(--hover-line);
}

.button:active {
  transform: translateY(1px);
}

.button-primary,
.button-primary:hover {
  color: var(--btn-text);
}

.button-primary::before {
  background: var(--btn-bg);
}

.button-primary::after {
  display: none;
}

.button-primary:hover::before {
  background: var(--btn-bg-hover);
}

.button-primary:active::before {
  background: var(--btn-bg-active);
}

/* Not available yet: hazard stripes, dimmed, and it says so. */
.button:disabled {
  color: var(--text);
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.button:disabled::before {
  background:
    repeating-linear-gradient(-45deg, var(--hazard) 0 8px, transparent 8px 16px),
    var(--surface-2);
}

.button:disabled::after {
  display: none;
}

/* Extension page */
.product {
  padding-top: 48px;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 16px;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.back:hover {
  text-decoration: underline;
}

.product-head {
  display: flex;
  gap: 24px;
  align-items: center;
}

.product-head > img {
  flex: none;
  width: 96px;
  height: 96px;
  padding: 12px;
  background: var(--surface-2);
  clip-path: var(--shape-sm);
}

.product-head h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1;
  text-shadow:
    2px 0 var(--glow-b),
    -2px 0 var(--glow-a);
}

.product-head .lead {
  margin-top: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 40px 0;
}

.actions .price {
  margin: 0 8px 0 0;
}

.screenshots {
  display: grid;
  gap: 24px;
}

/* A thin volt edge that fades along the frame; the padding is the frame. */
.screenshots img {
  display: block;
  width: 100%;
  padding: 2px;
  background: linear-gradient(135deg, var(--hover-line), var(--line) 45%, var(--line));
  clip-path: var(--shape);
}

.prose {
  max-width: 46em;
}

/* Plain paragraphs only: HUD labels and the date line keep their own small size. */
.prose p:not([class]),
.prose li {
  font-size: 17px;
}

.prose ul {
  padding-left: 0;
  list-style: none;
}

.prose li {
  position: relative;
  margin: 8px 0;
  padding-left: 28px;
}

.prose li::before {
  content: '';
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--mark);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Privacy page */
.privacy {
  padding-top: 48px;
}

.privacy h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.1;
}

.privacy h2 {
  margin: 40px 0 8px;
  font-size: 22px;
}

.muted {
  color: var(--muted);
  font: 500 13px/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

code {
  padding: 2px 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.9em;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 8px;
  border-bottom: 1px dashed var(--line-strong);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td code {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .hero {
    padding-top: 56px;
  }

  .hero h1,
  .product-head h1 {
    text-shadow:
      1px 0 var(--glow-b),
      -1px 0 var(--glow-a);
  }

  .product-head {
    align-items: flex-start;
  }

  .product-head > img {
    width: 72px;
    height: 72px;
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  a,
  .card,
  .card::before,
  .button,
  .button::before {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
