/* ============================================================
   KwynTech Design System — kwyn.css
   Global shared styles for kwyntech.ai
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700;800;900&family=Share+Tech+Mono&family=Montserrat:wght@400;600;700;800;900&display=swap');

:root {
  /* Core palette */
  --bg:       #080c12;
  --panel:    #0c1118;
  --surface:  #0f141b;
  --surface2: #131920;

  /* Arcade (green) — consumer / games */
  --green:    #00ff88;
  --green-dim:rgba(0,255,136,0.10);
  --green-border:rgba(0,255,136,0.14);

  /* Infra (blue) — enterprise / platform */
  --blue:     #3b82f6;
  --blue-dim: rgba(59,130,246,0.10);
  --blue-border:rgba(59,130,246,0.18);

  /* Gold — Mission Control / Bond */
  --gold:     #c9a227;
  --gold-dim: rgba(201,162,39,0.12);

  /* Type */
  --text:     #e2e8f0;
  --muted:    #64748b;
  --muted2:   #94a3b8;
  --ink:      #06080c;

  /* Typography */
  --font-hud: 'Orbitron', sans-serif;
  --font-mono:'Share Tech Mono', monospace;
  --font-head:'Montserrat', sans-serif;

  /* Misc */
  --radius:   8px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Grid background ── */
.kwyn-grid::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; z-index: 0;
}

/* ── Fractal paisley veil (autoENGRAVER) ── */
.kwyn-grid::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 245, 255, 0.12) 0 2px, transparent 2px 28px),
    radial-gradient(circle at 18% 24%, rgba(0, 255, 136, 0.11) 0 1.8px, transparent 1.8px 22px),
    radial-gradient(120px 80px at 20% 28%, rgba(123, 47, 255, 0.16) 0 18%, transparent 36%),
    radial-gradient(90px 62px at 21% 28%, rgba(0, 245, 255, 0.1) 0 22%, transparent 44%);
  background-size: 210px 210px, 210px 210px, 420px 420px, 420px 420px;
  background-position: 0 0, 36px 20px, -30px -16px, 12px 12px;
  mix-blend-mode: screen;
  animation: kwyn-paisley-drift 38s linear infinite;
}

@keyframes kwyn-paisley-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-12px, 8px, 0) scale(1.01); }
  100% { transform: translate3d(-24px, 0, 0) scale(1); }
}

/* ── Shared nav strip ── */
.kwyn-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 2rem;
  background: rgba(8,12,18,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--green-border);
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.1em;
}
.kwyn-nav .brand {
  font-family: var(--font-hud);
  font-weight: 800; font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--green); text-decoration: none;
}
.kwyn-nav .brand img { height: 26px; width: auto; vertical-align: middle; margin-right: 0.5rem; }
.kwyn-nav-links { display: flex; gap: 1.5rem; list-style: none; }
.kwyn-nav-links a { color: var(--muted); text-decoration: none; transition: color var(--transition); }
.kwyn-nav-links a:hover { color: var(--green); }
.kwyn-nav-btn {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; background: var(--green); color: var(--ink);
  border: none; padding: 0.5rem 1.2rem; text-decoration: none;
  font-weight: 700; transition: opacity var(--transition), transform var(--transition); cursor: pointer;
}
.kwyn-nav-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Reciprocal strip (bottom) ── */
#kwynos-reciprocal {
  background: rgba(12,17,24,0.95);
  border-top: 1px solid var(--green-border);
  padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  margin-top: 2.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.06em;
}
#kwynos-reciprocal .kwynos-wrap {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.45rem 0.55rem; max-width: 980px; margin: 0 auto;
}
#kwynos-reciprocal a {
  color: var(--muted2); text-decoration: none;
  border: 1px solid var(--green-border);
  background: rgba(0,255,136,0.06);
  padding: 0.3rem 0.52rem;
  border-radius: 4px;
  line-height: 1.3;
}
#kwynos-reciprocal a:hover { color: var(--green); border-color: rgba(0,255,136,0.32); }

/* ── Page wrapper ── */
.kwyn-page {
  max-width: 680px; margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
  position: relative; z-index: 1;
}
.kwyn-page-wide {
  max-width: 1120px; margin: 0 auto;
  padding: 6.5rem 2rem 3.5rem;
  position: relative; z-index: 1;
}

