/* ==========================================================================
   Aquavirya Web v1 — Official Brand Tokens (Abismo / Dark Primary Theme)
   Source: Aquavirya Marca/tokens.json & MARCA - Aquavirya (guia).md
   ========================================================================== */

:root {
  /* Color tokens — Dark (Abismo) */
  --surface: #08161E;
  --surface-raised: #10242F;
  --ink: #E9F2F1;
  --muted: #9DB3BC;
  --line: #22404C;
  --abyss: #12384A;
  --tide: #19C3B1;
  --tide-ink: #2CD3C1;
  --ember: #F2B65A;
  --ember-ink: #F2B65A;
  --on-tide: #0B1F2A;
  --signal-error: #F07B76;

  /* Typography */
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* Spacing tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-10: 40px;
  --space-16: 64px;

  /* Radius tokens */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --max-w: 1120px;
}

*, *::before, *::after {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--surface);
  color: var(--ink);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--tide-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: max(var(--space-4), env(safe-area-inset-left, 0px));
}

@media (min-width: 768px) {
  .wrap {
    padding-inline: var(--space-6);
  }
}

/* Typography helpers */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tide-ink);
}

.label-muted {
  color: var(--muted);
}

.label-ember {
  color: var(--ember-ink);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.15;
}

.h3 {
  font-size: 20px;
  line-height: 26px;
}

p {
  margin: 0;
}

.lead {
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.65;
  max-width: 58ch;
}

/* ==========================================================================
   Header & Wordmark (§4: symbol + lowercase "aquavirya" in Sora 600, gap = 0.5w)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 22, 30, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 14px; /* exactly half of 28px symbol width */
  color: var(--ink);
  text-decoration: none;
  padding-block: 6px;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark img {
  width: 28px;
  height: 28px;
  flex: none;
  /* §4: No shadows, gradients or rotation on logo */
}

.wordmark span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: lowercase;
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-6);
}

@media (min-width: 820px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  border: 1px solid var(--line);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.lang-switch button:hover {
  color: var(--ink);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--tide);
  color: var(--on-tide);
  font-weight: 600;
}

/* ==========================================================================
   Buttons (§5: ember = 1 CTA per viewport; text on ember/tide = on-tide)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-ember {
  background: var(--ember);
  color: var(--on-tide);
}

.btn-ember:hover {
  filter: brightness(1.06);
}

.btn-tide {
  background: var(--tide);
  color: var(--on-tide);
}

.btn-tide:hover {
  background: var(--tide-ink);
}

.btn-ghost {
  background: rgba(16, 36, 47, 0.72);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--tide);
  color: var(--tide-ink);
}

/* ==========================================================================
   Hero with Interactive Ripples (§7)
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(64px, 11vw, 128px) clamp(56px, 9vw, 104px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 55% at 76% 24%, rgba(25, 195, 177, 0.12), transparent 72%),
    radial-gradient(45% 45% at 18% 82%, rgba(18, 56, 74, 0.55), transparent 72%),
    var(--surface);
}

#ripple-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-static-arcs {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 520px;
  height: 520px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.36;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--space-6);
}

.hero-inner > * {
  max-width: 740px;
}

@media (max-width: 440px) {
  .wordmark { gap: 10px; }
  .wordmark img { width: 24px; height: 24px; }
  .wordmark span { font-size: 19px; }
  .lang-switch button { padding: 5px 8px; font-size: 11px; }
  .header-inner { min-height: 60px; }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(16, 36, 47, 0.78);
  border: 1px solid var(--line);
}

.hero-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  flex: none;
}

.hero-title {
  font-size: clamp(40px, 7.2vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero-title .accent {
  color: var(--tide-ink);
}

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(34, 64, 76, 0.75);
}

.ripple-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ripple-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--tide);
  position: relative;
  flex: none;
}

.ripple-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--tide);
}

/* ==========================================================================
   Sections & Brand Soul Band (abyss)
   ========================================================================== */
.section {
  padding-block: var(--space-10);
}

@media (min-width: 820px) {
  .section {
    padding-block: var(--space-16);
  }
}

.section-head {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

@media (min-width: 820px) {
  .section-head {
    margin-bottom: var(--space-10);
  }
}

.soul-band {
  position: relative;
  overflow: hidden;
  background: var(--abyss);
  border-bottom: 1px solid var(--line);
}

.soul-arcs {
  position: absolute;
  left: -96px;
  top: -96px;
  width: 440px;
  height: 440px;
  pointer-events: none;
  opacity: 0.28;
}

.soul-grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 820px) {
  .soul-grid {
    grid-template-columns: 1fr 1fr 1.25fr;
    align-items: start;
    gap: var(--space-10);
  }
}

