/* ============================================================
   Selfie Proxy — marketing site
   Design system: bright workbench energy for homelab hobbyists.
   Display: Space Grotesk · Body: IBM Plex Sans · Utility: IBM Plex Mono
   ============================================================ */

:root {
  --bg: #fffdfa;
  --surface: #ffffff;
  --surface-alt: #fbf2e8;
  --line: #ecdfcd;
  --line-strong: #ddc9ab;
  --text: #1c140c;
  --text-dim: #6b5c49;
  --text-faint: #97876f;

  --accent: #ff5a1f;
  --accent-text: #c23e0a;
  --accent-soft: #ffe8db;
  --accent-ink: #1c0f06;

  --blue: #3454ff;
  --blue-soft: #e3e7ff;

  --gold: #b85e08;
  --gold-soft: #fdecc8;

  --signal-green: #16a34a;
  --signal-red: #dc2626;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(60ch 42ch at 12% -6%, rgba(255, 90, 31, 0.16), transparent 62%),
    radial-gradient(50ch 38ch at 92% 8%, rgba(52, 84, 255, 0.13), transparent 60%),
    radial-gradient(40ch 30ch at 60% 2%, rgba(217, 119, 6, 0.1), transparent 58%),
    radial-gradient(circle, var(--line) 1px, transparent 1px);
  background-size: auto, auto, auto, 26px 26px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-weight: 500;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-12);
}

.section-head h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem);
  margin-bottom: var(--space-4);
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin: 0;
}

.lede {
  color: var(--text-dim);
  font-size: 1.15rem;
  max-width: 62ch;
}

code,
.mono {
  font-family: var(--font-mono);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 6px 0 0 var(--accent-text);
}

.btn-primary:hover {
  background: #ff6c38;
  border-color: #ff6c38;
  transform: translateY(-1px);
  box-shadow: 0 7px 0 0 var(--accent-text);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 0 var(--accent-text);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  box-shadow: 0 4px 0 0 var(--accent-text);
}

/* ---------- nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 250, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.brand svg {
  flex: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--accent-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.icon-link {
  display: inline-flex;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

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

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

.hero {
  padding: var(--space-24) 0 var(--space-16);
}

.hero-copy {
  max-width: 760px;
}

.hero h1 {
  font-size: clamp(2.3rem, 1.6rem + 3.2vw, 3.9rem);
  margin-bottom: var(--space-6);
}

.hero .lede {
  margin-bottom: var(--space-8);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.hero-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- tunnel diagram ---------- */

.diagram-wrap {
  margin-top: var(--space-16);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-8) var(--space-6) var(--space-6);
  overflow: hidden;
  box-shadow: 0 18px 44px -24px rgba(28, 20, 12, 0.22);
}

.diagram-wrap-inner {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.diagram-wrap svg {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
}

.diagram-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: var(--space-4);
  letter-spacing: 0.02em;
}

.diagram-node-label {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--text);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.diagram-node-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-faint);
}

.diagram-url {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--text);
}

.tunnel-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 5;
  animation: dash-flow 1.1s linear infinite;
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -18;
  }
}

.fan-line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.tunnel-pulse {
  fill: var(--accent);
}

.status-dot {
  fill: var(--signal-green);
}

.status-dot-glow {
  fill: var(--signal-green);
  opacity: 0.18;
}

/* ---------- problem section ---------- */

.problem {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.problem-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-16);
  align-items: start;
}

.problem h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem);
  margin-bottom: var(--space-6);
}

.problem-body p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

.problem-punch {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: var(--space-4);
  margin-top: var(--space-6) !important;
}

.tool-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tool-list li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
}

/* ---------- features ---------- */

