/* ==========================================================================
   TubeWorth — site styles
   ========================================================================== */

:root {
  --bg: #0a0908;
  --bg-2: #110f0e;
  --surface: #171412;
  --surface-2: #1f1b18;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f7f4f2;
  --text-2: #c9c2bd;
  --muted: #948a84;

  --red: #ff3b30;
  --orange: #ff7a2f;
  --amber: #ffb35c;
  --green: #3ddc84;
  --grad: linear-gradient(100deg, #ff3b30 0%, #ff6a2c 45%, #ffb35c 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 59, 48, 0.16), rgba(255, 179, 92, 0.08));

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

.icon { width: 1em; height: 1em; flex: none; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; margin: 0; }

p { margin: 0 0 1em; }

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

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

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 9, 8, 0.86);
}

.site-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 6px 18px -6px rgba(255, 59, 48, 0.6);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.site-nav .icon { width: 16px; height: 16px; opacity: 0.85; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(255, 80, 40, 0.7);
}
.btn-primary:hover { box-shadow: 0 16px 36px -10px rgba(255, 80, 40, 0.85); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 104px);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(900px, 110vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 70, 40, 0.34), rgba(255, 120, 50, 0.1) 55%, transparent 75%);
  z-index: -1;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 30%, #000 20%, transparent 70%);
  z-index: -2;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}
.eyebrow .dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 11px;
}
.eyebrow .dot .icon { width: 13px; height: 13px; stroke-width: 2.6; }

.hero h1 {
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-bottom: 24px;
}
.hero h1 .sub {
  display: block;
  color: var(--text);
}

.hero .lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
  max-width: 580px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
.trust-list li { display: inline-flex; align-items: center; gap: 8px; }
.trust-list .icon { width: 17px; height: 17px; color: var(--green); }

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  background: var(--grad);
  filter: blur(70px);
  opacity: 0.45;
  border-radius: 50%;
  z-index: -1;
}
.hero-shot {
  width: min(360px, 78vw);
  border-radius: 34px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), 0 0 0 8px rgba(255, 255, 255, 0.03);
  transform: rotate(2.5deg);
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-alt {
  background: var(--bg-2);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 760px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}
.kicker {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}
.section-head h2 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 800;
  margin-bottom: 16px;
}
.section-head p {
  color: var(--text-2);
  font-size: 18px;
  margin: 0;
}

/* ---------- Feature cards ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}
.feature-card {
  grid-column: span 2;
  position: relative;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.feature-card:nth-child(4),
.feature-card:nth-child(5) { grid-column: span 3; }
.feature-card:hover {
  border-color: rgba(255, 122, 47, 0.35);
  transform: translateY(-3px);
}
.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid rgba(255, 122, 47, 0.25);
  color: var(--amber);
  font-size: 20px;
}
.feature-icon .icon { width: 24px; height: 24px; }
.feature-card h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 16px;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.5;
}
.check-list li {
  position: relative;
  padding-left: 28px;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat,
    var(--grad);
}

/* ---------- Split (worth / privacy) ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 96px);
}
.split-reverse .split-media { order: -1; }

.split-copy h2 {
  font-size: clamp(32px, 4.6vw, 54px);
  font-weight: 800;
  margin-bottom: 20px;
}
.split-copy p {
  color: var(--text-2);
  font-size: 18px;
}

.split-media {
  position: relative;
  display: flex;
  justify-content: center;
}
.split-media::before {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  top: 15%;
  background: radial-gradient(closest-side, rgba(255, 90, 40, 0.4), transparent);
  filter: blur(20px);
  z-index: 0;
}
.split-media img {
  position: relative;
  width: min(340px, 80vw);
  border-radius: 32px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}




/* ---------- Screens gallery ---------- */
.gallery {
  position: relative;
}
.gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px var(--gutter) 24px;
  margin-inline: calc(var(--gutter) * -1);
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-item {
  scroll-snap-align: center;
  margin: 0;
}
.gallery-item img {
  width: 100%;
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  aspect-ratio: 1284 / 2778;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.gallery-item:hover img { transform: translateY(-6px); }

.gallery-controls {
  display: none;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}
.gallery-controls button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.gallery-controls button .icon { width: 20px; height: 20px; }
.gallery-controls button:hover { background: var(--surface-2); }
.gallery-controls button:disabled { opacity: 0.35; cursor: default; }

/* ---------- Privacy band ---------- */
.privacy-card {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 64px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px circle at 100% 0%, rgba(255, 90, 40, 0.2), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.privacy-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--grad);
  color: #fff;
  font-size: 36px;
  box-shadow: 0 16px 40px -12px rgba(255, 80, 40, 0.7);
}
.privacy-icon .icon { width: 42px; height: 42px; }
.privacy-card h2 {
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 800;
  margin-bottom: 16px;
}
.privacy-card p {
  color: var(--text-2);
  font-size: 17.5px;
  max-width: 820px;
}
.privacy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Legal pages ---------- */
.page-hero {
  position: relative;
  padding-block: clamp(48px, 7vw, 88px) clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -60%;
  left: 50%;
  width: min(900px, 120vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 70, 40, 0.28), transparent 70%);
  z-index: -1;
}
.page-hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}
.page-hero p {
  color: var(--text-2);
  font-size: 18px;
  margin: 0;
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px) clamp(64px, 9vw, 112px);
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}
.toc[hidden] { display: none; }
.toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active {
  color: var(--text);
  border-left-color: var(--orange);
}