.etym-card {
  padding-left: var(--space-4);
  border-left: 2px solid var(--tide);
}

.etym-card.ember-border {
  border-left-color: var(--ember);
}

.etym-word {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin-top: var(--space-1);
}

.etym-desc {
  color: var(--muted);
  margin-top: var(--space-2);
  font-size: 15px;
  line-height: 1.6;
}

.soul-promise {
  background: rgba(8, 22, 30, 0.56);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.soul-promise p {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.45;
  color: var(--ink);
}

.soul-promise small {
  display: block;
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   Services Grid
   ========================================================================== */
.services-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 820px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--tide);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.icon-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(25, 195, 177, 0.12);
  border: 1px solid rgba(25, 195, 177, 0.28);
  display: grid;
  place-items: center;
  color: var(--tide-ink);
}

.card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.card-list {
  list-style: none;
  margin: auto 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--ink);
}

.card-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tide);
  margin-top: 9px;
  flex: none;
}

/* ==========================================================================
   Portfolio: Interactive Demo Feature Panel
   ========================================================================== */
.portfolio-stack {
  display: grid;
  gap: var(--space-10);
}

.demo-feature {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-6);
  position: relative;
  overflow: hidden;
}

@media (min-width: 860px) {
  .demo-feature {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    padding: var(--space-10);
    gap: var(--space-10);
  }
}

.demo-copy {
  display: grid;
  gap: var(--space-4);
}

.demo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(8, 22, 30, 0.72);
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip-tide {
  border-color: rgba(25, 195, 177, 0.4);
  color: var(--tide-ink);
}

/* Realistic mini preview of the generic coffee stamp card */
.demo-mock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
}

.mock-card {
  background: #c99a62;
  color: #3b2418;
  border-radius: var(--radius-md);
  padding: 18px;
}

.mock-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}

.mock-card-head span {
  font-family: var(--font-mono);
  font-size: 12px;
}

.mock-beans {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.mock-bean {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed rgba(59, 36, 24, 0.45);
  display: grid;
  place-items: center;
}

.mock-bean.filled {
  border-style: solid;
  border-color: #3b2418;
  background: rgba(59, 36, 24, 0.14);
}

.mock-bean.filled::after {
  content: "";
  width: 10px;
  height: 14px;
  border-radius: 50%;
  background: #3b2418;
  transform: rotate(24deg);
}

.mock-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.mock-stat {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
}

.mock-stat small {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mock-stat strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}

/* ==========================================================================
   Portfolio: Mochi 3D Shorts (Local MP4s in clean 9:16 frames)
   ========================================================================== */
.stories-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stories-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 760px) {
  .stories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.short-card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.phone-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #040B10;
  border: 1px solid var(--line);
}

.phone-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(8, 22, 30, 0.08) 0%, rgba(8, 22, 30, 0.42) 100%);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.play-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.play-circle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(8, 22, 30, 0.82);
  border: 2px solid var(--tide);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-overlay:hover .play-circle {
  transform: scale(1.06);
  background: var(--tide);
}

.play-overlay:hover .play-circle svg {
  fill: var(--on-tide);
}

.play-circle svg {
  width: 22px;
  height: 22px;
  fill: var(--ink);
  margin-left: 3px;
}

.short-meta {
  display: grid;
  gap: var(--space-1);
  padding-inline: var(--space-1);
}

.short-meta h3 {
  font-size: 18px;
  line-height: 24px;
}

.short-meta p {
  font-size: 14px;
  line-height: 21px;
  color: var(--muted);
}

.channel-banner {
  margin-top: var(--space-6);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ==========================================================================
   About & Contact Section
   ========================================================================== */
.contact-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.about-box, .contact-box {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 820px) {
  .about-box, .contact-box {
    padding: var(--space-10);
  }
}

.contact-box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(85% 85% at 100% 0%, rgba(25, 195, 177, 0.14), transparent 68%),
    var(--abyss);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: auto;
  padding-top: var(--space-2);
}

.contact-email-mono {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--tide-ink);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-10);
  background: var(--surface);
}

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

.footer-note {
  color: var(--muted);
  font-size: 14px;
}

/* Toast notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 24px);
  opacity: 0;
  visibility: hidden;
  background: var(--abyss);
  color: var(--ink);
  border: 1px solid var(--tide);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  z-index: 60;
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .play-circle, .toast { transition: none; }
}
