/* ==========================================================================
   Toolcin — 3D surface design system
   Plain CSS. No frameworks, no webfonts, no third-party requests.
   ========================================================================== */

:root {
  --ink: #05060b;
  --ink-2: #0a0c15;
  --panel: rgba(18, 21, 34, 0.72);
  --panel-solid: #10131f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #eef1f8;
  --muted: #9aa3b8;
  --dim: #6d7488;

  --cyan: #38f2cf;
  --violet: #8b5cff;
  --pink: #ff4d94;
  --amber: #ffd166;

  --grad: linear-gradient(115deg, var(--cyan) 0%, var(--violet) 48%, var(--pink) 100%);
  --grad-soft: linear-gradient(115deg, rgba(56, 242, 207, .18), rgba(139, 92, 255, .18) 48%, rgba(255, 77, 148, .16));

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --shadow-1: 0 2px 6px rgba(0, 0, 0, .45);
  --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, .85);
  --shadow-3: 0 40px 90px -40px rgba(0, 0, 0, .95);

  --shell: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--cyan); color: #051512; padding: 10px 16px; border-radius: 8px;
  font-weight: 700; transition: top .2s var(--ease);
}
.skip:focus { top: 16px; }

/* ============================ backdrop ============================ */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .5;
  transform: translate3d(0, 0, 0);
}
.aurora-a {
  width: 62vw; height: 62vw; left: -14vw; top: -22vw;
  background: radial-gradient(circle at 40% 40%, #21d3b4 0%, transparent 62%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.aurora-b {
  width: 56vw; height: 56vw; right: -16vw; top: -8vw;
  background: radial-gradient(circle at 60% 40%, #6b3dff 0%, transparent 64%);
  animation: drift-b 32s var(--ease) infinite alternate;
}
.aurora-c {
  width: 48vw; height: 48vw; left: 32vw; top: 46vh;
  background: radial-gradient(circle at 50% 50%, #ff2f7d 0%, transparent 66%);
  opacity: .32;
  animation: drift-c 24s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(6vw, 5vw, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-7vw, 6vw, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(-5vw, -6vw, 0) scale(1.16); } }

.grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: -12%;
  height: 62vh;
  background-image:
    linear-gradient(to right, rgba(120, 160, 255, .16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 160, 255, .13) 1px, transparent 1px);
  background-size: 68px 68px;
  transform: perspective(520px) rotateX(72deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, #000 4%, transparent 72%);
  -webkit-mask-image: linear-gradient(to top, #000 4%, transparent 72%);
  opacity: .85;
}

.grain {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================ shell ============================ */
.shell { width: min(100% - 40px, var(--shell)); margin-inline: auto; position: relative; z-index: 1; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(to bottom, rgba(6, 8, 14, .92), rgba(6, 8, 14, .62));
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 22px;
  height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-word {
  font-weight: 800; letter-spacing: .22em; font-size: 15px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-cube { width: 30px; height: 30px; perspective: 260px; display: inline-block; }
.cube-mini {
  position: relative; width: 30px; height: 30px; display: block;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(32deg);
  animation: cube-spin 16s linear infinite;
}
.cube-mini i {
  position: absolute; inset: 0; display: block;
  border: 1px solid rgba(56, 242, 207, .55);
  background: linear-gradient(135deg, rgba(56, 242, 207, .16), rgba(139, 92, 255, .12));
  box-shadow: inset 0 0 18px rgba(56, 242, 207, .14);
}
.cube-mini .f1 { transform: translateZ(15px); }
.cube-mini .f2 { transform: rotateY(180deg) translateZ(15px); }
.cube-mini .f3 { transform: rotateY(90deg) translateZ(15px); }
.cube-mini .f4 { transform: rotateY(-90deg) translateZ(15px); }
.cube-mini .f5 { transform: rotateX(90deg) translateZ(15px); }
.cube-mini .f6 { transform: rotateX(-90deg) translateZ(15px); }
@keyframes cube-spin {
  from { transform: rotateX(-22deg) rotateY(0deg); }
  to   { transform: rotateX(-22deg) rotateY(360deg); }
}

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav-link {
  padding: 9px 14px; border-radius: 999px; font-size: 14.5px; color: var(--muted);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-link:hover, .nav-link:focus-visible { color: var(--text); background: rgba(255, 255, 255, .06); }

.header-search { position: relative; flex: 0 1 260px; }
.header-search input {
  width: 100%; height: 40px; padding: 0 42px 0 14px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.header-search input::placeholder { color: var(--dim); }
.header-search input:focus { border-color: rgba(56, 242, 207, .55); background: rgba(56, 242, 207, .05); }
.header-search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}

/* ============================ hero ============================ */
.hero { padding: 76px 0 44px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 18px;
}
.eyebrow::before {
  content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, var(--cyan), transparent);
}

/* extruded 3D headline */
.display {
  margin: 0; font-size: clamp(44px, 7.4vw, 92px); line-height: .94;
  letter-spacing: -.035em; font-weight: 800; position: relative;
  color: #f6f8ff;
  text-shadow:
    0 1px 0 #a9b4d0,
    0 2px 0 #8d99b8,
    0 3px 0 #737f9d,
    0 4px 0 #5b6782,
    0 5px 0 #46506a,
    0 6px 0 #333c52,
    0 22px 40px rgba(0, 0, 0, .72);
}
.display .accent {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 14px 26px rgba(139, 92, 255, .38));
}
.hero p.lede { color: var(--muted); font-size: 17.5px; max-width: 54ch; margin: 22px 0 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  --btn-bg: rgba(255, 255, 255, .06);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--btn-bg); color: var(--text);
  font-weight: 600; font-size: 14.5px;
  transform-style: preserve-3d;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .9); border-color: rgba(255, 255, 255, .32); }
.btn:active { transform: translateY(0) scale(.99); }
.btn-primary {
  border: 0; color: #04110f;
  background: var(--grad);
  box-shadow: 0 16px 34px -16px rgba(56, 242, 207, .6);
}
.btn-ghost { background: transparent; }

/* hero cube */
.hero-stage { display: grid; place-items: center; min-height: 320px; perspective: 900px; }
.cube-big {
  position: relative; width: 172px; height: 172px;
  transform-style: preserve-3d;
  transform: rotateX(-26deg) rotateY(38deg);
  animation: big-spin 22s linear infinite;
}
.cube-big span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: rgba(232, 240, 255, .82);
  border: 1px solid rgba(56, 242, 207, .38);
  background: linear-gradient(140deg, rgba(56, 242, 207, .13), rgba(139, 92, 255, .1) 55%, rgba(255, 77, 148, .08));
  box-shadow: inset 0 0 44px rgba(56, 242, 207, .12), 0 0 44px rgba(139, 92, 255, .16);
  backdrop-filter: blur(2px);
}
.cube-big .c1 { transform: translateZ(86px); }
.cube-big .c2 { transform: rotateY(180deg) translateZ(86px); }
.cube-big .c3 { transform: rotateY(90deg) translateZ(86px); }
.cube-big .c4 { transform: rotateY(-90deg) translateZ(86px); }
.cube-big .c5 { transform: rotateX(90deg) translateZ(86px); }
.cube-big .c6 { transform: rotateX(-90deg) translateZ(86px); }
@keyframes big-spin {
  from { transform: rotateX(-26deg) rotateY(0deg); }
  to { transform: rotateX(-26deg) rotateY(360deg); }
}
.cube-shadow {
  position: absolute; left: 50%; bottom: 12px; width: 200px; height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(56, 242, 207, .22), transparent 70%);
  filter: blur(12px);
}

/* stats strip */
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.stat-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.stat-chip b { color: var(--text); font-size: 15px; font-weight: 700; }

/* ============================ sections ============================ */
.section { padding: 54px 0; position: relative; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 {
  margin: 0; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.02em;
}
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* ============================ cards ============================ */
.card-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.tool-card {
  position: relative; display: block; padding: 22px 20px 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(24, 28, 44, .86), rgba(12, 15, 25, .92));
  border: 1px solid var(--line);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  isolation: isolate;
}
.tool-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(56, 242, 207, .5), rgba(139, 92, 255, .3) 42%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .2s var(--ease); pointer-events: none;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity .2s var(--ease);
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(56, 242, 207, .14), transparent 62%);
}
.tool-card:hover, .tool-card:focus-visible {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-5px);
  border-color: rgba(255, 255, 255, .2);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(56, 242, 207, .16);
}
.tool-card:hover::before, .tool-card:hover::after,
.tool-card:focus-visible::before, .tool-card:focus-visible::after { opacity: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); opacity: .9;
}
.card-index {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}
.tool-card h3 { margin: 14px 0 6px; font-size: 18.5px; letter-spacing: -.01em; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.card-arrow {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text);
}
.card-arrow svg { transition: transform .18s var(--ease); }
.tool-card:hover .card-arrow svg { transform: translateX(4px); }