.prose {
  max-width: 760px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.75;
}
.prose > p:first-child {
  font-size: 19px;
  color: var(--text);
}
.prose h2 {
  color: var(--text);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  margin: 2.4em 0 0.7em;
  padding-top: 1.2em;
  border-top: 1px solid var(--border);
}
.prose h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  margin: 1.8em 0 0.6em;
}
.prose strong { color: var(--text); font-weight: 650; }
.prose ul {
  padding-left: 1.3em;
  margin: 0 0 1.2em;
}
.prose li { margin-bottom: 0.55em; }
.prose li::marker { color: var(--orange); }
.prose a { word-break: break-word; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--amber);
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.2em 0 1.6em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
.table-wrap th,
.table-wrap td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}
.table-wrap td:first-child { width: 42%; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: 48px calc(40px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 14.5px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
}
.footer-brand p { margin: 12px 0 0; max-width: 420px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (min-width: 1000px) {
  .gallery-track { grid-auto-columns: calc((100% - 4 * 20px) / 5); padding-inline: 0; margin-inline: 0; }
}
@media (max-width: 999px) {
  .gallery-controls { display: flex; }
  .gallery-track { grid-auto-columns: 42%; }
}

@media (max-width: 960px) {
  .hero-grid,
  .split { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-actions,
  .trust-list { justify-content: center; }
  .split-reverse .split-media { order: 0; }

  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card,
  .feature-card:nth-child(4),
  .feature-card:nth-child(5) { grid-column: span 1; }
  .feature-card:nth-child(5) { grid-column: 1 / -1; }

  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .site-nav a { padding: 8px 10px; font-size: 14px; }
  .site-nav .label-long { display: none; }
  .brand span { display: none; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-card:nth-child(5) { grid-column: auto; }
  .feature-card { padding: 24px; }
  .gallery-track { grid-auto-columns: 68%; }
  .privacy-card { grid-template-columns: minmax(0, 1fr); }
  .privacy-icon { width: 64px; height: 64px; font-size: 28px; border-radius: 18px; }
  .privacy-icon .icon { width: 32px; height: 32px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .footer-bottom { flex-direction: column; }

  .table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .table-wrap td { border: 0; padding: 12px 16px; }
  .table-wrap td:first-child { width: 100%; background: var(--surface); }
}

@media (min-width: 641px) {
  .site-nav .label-short { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
