/* ============================================================
   THOT TECHNOLOGIES — "We Make Magic"
   Iridescent prismatic geometry on near-black.
   ============================================================ */

:root {
  /* --- surfaces (near-black, subtly cool) --- */
  --bg:        #06070c;
  --bg-2:      #090b13;
  --bg-3:      #0d1020;
  --hairline:  rgba(180, 205, 255, 0.10);
  --hairline-2:rgba(180, 205, 255, 0.05);
  --surface:   rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.045);

  /* --- ink --- */
  --ink:       #eaf0fb;
  --ink-soft:  #b9c2d6;
  --muted:     #717d96;
  --faint:     #4a5468;

  /* --- prismatic accents (cyan/teal primary, drifting through azure + violet) --- */
  --accent:    #3fe9df;   /* electric teal */
  --accent-2:  #56a8ff;   /* azure */
  --accent-3:  #9b7bff;   /* violet */
  --accent-ink:#0a1418;

  --accent-glow: rgba(63, 233, 223, 0.55);

  /* --- type --- */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  /* --- measure --- */
  --maxw: 1240px;
  --gut:  clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Iridescent ambient wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -2;
  background:
    radial-gradient(40vmax 40vmax at 78% 8%,  rgba(63,233,223,0.10), transparent 60%),
    radial-gradient(46vmax 46vmax at 12% 88%, rgba(155,123,255,0.09), transparent 62%),
    radial-gradient(50vmax 40vmax at 90% 95%, rgba(86,168,255,0.07), transparent 60%);
  filter: blur(8px);
  animation: drift 38s var(--ease) infinite alternate;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-3%, 2%, 0) scale(1.08); }
}

/* faint engineering grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--hairline-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline-2) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(120vmax 100vmax at 50% 20%, #000 30%, transparent 90%);
          mask-image: radial-gradient(120vmax 100vmax at 50% 20%, #000 30%, transparent 90%);
  pointer-events: none;
}

::selection { background: rgba(63,233,223,0.28); color: #fff; }

a { color: inherit; text-decoration: none; }
canvas { display: block; }
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
  background: rgba(63,233,223,0.08);
  border: 1px solid var(--hairline-2);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.prism {
  background: linear-gradient(96deg, var(--accent) 0%, var(--accent-2) 45%, var(--accent-3) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: prism-shift 9s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .prism { animation: none; } }
@keyframes prism-shift { to { background-position: 220% 0; } }

/* ---------------------------------------------------------- nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gut);
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6,7,12,0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: 0.16em; font-size: 15px; }
.brand canvas { width: 30px; height: 30px; }
.brand .tld { color: var(--muted); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 8px;
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-cta {
  border: 1px solid var(--hairline) !important;
  color: var(--accent) !important;
}
.nav-cta:hover { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent-glow), 0 0 24px -8px var(--accent-glow); }
.nav-burger { display: none; }

/* ---------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding-top: 96px;
  padding-bottom: 40px;
}
.hero-copy { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(44px, 8.2vw, 116px);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 22px 0 0;
}
.hero h1 .we { display: block; }
.hero h1 .make { display: block; }

/* --- the word-cube: an oblique Rubik's cube. Front face is a flat,
   readable 3×3 grid (Thot / Makes / Magic); the right + bottom faces
   fan back into depth as dim 3×3 grids. --- */
.hero h1.cube-h { margin: 8px 0 4px; perspective: 1700px; line-height: 1; }
.cube {
  --S: clamp(186px, 22vw, 290px);   /* face size */
  --D: 0.52;                        /* depth as a fraction of S */
  display: block;
  position: relative;
  width: var(--S);
  height: var(--S);
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(-26deg);
  filter: drop-shadow(0 34px 46px rgba(0,0,0,0.6));
}
.cube .face {
  position: absolute;
  inset: 0;
  width: var(--S);
  height: var(--S);
  transform-style: preserve-3d;
}
.cube .front  { transform: translateZ(calc(var(--S) * var(--D) / 2)); }
.cube .right  { transform: rotateY(90deg)  translateZ(calc(var(--S) * var(--D) / 2)); width: calc(var(--S) * var(--D)); left: calc(var(--S) - var(--S) * var(--D)); }
.cube .bottom { transform: rotateX(-90deg) translateZ(calc(var(--S) * var(--D) / 2)); height: calc(var(--S) * var(--D)); top: calc(var(--S) - var(--S) * var(--D)); }