/* ── Typography ── */
.kwyn-h1 {
  font-family: var(--font-hud);
  font-weight: 900; letter-spacing: 0.06em;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--green);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 0.5rem;
}
.kwyn-h2 {
  font-family: var(--font-hud);
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--green);
  margin-top: 2rem; margin-bottom: 0.6rem;
  border-bottom: 2px solid var(--green-border);
  padding-bottom: 0.35rem;
}
.kwyn-sub {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.5rem;
}
.kwyn-label {
  font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.4rem;
}
p.kwyn-body { color: var(--muted2); margin-bottom: 1rem; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cards / Panels ── */
.kwyn-card {
  background: var(--panel);
  border: 2px solid var(--green-border);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--transition);
}
.kwyn-card:hover { border-color: rgba(0,255,136,0.3); }

.kwyn-tile {
  display: block;
  background: var(--panel);
  border: 2px solid var(--green-border);
  padding: 1rem 1.25rem;
  text-decoration: none; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.kwyn-tile:hover {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(0,255,136,0.1);
  text-decoration: none;
}

/* Rendering optimization for long pages */
.kwyn-card,
.kwyn-tile {
  content-visibility: auto;
  contain-intrinsic-size: 1px 220px;
}
.kwyn-tile .name { font-family: var(--font-hud); color: var(--green); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; }
.kwyn-tile .hint { font-size: 0.65rem; color: var(--muted); margin-top: 0.2rem; }

.kwyn-highlight {
  background: var(--panel);
  border-left: 3px solid var(--green);
  border: 2px solid var(--green-border);
  border-left: 3px solid var(--green);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.kwyn-highlight p { color: var(--text); margin: 0; }

/* ── Buttons ── */
.kwyn-btn {
  display: inline-block;
  font-family: var(--font-hud); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); background: var(--green);
  border: 2px solid var(--ink);
  padding: 0.7rem 1.5rem;
  text-decoration: none; cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.kwyn-btn:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none; }
.kwyn-btn-ghost {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--green-border);
  padding: 0.7rem 1.5rem; text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.kwyn-btn-ghost:hover { border-color: var(--green); color: var(--green); text-decoration: none; }

/* Touch-friendly target sizing baseline */
.kwyn-btn,
.kwyn-btn-ghost,
.kwyn-nav-btn,
.kwyn-tile,
#kwynos-reciprocal a {
  min-height: 44px;
}

/* ── Action rows ── */
.kwyn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

/* ── Promise ladder ── */
.kwyn-promise {
  margin: 0.35rem 0 1rem;
  font-family: var(--font-hud);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--green);
}
.kwyn-ladder {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 0.7rem;
}
.kwyn-step {
  border: 1px solid var(--green-border);
  background: rgba(4, 10, 16, 0.88);
  padding: 0.62rem 0.7rem;
}
.kwyn-step .k {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}
.kwyn-step .v {
  font-size: 0.72rem;
  color: var(--muted2);
}

/* ── Status dot ── */
.kwyn-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--green);
  animation: kwyn-blink 2s ease-in-out infinite;
}
@keyframes kwyn-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Arcade nav bar ── */
.arcade-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0; margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--green-border);
  font-size: 0.62rem; letter-spacing: 0.12em;
}
.arcade-nav a { color: var(--muted); text-decoration: none; }
.arcade-nav a:hover { color: var(--green); }
.arcade-nav .brand {
  font-family: var(--font-hud); font-weight: 800;
  color: var(--green); font-size: 0.78rem;
}