/* category tiles */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cat-tile {
  position: relative; padding: 20px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--panel);
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.cat-tile:hover { transform: translateY(-4px) rotateX(4deg); border-color: rgba(56, 242, 207, .4); background: rgba(56, 242, 207, .06); }
.cat-tile h3 { margin: 0 0 4px; font-size: 16.5px; }
.cat-tile span { font-size: 13px; color: var(--muted); }

/* ============================ tool page ============================ */
.page-head { padding: 44px 0 10px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--cyan); }
.crumbs span { opacity: .5; }
.page-head h1 {
  margin: 0; font-size: clamp(32px, 5vw, 52px); letter-spacing: -.03em; line-height: 1.05;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .12), 0 18px 34px rgba(0, 0, 0, .6);
}
.page-head .lede { color: var(--muted); max-width: 68ch; margin: 14px 0 0; font-size: 16.5px; }

.app {
  margin: 26px 0 10px; padding: 26px; border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(24, 28, 44, .9), rgba(9, 11, 19, .95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, .05);
  position: relative; overflow: hidden;
}
.app::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 242, 207, .7), rgba(139, 92, 255, .5), transparent);
}
.app-grid { display: grid; gap: 18px; }
.app-grid.two { grid-template-columns: 1fr 1fr; }

.field { display: grid; gap: 8px; }
.field > label, .field-label {
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-family: var(--mono);
}
textarea, input[type="text"], input[type="number"], input[type="url"], input[type="search"], select {
  width: 100%; padding: 13px 14px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  color: var(--text); outline: none; font-size: 15px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
textarea { resize: vertical; min-height: 150px; font-family: var(--mono); font-size: 14px; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(56, 242, 207, .55);
  box-shadow: 0 0 0 3px rgba(56, 242, 207, .12);
  background: rgba(56, 242, 207, .04);
}
input[type="file"] {
  padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .02); cursor: pointer; width: 100%;
}
input[type="range"] { width: 100%; accent-color: var(--cyan); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--cyan); width: 16px; height: 16px; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.hint { font-size: 13px; color: var(--dim); margin: 0; }
.error { color: #ff7d92; font-size: 13.5px; margin: 8px 0 0; }
.ok { color: var(--cyan); font-size: 13.5px; margin: 8px 0 0; }

.metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.metric {
  padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.metric b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric span { font-size: 12px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.output {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
  background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 14px; max-height: 380px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  margin: 0;
}
.diff-line { display: block; padding: 1px 8px; border-radius: 4px; }
.diff-add { background: rgba(56, 242, 207, .12); color: #b9ffee; }
.diff-del { background: rgba(255, 77, 148, .12); color: #ffc2d6; }

.preview-wrap {
  display: grid; place-items: center; padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background:
    linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%) 0 0/22px 22px,
    linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%) 11px 11px/22px 22px,
    rgba(0, 0, 0, .3);
  min-height: 160px;
}
.preview-wrap img, .preview-wrap canvas { max-height: 320px; border-radius: 6px; }

.prose { max-width: 74ch; }
.prose h2 { font-size: 23px; margin: 34px 0 10px; letter-spacing: -.02em; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--muted); font-size: 15.5px; }
.prose a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(255, 255, 255, .025); padding: 0 18px;
}
.faq summary {
  cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 15.5px; list-style: none;
  display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--cyan); font-family: var(--mono); font-size: 18px; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }

/* ============================ footer ============================ */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: rgba(5, 6, 11, .7); position: relative; z-index: 1; }
.foot-grid { display: grid; gap: 34px; grid-template-columns: 1.6fr 1fr 1fr 1fr; padding: 44px 0 30px; }
.foot-brand p { color: var(--muted); font-size: 14px; margin: 10px 0 0; max-width: 34ch; }
.foot-note { color: var(--dim) !important; font-size: 12.5px !important; }
.foot-col h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 12px; font-family: var(--mono); }
.foot-col a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.foot-col a:hover { color: var(--cyan); }
.foot-bottom {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 18px 0 30px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 12.5px;
}

/* ============================ toast ============================ */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #0c1018; border: 1px solid rgba(56, 242, 207, .4); color: var(--text);
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .9);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================ responsive ============================ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stage { min-height: 240px; order: -1; }
  .cube-big { width: 132px; height: 132px; }
  .cube-big .c1 { transform: translateZ(66px); }
  .cube-big .c2 { transform: rotateY(180deg) translateZ(66px); }
  .cube-big .c3 { transform: rotateY(90deg) translateZ(66px); }
  .cube-big .c4 { transform: rotateY(-90deg) translateZ(66px); }
  .cube-big .c5 { transform: rotateX(90deg) translateZ(66px); }
  .cube-big .c6 { transform: rotateX(-90deg) translateZ(66px); }
  .nav { display: none; }
  .header-search { flex: 1 1 auto; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app-grid.two { grid-template-columns: 1fr; }
  .app { padding: 18px; border-radius: var(--r-lg); }
  .display { font-size: clamp(38px, 12vw, 58px); }
  .hero { padding-top: 40px; }
  /* Two-row header on phones: brand / Home / Theme / Analytics on row 1,
     the search field full width on row 2. Keeps the search usable instead
     of squeezing it to a sliver between the buttons. */
  .header-inner { height: auto; padding: 10px 0; gap: 10px; flex-wrap: wrap; row-gap: 9px; }
  .header-search { order: 3; flex: 1 1 100%; }
  .header-search kbd { display: none; }
  /* icon-only on phones so brand + Home + both menus fit on one row.
     Scoped to .header-inner to outrank hero.css, which loads after this file. */
  .header-inner .theme-btn span { display: none; }
  .header-inner .theme-btn { padding: 0 10px; gap: 0; }
  .brand-word { font-size: 13px; letter-spacing: .16em; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .section { padding: 40px 0; }
}

/* ============================ motion & focus ============================ */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

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

@media print {
  .backdrop, .site-header, .site-footer, .toast, .hero-stage { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   THEMES — midnight (default), daylight (light), neon
   ========================================================================== */
html[data-theme="light"] {
  --ink: #f2f4fa;
  --ink-2: #e9edf6;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(16, 24, 40, 0.12);
  --line-strong: rgba(16, 24, 40, 0.2);
  --text: #0f1422;
  --muted: #4c5568;
  --dim: #737d92;
  --cyan: #08a98c;
  --violet: #6b3df5;
  --pink: #dd2f6e;
  --amber: #c98a00;
  --grad: linear-gradient(115deg, #08a98c 0%, #6b3df5 48%, #dd2f6e 100%);
  --shadow-2: 0 18px 40px -22px rgba(18, 28, 60, .45);
  --shadow-3: 0 40px 90px -46px rgba(18, 28, 60, .5);
}
html[data-theme="neon"] {
  --ink: #05010c;
  --ink-2: #0b0418;
  --cyan: #00f5ff;
  --violet: #ff2fb3;
  --pink: #b6ff2e;
  --grad: linear-gradient(115deg, #00f5ff 0%, #ff2fb3 52%, #b6ff2e 100%);
}

html[data-theme="light"] body { background: var(--ink); }
html[data-theme="light"] .backdrop .aurora { opacity: .26; filter: blur(110px); }
html[data-theme="light"] .grid-floor {
  background-image:
    linear-gradient(to right, rgba(40, 70, 130, .16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(40, 70, 130, .12) 1px, transparent 1px);
}
html[data-theme="light"] .grain { opacity: .035; }
html[data-theme="light"] .site-header {
  background: linear-gradient(to bottom, rgba(250, 251, 255, .95), rgba(250, 251, 255, .72));
}
html[data-theme="light"] .header-search input,
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link:focus-visible { background: rgba(16, 24, 40, .06); }
html[data-theme="light"] .display { color: #10162a; text-shadow: 0 1px 0 #c8d2e6, 0 2px 0 #b9c4dc, 0 3px 0 #a9b5d0, 0 4px 0 #98a5c2, 0 5px 0 #8794b3, 0 6px 0 #77849f, 0 22px 40px rgba(30, 45, 80, .28); }
html[data-theme="light"] .tool-card {
  background: linear-gradient(160deg, #ffffff, #f4f7ff);
  border-color: rgba(16, 24, 40, .1);
}
html[data-theme="light"] .tool-card:hover { border-color: rgba(16, 24, 40, .22); box-shadow: var(--shadow-3), 0 0 0 1px rgba(8, 169, 140, .2); }
html[data-theme="light"] .cat-tile,
html[data-theme="light"] .app,
html[data-theme="light"] .metric,
html[data-theme="light"] .faq details { background: rgba(255, 255, 255, .9); }
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] select { background: #ffffff; border-color: rgba(16, 24, 40, .16); }
html[data-theme="light"] .output { background: #f6f8fd; color: #16203a; }
html[data-theme="light"] .preview-wrap { background-color: #eef2fa; }
html[data-theme="light"] .site-footer { background: rgba(255, 255, 255, .7); }
html[data-theme="light"] .toast { background: #ffffff; color: #10162a; }

/* theme switcher */
.theme-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.theme-switch button {
  width: 28px; height: 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; display: grid; place-items: center; padding: 0;
  transition: background .15s var(--ease), transform .15s var(--ease);
}
.theme-switch button span { width: 14px; height: 14px; border-radius: 999px; display: block; border: 1px solid rgba(0,0,0,.25); }
.theme-switch button[data-theme-value="dark"] span { background: linear-gradient(140deg,#101828,#38f2cf); }
.theme-switch button[data-theme-value="light"] span { background: linear-gradient(140deg,#ffffff,#ffd166); }
.theme-switch button[data-theme-value="neon"] span { background: linear-gradient(140deg,#00f5ff,#ff2fb3); }
.theme-switch button[aria-pressed="true"] { background: rgba(255,255,255,.12); transform: scale(1.06); }
html[data-theme="light"] .theme-switch { background: rgba(16,24,40,.05); }
html[data-theme="light"] .theme-switch button[aria-pressed="true"] { background: rgba(16,24,40,.12); }

/* ==========================================================================
   3D POLISH — depth, sheen, reflection, category cards
   ========================================================================== */
.hero-stage { position: relative; }
.hero-stage::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 230px; height: 46px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(56,242,207,.28), rgba(139,92,255,.16) 45%, transparent 72%);
  filter: blur(14px);
}
.cube-big span { box-shadow: inset 0 0 60px rgba(56,242,207,.16), inset 0 1px 0 rgba(255,255,255,.25), 0 0 50px rgba(139,92,255,.18); }
.cube-big span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 42%, rgba(255,255,255,.06));
  opacity: .8;
}
.hero { perspective: 1200px; }
.hero-grid > div:first-child { transform-style: preserve-3d; }

.tool-card { box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,.06); }
.tool-card::after { background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(56,242,207,.18), transparent 62%); }
.tool-card:hover { box-shadow: 0 34px 70px -34px rgba(0,0,0,.95), 0 0 0 1px rgba(56,242,207,.18), inset 0 1px 0 rgba(255,255,255,.1); }
.tool-card h3 { text-shadow: 0 1px 0 rgba(0,0,0,.35); }
html[data-theme="light"] .tool-card h3 { text-shadow: none; }

/* category cards */
.cat-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border-radius: var(--r-lg);
  background: linear-gradient(155deg, rgba(26,30,48,.9), rgba(12,15,25,.94));
  border: 1px solid var(--line);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.cat-card::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 3px;
  background: var(--cat, var(--grad)); opacity: .9;
}
.cat-card:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); border-color: rgba(255,255,255,.22); box-shadow: var(--shadow-3); }
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--cat-soft, rgba(56,242,207,.12)); color: var(--cat, var(--cyan));
  border: 1px solid rgba(255,255,255,.08);
}
.cat-card h3 { margin: 0; font-size: 18px; }
.cat-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.cat-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
html[data-theme="light"] .cat-card { background: linear-gradient(155deg,#ffffff,#f4f7ff); }

@media (prefers-reduced-motion: reduce) {
  .cat-card, .tool-card { transform: none !important; }
}

/* category accent colours (no inline styles — CSP safe) */
.cat-card.cat-text { --cat: #38f2cf; --cat-soft: rgba(56,242,207,.14); }
.cat-card.cat-developer { --cat: #8b5cff; --cat-soft: rgba(139,92,255,.16); }
.cat-card.cat-image { --cat: #ff4d94; --cat-soft: rgba(255,77,148,.14); }
.cat-card.cat-generator { --cat: #ffd166; --cat-soft: rgba(255,209,102,.16); }
.cat-card.cat-calculator { --cat: #5ee7a0; --cat-soft: rgba(94,231,160,.15); }
.cat-card.cat-seo { --cat: #7bd3ff; --cat-soft: rgba(123,211,255,.15); }
html[data-theme="light"] .cat-card.cat-text { --cat: #0b8f78; }
html[data-theme="light"] .cat-card.cat-developer { --cat: #5b33d6; }
html[data-theme="light"] .cat-card.cat-image { --cat: #c31f63; }
html[data-theme="light"] .cat-card.cat-generator { --cat: #9a6a00; }
html[data-theme="light"] .cat-card.cat-calculator { --cat: #10773f; }
html[data-theme="light"] .cat-card.cat-seo { --cat: #0f6c96; }

.prose-narrow { max-width: 74ch; }

/* top-level Home button — visible on every screen size, unlike .nav which hides under 980px */
.home-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: .01em;
  text-decoration: none; flex: 0 0 auto; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.home-btn:hover, .home-btn:focus-visible {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(56, 242, 207, .45);
  transform: translateY(-1px);
}
html[data-theme="light"] .home-btn { background: rgba(16, 24, 40, .03); }
html[data-theme="light"] .home-btn:hover,
html[data-theme="light"] .home-btn:focus-visible { background: rgba(16, 24, 40, .07); }
@media (max-width: 420px) {
  .home-btn span { display: none; }
  .home-btn { padding: 8px 10px; }
}
@media (max-width: 380px) {
  /* narrowest phones: drop the wordmark, the cube still links home */
  .brand-word { display: none; }
}
@media print { .home-btn { display: none; } }
