/* ==========================================================================
   PanIA Studios — site stylesheet
   One file, theme tokens per product. No build step, no framework.
   ========================================================================== */

@font-face {
  font-family: 'Share Tech Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ShareTechMono-Regular.ttf') format('truetype');
}

/* --- tokens ------------------------------------------------------------- */

:root {
  --mono: 'Share Tech Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max: 1140px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(52px, 8vw, 104px);
  --radius: 6px;
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* PanIA house theme (home) */
body.t-home {
  --bg: #040b07;
  --panel: #081310;
  --fg: #e8fff0;
  --muted: #7d9b88;
  --accent: #4dff6a;
  --line: rgba(77, 255, 106, 0.16);
  --radius: 4px;
}

/* Tesla Dash and Drag — black / pure red / white */
body.t-tesla {
  --bg: #08080a;
  --panel: #101013;
  --fg: #f3f3f4;
  --muted: #98989f;
  --accent: #ff2b2b;
  --line: rgba(255, 43, 43, 0.24);
  --radius: 3px;
}

/* Time to Race — racing red on dark */
body.t-ttr {
  --bg: #131313;
  --panel: #1d1d1d;
  --fg: #f6f0ee;
  --muted: #a79c98;
  --accent: #e10600;
  --line: rgba(225, 6, 0, 0.3);
  --radius: 8px;
}

/* Edron Outdoor — dark slate / terrain sand */
body.t-edron {
  --bg: #0b0f12;
  --panel: #121a1e;
  --fg: #e7eef3;
  --muted: #8ea1ac;
  --accent: #d9a64d;
  --line: rgba(217, 166, 77, 0.22);
  --radius: 5px;
}

/* --- base --------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: clamp(15px, 0.32vw + 14px, 17px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%);
}

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

a { color: inherit; }

p { margin: 0 0 1.05em; }

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: 0.005em;
}

h1 { font-size: clamp(30px, 4.4vw, 52px); }
h2 { font-size: clamp(22px, 2.4vw, 30px); }
h3 { font-size: clamp(17px, 1.3vw, 20px); }

::selection { background: var(--accent); color: #050505; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: calc(var(--section) * 0.62); position: relative; z-index: 1; }

.section + .section { padding-top: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  max-width: 120px;
  background: currentColor;
  opacity: 0.35;
}

.lead { font-size: clamp(17px, 1.1vw + 14px, 20px); color: var(--fg); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.86em; }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  margin-inline: auto;
  padding: 20px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

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

.brand img { width: 58px; height: auto; opacity: 0.85; }

.topbar .back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.topbar .back:hover { color: var(--fg); border-color: var(--accent); }

/* --- buttons ------------------------------------------------------------ */

.btn {
  --btn-bg: var(--accent);
  --btn-fg: #060606;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 22px;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px -8px var(--accent); }

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

.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Google Play badge is placed on a light chip: the badge artwork stays untouched */
.play-chip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.play-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 22px -10px #fff; }

.play-chip img { height: 34px; width: auto; }

/* --- product hero ------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(18px, 3.5vw, 46px) var(--gutter) clamp(30px, 5vw, 58px);
}

.hero-copy { min-width: 0; position: relative; z-index: 1; }

.product-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.product-title img {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
}

.product-title h1 { margin: 0; }

.hero-media { min-width: 0; position: relative; z-index: 1; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.shot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.shot img { width: 100%; }

.hero-shot { box-shadow: 0 40px 80px -50px rgba(0, 0, 0, 1); }

/* --- chips -------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.chip-quiet { color: var(--muted); }
.chip-quiet::before { box-shadow: none; opacity: 0.6; }

/* --- feature grid ------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.grid > div {
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  padding: 24px 22px 26px;
}

.grid h3 { margin-bottom: 8px; }

.grid p { margin: 0; color: var(--muted); font-size: 0.94em; }

.grid .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: block;
  margin-bottom: 14px;
}

/* --- screenshots row ---------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
  align-items: start;
}

.shots img { border-radius: var(--radius); }

/* --- beta form ---------------------------------------------------------- */

.beta-block {
  padding: clamp(24px, 3.4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--panel);
}

.beta-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.beta-form input[type='email'] {
  flex: 1 1 280px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.beta-form input[type='email']::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }

.beta-form input[type='email']:focus { border-color: var(--accent); box-shadow: var(--ring); }

.beta-form button { flex: 0 0 auto; }

.form-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; max-width: 52ch; }

.form-status {
  font-family: var(--mono);
  font-size: 13px;
  margin: 14px 0 0;
  color: var(--accent);
  min-height: 1.2em;
}

.form-status[data-state='error'] { color: #ff8a80; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- home --------------------------------------------------------------- */

.home-stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(26px, 4vw, 52px);
  padding: clamp(28px, 6vw, 64px) var(--gutter) clamp(24px, 4vw, 44px);
}

.home-logo { width: min(660px, 92vw, 80svh); }

.home-logo img { width: 100%; }

.home-nav {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.prod-card {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 18px;
  text-decoration: none;
  background: color-mix(in srgb, var(--c) 4%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  border-radius: 8px;
  color: var(--fg);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.prod-card:hover {
  background: color-mix(in srgb, var(--c) 10%, var(--panel));
  border-color: var(--c);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -26px var(--c);
}

.prod-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  image-rendering: auto;
}

.prod-card .name {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

.prod-card .desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

.prod-card .foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--c) 85%, var(--fg));
}

.prod-card .arrow { transition: transform 0.2s ease; }
.prod-card:hover .arrow { transform: translateX(4px); }

.prod-card.is-disabled {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

.prod-card.is-disabled:hover {
  background: color-mix(in srgb, var(--c) 4%, var(--panel));
  border-color: color-mix(in srgb, var(--c) 26%, transparent);
  transform: none;
  box-shadow: none;
}

.home-foot {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  opacity: 0.75;
  text-align: center;
}

.home-foot a { text-decoration: none; border-bottom: 1px solid var(--line); }
.home-foot a:hover { color: var(--fg); }

/* --- footer ------------------------------------------------------------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: var(--section);
  border-top: 1px solid var(--line);
}

.foot-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: 26px var(--gutter) 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* --- product flourishes ------------------------------------------------- */

/* Tesla: instrument tick rule */
.t-tesla .tick-rule {
  height: 7px;
  background-image: repeating-linear-gradient(90deg, var(--accent) 0 1px, transparent 1px 13px);
  opacity: 0.45;
  margin-bottom: 22px;
}

.t-tesla .hero-media { position: relative; }

.t-tesla .stat-row {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 26px;
  font-family: var(--mono);
}

.t-tesla .stat-row b {
  display: block;
  font-size: 26px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.1;
}

.t-tesla .stat-row span { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* Time to Race: checkered strip */
.t-ttr .checker {
  height: 8px;
  background-image: repeating-conic-gradient(#efefef 0deg 90deg, #111 90deg 180deg);
  background-size: 16px 16px;
  opacity: 0.9;
}

.t-ttr .tagline-quote {
  font-family: var(--mono);
  font-size: clamp(19px, 2vw, 25px);
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  margin: 0;
  color: var(--fg);
}

/* Edron: contour lines */
.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--accent);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 62%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 62%);
}

.hero-single { grid-template-columns: 1fr; }
.hero-single .hero-copy { max-width: 68ch; }

.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
}