/* ── Forms ── */
.kwyn-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.kwyn-field label { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kwyn-field input,
.kwyn-field textarea,
.kwyn-field select {
  background: var(--panel);
  border: 2px solid var(--green-border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.kwyn-field input:focus,
.kwyn-field textarea:focus,
.kwyn-field select:focus { border-color: var(--green); }
.kwyn-field textarea { min-height: 80px; resize: vertical; }

/* ── Footer bar ── */
.kwyn-footer {
  border-top: 1px solid var(--green-border);
  background: var(--panel);
  padding: 1.25rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  align-items: center;
  gap: 0.8rem 1.2rem;
  font-size: 0.65rem; letter-spacing: 0.08em; color: var(--muted);
  position: relative; z-index: 1;
}
.kwyn-footer a { color: var(--muted); text-decoration: none; }
.kwyn-footer a:hover { color: var(--green); }
.kwyn-footer .brand { font-family: var(--font-hud); font-weight: 800; color: var(--green); font-size: 0.8rem; grid-column: 1; grid-row: 1; }
.kwyn-footer > span:not(.brand) {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.4rem 0.6rem;
  line-height: 1.5;
}
.kwyn-footer-legal {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.55rem;
  padding-top: 0.65rem;
  margin-top: 0.15rem;
  border-top: 1px solid var(--green-border);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kwyn-footer-legal a { color: var(--muted2); }
.kwyn-footer-legal a:hover { color: var(--green); }
.kwyn-legal-sep { opacity: 0.45; user-select: none; }
.kwyn-tm-strip {
  grid-column: 1 / -1;
  grid-row: 3;
  font-size: 0.5rem;
  line-height: 1.45;
  color: var(--muted2);
  text-align: center;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0.25rem 0.25rem 0;
  opacity: 0.88;
}

/* ── Animations ── */
@keyframes kwyn-fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kwyn-fadein { opacity: 0; animation: kwyn-fadeUp 0.7s ease forwards; }
.kwyn-fadein-1 { animation-delay: 0.1s; }
.kwyn-fadein-2 { animation-delay: 0.2s; }
.kwyn-fadein-3 { animation-delay: 0.35s; }
.kwyn-fadein-4 { animation-delay: 0.5s; }

.kwyn-reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.kwyn-reveal.visible { opacity: 1; transform: none; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .kwyn-nav { padding: 0.7rem 1rem; }
  .kwyn-nav-links { display: none; }
  .kwyn-page, .kwyn-page-wide { padding: 5rem 1rem 2rem; }
  .kwyn-card { padding: 0.95rem 0.95rem; }
  .kwyn-tile { padding: 0.78rem 0.88rem; }
  .kwyn-h1 { line-height: 1.08; margin-bottom: 0.35rem; }
  .kwyn-sub { font-size: 0.62rem; letter-spacing: 0.14em; margin-bottom: 1rem; }
  .kwyn-body, p.kwyn-body { font-size: 0.84rem; line-height: 1.5; }
  .kwyn-label { letter-spacing: 0.16em; }
  .kwyn-tile .name { font-size: 0.71rem; }
  .kwyn-tile .hint { font-size: 0.6rem; line-height: 1.35; }
  .kwyn-actions { gap: 0.55rem; }
  .kwyn-btn, .kwyn-btn-ghost { width: 100%; text-align: center; }
  .kwyn-promise { font-size: 0.72rem; margin-bottom: 0.7rem; }
  .kwyn-step .k { font-size: 0.5rem; }
  .kwyn-step .v { font-size: 0.66rem; }
  .kwyn-footer {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    text-align: center;
    padding: 1rem;
  }
  .kwyn-footer .brand { grid-column: 1; grid-row: 1; justify-self: center; }
  .kwyn-footer > span:not(.brand) { grid-column: 1; grid-row: 2; justify-self: center; justify-content: center; }
  .kwyn-footer-legal { grid-row: 3; }
  .kwyn-tm-strip { grid-row: 4; }
  #kwynos-reciprocal {
    padding: 0.75rem 0.7rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.74rem;
  }
  #kwynos-reciprocal .kwynos-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    max-width: 100%;
  }
  #kwynos-reciprocal a {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.42rem 0.4rem;
  }
}
@media (max-width: 420px) {
  .kwyn-page, .kwyn-page-wide { padding: 4.65rem 0.78rem 1.6rem; }
  .kwyn-card { padding: 0.82rem 0.78rem; }
  .kwyn-tile { padding: 0.72rem 0.74rem; }
  .kwyn-h1 { font-size: clamp(1.08rem, 8vw, 1.38rem); }
  .kwyn-sub { font-size: 0.56rem; letter-spacing: 0.1em; }
  .kwyn-btn, .kwyn-btn-ghost { padding: 0.64rem 0.72rem; font-size: 0.66rem; }
  #kwynos-reciprocal .kwynos-wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .kwyn-grid::after { animation: none; opacity: 0.12; display: none; }
  .kwyn-grid::before { opacity: 0.55; }
  .kwyn-card:hover,
  .kwyn-tile:hover { box-shadow: none; }
  .kwyn-btn:hover { transform: none; }
}