.cube .grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: calc(var(--S) * 0.03);
  padding: calc(var(--S) * 0.03);
  border-radius: calc(var(--S) * 0.02);
}
.cube .front .grid { background: linear-gradient(135deg, #0a0e1c, #06070d); border: 1px solid var(--hairline); }
.cube .right .grid, .cube .bottom .grid { background: rgba(8,11,20,0.5); border: 1px solid rgba(150,185,230,0.16); }

.cube .grid i {
  border-radius: calc(var(--S) * 0.028);
  background: radial-gradient(125% 125% at 30% 22%, rgba(63,233,223,0.12), rgba(86,168,255,0.05) 58%, rgba(155,123,255,0.03) 100%);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), inset 0 0 16px rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  font-size: calc(var(--S) * 0.132);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
  font-style: normal;
}
/* receding faces: dim, empty cells */
.cube .right .grid i, .cube .bottom .grid i {
  background: rgba(255,255,255,0.015);
  border-color: rgba(150,185,230,0.2);
  box-shadow: inset 0 0 12px rgba(0,0,0,0.45);
  filter: brightness(0.7);
}
.hero-sub {
  margin: 28px 0 0;
  max-width: 30ch;
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--ink-soft);
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 48px;
  display: flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  flex-wrap: wrap;
}
.hero-meta b { color: var(--ink); font-weight: 700; display: block; font-size: 15px; letter-spacing: 0; margin-bottom: 3px; }

.hero-stage {
  position: relative;
  align-self: stretch;
  min-height: 60svh;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-stage .readout {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.hero-stage .readout b { color: var(--accent); font-weight: 400; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  color: var(--ink);
  transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
  cursor: pointer;
  background: var(--surface);
}
.btn:hover { transform: translateY(-2px); border-color: var(--hairline); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary {
  background: linear-gradient(96deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 14px 40px -12px var(--accent-glow); }

/* ---------------------------------------------------------- sections */
section { position: relative; }
.section { padding-block: clamp(80px, 12vh, 150px); }
.section-head { max-width: 56ch; margin-bottom: clamp(40px, 6vh, 72px); }
.section-head h2 {
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 18px 0 0;
}
.section-head p { margin: 20px 0 0; color: var(--ink-soft); font-size: clamp(15px, 1.4vw, 18px); max-width: 50ch; }

.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--hairline), transparent); border: 0; margin: 0; }

/* ---------------------------------------------------------- magic console */
.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 22px;
  overflow: hidden;
  isolation: isolate;
}
.panel::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(63,233,223,0.08), transparent 60%);
  z-index: -1;
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.phi-readout { margin-top: 18px; font-family: var(--font-mono); }
.phi-big {
  font-size: clamp(15px, 1.5vw, 19px);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  display: block;
  white-space: nowrap;
}
.phi-big .sym { color: var(--accent); margin-right: 6px; }
.phi-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline-2); font-size: 12.5px; }
.phi-row span:first-child { color: var(--muted); letter-spacing: 0.05em; }
.phi-row span:last-child { color: var(--ink-soft); }
.phi-row b { color: var(--accent); font-weight: 400; }
.phi-note { margin-top: 16px; font-size: 11px; color: var(--faint); line-height: 1.6; }

.canvas-host { position: relative; aspect-ratio: 1 / 1; margin-top: 16px; border-radius: 12px; overflow: hidden; background: #04050a; border: 1px solid var(--hairline-2); }
.canvas-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.canvas-host .tag {
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--ink-soft); text-shadow: 0 1px 6px #000;
  pointer-events: none;
}
.canvas-host .tag b { color: var(--accent); font-weight: 400; }