.prow-opt { border-style: dashed; }
.prow-out { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

.prow .lbl {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.prow .rhs {
  margin-left: auto;
  padding-left: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.pstep {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  min-width: 22px;
}

.t-edron .wordmark {
  font-family: var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.t-edron .wordmark .sub {
  display: block;
  font-size: 0.36em;
  letter-spacing: 0.42em;
  color: var(--muted);
  margin-top: 0.6em;
}

/* --- section headings --------------------------------------------------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(22px, 3vw, 34px);
}

.section-head h2 { margin: 0; }
.section-head a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--accent); }

/* --- two column --------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 4vw, 52px);
  align-items: start;
}

/* --- blog --------------------------------------------------------------- */

.post-list { display: grid; gap: 0; border-top: 1px solid var(--line); }

.post-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 26px;
  gap: 20px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.post-item:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); padding-left: 12px; }

.post-item time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-item h3 { margin: 0 0 4px; font-size: clamp(17px, 1.5vw, 21px); }
.post-item p { margin: 0; color: var(--muted); font-size: 0.93em; }
.post-item .arrow { color: var(--accent); font-family: var(--mono); }

.post-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 26px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-meta .sep { opacity: 0.4; }

.prose { max-width: 70ch; }

.prose h2 { margin-top: 1.6em; }

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
}

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--fg);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { padding-left: 1.15em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.article-head { padding: clamp(20px, 4vw, 46px) 0 clamp(18px, 3vw, 30px); }
.article-head h1 { font-size: clamp(26px, 3.6vw, 42px); max-width: 24ch; }

/* --- code block --------------------------------------------------------- */

.code {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: #0b0b0c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #cfd6d3;
  tab-size: 2;
}

.code .k { color: var(--accent); }
.code .c { color: #6f7d78; }

/* --- misc --------------------------------------------------------------- */

.badge-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

.kv {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: 0.06em;
}

.kv b { color: var(--fg); font-weight: 400; }

a.inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

a.inline-link:hover { border-bottom-color: var(--accent); }

/* --- responsive --------------------------------------------------------- */

@media (max-height: 820px) and (min-width: 901px) {
  .home-stage { gap: 24px; padding-block: 24px; }
  .home-logo { width: min(560px, 76vw, 62svh); }
  .prod-card { padding: 16px 16px 14px; gap: 11px; }
  .prod-card .icon { width: 34px; height: 34px; border-radius: 8px; }
  .prod-card .desc { font-size: 12.5px; }
  .prod-card .name { font-size: 12px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .home-nav { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .shots > * { scroll-snap-align: start; }
  .post-item { grid-template-columns: 1fr; gap: 6px; }
  .post-item .arrow { display: none; }
  .brand img { width: 46px; }
  .topbar { padding-block: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