.features {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-card {
  background: var(--surface);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: background-color 0.2s ease;
}

.feature-card:hover {
  background: var(--surface-alt);
}

.feature-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon {
  width: 24px;
  height: 24px;
}

.feature-card:nth-child(3n + 1) .feature-icon-badge {
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-card:nth-child(3n + 2) .feature-icon-badge {
  background: var(--blue-soft);
  color: var(--blue);
}

.feature-card:nth-child(3n + 3) .feature-icon-badge {
  background: var(--gold-soft);
  color: var(--gold);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
}

.feature-card code {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  font-size: 0.88em;
}

/* ---------- tour ---------- */

.tour {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.tour-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-12);
  align-items: center;
  padding: var(--space-16) 0;
}

.tour-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.tour-row.reverse .tour-frame {
  order: 2;
}

.tour-row.reverse .tour-text {
  order: 1;
}

.tour-text .eyebrow {
  color: var(--text-faint);
}

.tour-text .eyebrow::before {
  background: var(--text-faint);
  box-shadow: none;
}

.tour-text h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

.tour-text p {
  color: var(--text-dim);
  font-size: 1rem;
}

.tour-text code {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  font-size: 0.88em;
}

.browser-frame {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 20px 50px -28px rgba(28, 20, 12, 0.28);
}

.browser-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}

.browser-chrome span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.browser-chrome span:nth-child(1) {
  background: var(--accent);
  opacity: 0.55;
}

.browser-chrome span:nth-child(2) {
  background: var(--gold);
  opacity: 0.55;
}

.browser-chrome span:nth-child(3) {
  background: var(--signal-green);
  opacity: 0.55;
}

.shot-frame {
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}

/* ---------- how it works ---------- */

.how {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.step {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--line);
}

.steps .step:last-child {
  border-bottom: 1px solid var(--line);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-text);
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
}

.step p {
  color: var(--text-dim);
  margin: 0;
  max-width: 60ch;
}

.step code {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.45em;
  font-size: 0.88em;
  color: var(--accent-text);
}

/* ---------- requirements (spec sheet) ---------- */

.requirements {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.spec-sheet {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.spec-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-6) var(--space-8);
}

.spec-row:not(:last-child) {
  border-bottom: 1px solid var(--line);
}

.spec-row:nth-child(odd) {
  background: var(--surface-alt);
}

.spec-row:nth-child(even) {
  background: var(--surface);
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.spec-value {
  color: var(--text);
}

.spec-value span {
  color: var(--text-faint);
}

/* ---------- not-for-enterprise ---------- */

.boundary {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.boundary-card {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  background: var(--surface-alt);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12);
}

.boundary-card h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  margin-bottom: var(--space-4);
}

.boundary-card p {
  color: var(--text-dim);
}

.omit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.omit-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.omit-list li::before {
  content: "";
  width: 12px;
  height: 2px;
  background: var(--signal-red);
  flex: none;
}

/* ---------- faq ---------- */

.faq {
  padding: var(--space-24) 0;
  border-top: 1px solid var(--line);
}

.faq-list {
  max-width: 780px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-6) 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.3rem;
  flex: none;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  color: var(--text-dim);
  margin: 0 0 var(--space-6);
  max-width: 68ch;
}

/* ---------- closing cta ---------- */

.closing {
  margin-top: var(--space-24);
  padding: var(--space-24) 0;
  background: linear-gradient(120deg, var(--accent-text) 0%, #8a3d6b 50%, var(--blue) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.35) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.closing .container {
  position: relative;
}

.closing h2 {
  font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem);
  margin-bottom: var(--space-4);
  color: #fff;
}

.closing p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 52ch;
  margin: 0 auto var(--space-8);
  font-size: 1.05rem;
}

.closing-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.closing .btn-primary {
  background: #fff;
  color: var(--accent-text);
  border-color: #fff;
  box-shadow: 0 6px 0 0 rgba(28, 15, 6, 0.25);
}

.closing .btn-primary:hover {
  background: #fff;
  color: var(--accent-text);
  border-color: #fff;
}

.closing .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.closing .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-12) 0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-brand svg {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
}

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

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .problem-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .tour-row,
  .tour-row.reverse {
    grid-template-columns: 1fr;
  }

  .tour-row .tour-frame,
  .tour-row.reverse .tour-frame,
  .tour-row .tour-text,
  .tour-row.reverse .tour-text {
    order: initial;
  }

  .boundary-card {
    grid-template-columns: 1fr;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .shot-frame {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: var(--space-6);
    gap: var(--space-4);
    transform: translateY(-120%);
    transition: transform 0.25s ease;
  }

  .nav-links.is-open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-actions .btn-sm {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: var(--space-16);
  }
}

@media (max-width: 520px) {
  .hero-actions,
  .closing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