/* ---------------------------------------------------------- products */
.products { display: grid; gap: 18px; }
.product {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  transition: border-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.product:hover { border-color: rgba(63,233,223,0.4); transform: translateY(-3px); box-shadow: 0 30px 80px -50px var(--accent-glow); }
.product .glyph { width: 64px; height: 64px; }
.product h3 { font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product .ver { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--hairline); padding: 3px 8px; border-radius: 6px; letter-spacing: 0.08em; }
.product .lead { color: var(--accent); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; margin: 14px 0 0; }
.product p { color: var(--ink-soft); margin: 12px 0 0; max-width: 56ch; font-size: 15.5px; }
.product .feats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.product .feats span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); border: 1px solid var(--hairline); border-radius: 999px; padding: 6px 12px; letter-spacing: 0.04em; }
.product .go {
  align-self: center;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--hairline);
  display: grid; place-items: center;
  color: var(--accent);
  transition: background .3s, transform .3s var(--ease);
}
.product:hover .go { background: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
a.product { cursor: pointer; }
.product .more {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}
.product .more span { transition: transform .25s var(--ease); }
.product:hover .more span { transform: translateX(4px); }

/* ---------------------------------------------------------- about */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 90px); align-items: start; }
.tenets { display: grid; gap: 2px; }
.tenet { padding: 24px 0; border-top: 1px solid var(--hairline); }
.tenet:last-child { border-bottom: 1px solid var(--hairline); }
.tenet h4 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; display: flex; gap: 14px; align-items: baseline; }
.tenet h4 .n { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.tenet p { margin: 10px 0 0 38px; color: var(--ink-soft); font-size: 15px; }
.about-lead { font-size: clamp(20px, 2.4vw, 30px); line-height: 1.4; font-weight: 400; letter-spacing: -0.01em; }
.about-lead .prism { font-weight: 500; }
.about-body { color: var(--ink-soft); margin-top: 22px; font-size: 16px; line-height: 1.7; max-width: 46ch; }
.about-body + .about-body { margin-top: 16px; }

/* ---------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--hairline); padding-block: 64px 40px; position: relative; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; font-weight: 400; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--ink-soft); font-size: 14px; transition: color .2s; }
.footer ul a:hover { color: var(--accent); }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 34ch; margin: 16px 0 0; line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--hairline-2); font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.06em; flex-wrap: wrap; gap: 12px; }
.footer-bottom .prism-line { color: var(--muted); }

/* ---------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------------------------------------------------------- contact */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 88px); align-items: start; }
.contact-intro h2 { font-size: clamp(30px, 4.4vw, 54px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.02; margin: 18px 0 0; }
.contact-intro p { color: var(--ink-soft); margin: 20px 0 0; font-size: clamp(15px, 1.4vw, 18px); max-width: 42ch; }
.contact-meta { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 0; }
.contact-meta li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-top: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 12.5px; }
.contact-meta li:last-child { border-bottom: 1px solid var(--hairline); }
.contact-meta span { color: var(--muted); letter-spacing: 0.06em; }
.contact-meta b { color: var(--ink); font-weight: 400; }
.contact-meta a { color: var(--accent); }
.contact-meta a:hover { text-decoration: underline; }

.contact-form {
  display: grid;
  gap: 18px;
  padding: clamp(26px, 3.5vw, 40px);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
}
.contact-form .field { display: grid; gap: 8px; }
.contact-form label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink);
  background: rgba(4,5,10,0.6);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 13px 14px;
  transition: border-color .25s, box-shadow .25s, background .25s;
  -webkit-appearance: none;
  appearance: none;
}
.contact-form textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.contact-form select {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 14px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
  cursor: pointer;
}
.contact-form select option { background: #0b0e18; color: var(--ink); }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--faint); }
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 0 26px -10px var(--accent-glow);
  background: rgba(4,5,10,0.85);
}
.contact-form input:user-invalid,
.contact-form textarea:user-invalid { border-color: rgba(255,120,120,0.55); }
.contact-form .btn-primary { justify-self: start; margin-top: 4px; }
.contact-form .form-status { margin: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); min-height: 1em; letter-spacing: 0.04em; }
.contact-form.sent { border-color: rgba(63,233,223,0.4); }

/* ---------------------------------------------------------- responsive */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 110px; min-height: auto; }
  .hero-stage { order: -1; min-height: 46svh; margin-bottom: 8px; }
  .console-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .product { grid-template-columns: 52px 1fr; }
  .product .glyph { width: 52px; height: 52px; }
  .product .go { display: none; }
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .cube { transform: rotateX(-18deg) rotateY(-23deg); }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .hero-meta { gap: 22px; }
}
