:root {
  --night: #03182e;
  --deep-blue: #062747;
  --ice-cyan: #69e8f3;
  --frost: #d8fbff;
  --violet: #7926b7;
  --magenta: #bb2ec6;
  --mist: #aac9da;
  --line: rgba(105, 232, 243, .25);
  --panel: rgba(3, 24, 46, .6);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--frost);
  background: radial-gradient(circle at 74% 20%, #0f5e7c 0, var(--deep-blue) 34%, var(--night) 72%);
  background-attachment: fixed;
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap { width: min(var(--maxw), calc(100% - 40px)); margin-inline: auto; }

/* Header + Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(3, 24, 46, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--frost);
  font-family: "DM Serif Display", serif;
  font-size: 1.25rem;
  text-decoration: none;
}

.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { color: var(--ice-cyan); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--frost);
  font-size: 1.3rem;
  cursor: pointer;
}

.site-nav { display: flex; align-items: center; gap: 26px; }

.site-nav a {
  color: var(--mist);
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .18s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ice-cyan); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch button {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--mist);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ice-cyan);
  color: var(--night);
}

/* Main layout */
main { display: block; }

.page { padding: 44px 0 64px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--ice-cyan);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 10px; height: 10px;
  background: var(--magenta);
  border: 2px solid var(--frost);
  border-radius: 50%;
  content: "";
}

h1 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1;
}

h1 em { color: var(--ice-cyan); font-style: normal; }

h2 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 400;
  line-height: 1.1;
}

.lead { max-width: 560px; color: var(--mist); font-size: 1rem; line-height: 1.6; }

/* Hero + 3D ice ball */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .82fr);
  align-items: center;
  gap: 56px;
}

.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.btn-primary {
  border: 2px solid var(--ice-cyan);
  color: var(--night);
  background: var(--ice-cyan);
  box-shadow: 5px 5px 0 var(--violet);
}

.btn-primary:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--violet); }

.hero .cta-row > .btn { min-height: 54px; }

.app-store-badge { display: inline-flex; height: 54px; }
.app-store-badge img { width: auto; height: 54px; }

.btn-ghost {
  border: 2px solid var(--line);
  color: var(--frost);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--ice-cyan); }

/* 3D animated ice cream scoop */
.scene {
  display: grid;
  place-items: center;
  min-height: 420px;
  perspective: 900px;
}

.ice-ball {
  position: relative;
  width: 260px;
  height: 260px;
  transform-style: preserve-3d;
  animation: floaty 6s ease-in-out infinite;
}

.ice-ball .ice-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 40%, rgba(0, 0, 0, .35) 62%, transparent 90%);
  mask: radial-gradient(circle at 50% 50%, #000 40%, rgba(0, 0, 0, .35) 62%, transparent 90%);
  filter: drop-shadow(0 30px 55px rgba(0, 0, 0, .4));
  will-change: opacity;
}

.ice-ball .ice-b { opacity: 0; }

.ice-ball .glow {
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(105, 232, 243, .4), rgba(121, 38, 183, .16) 46%, transparent 70%);
  filter: blur(22px);
  z-index: -1;
  animation: pulse 6s ease-in-out infinite;
}

.ice-ball .shadow {
  position: absolute;
  left: 50%;
  bottom: -54px;
  width: 200px;
  height: 34px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .5), transparent 70%);
  filter: blur(4px);
  animation: shadowPulse 6s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotateX(6deg); }
  50% { transform: translateY(-22px) rotateX(6deg); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .9; }
}

@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .5; }
  50% { transform: translateX(-50%) scale(.78); opacity: .32; }
}

@media (prefers-reduced-motion: reduce) {
  .ice-ball, .ice-ball .ice-svg, .ice-ball .glow, .ice-ball .shadow { animation: none; }
}

/* Sections */
.section { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--line); }

.section-head { max-width: 620px; margin-bottom: 30px; }
.section-head p { margin: 12px 0 0; color: var(--mist); font-size: 1rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.card .num {
  color: var(--magenta);
  font-family: "DM Serif Display", serif;
  font-size: 2rem;
  line-height: 1;
}

.card h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--mist); font-size: .92rem; }

.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--mist); }
.card li { margin-bottom: 6px; }

/* FAQ */
.faq-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin-bottom: 14px;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--ice-cyan); font-size: 1.4rem; line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 0 24px 22px; color: var(--mist); }

/* Recipe balance explainer */
.balance-layout {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.balance-graphic,
.problem-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.balance-graphic { padding: 24px; }
.balance-graphic-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; font-weight: 700; }
.balance-graphic-head strong { color: var(--ice-cyan); font-size: .85rem; }
.balance-chart { position: relative; max-width: 460px; margin-top: 18px; }
.balance-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { fill: none; stroke: rgba(170, 201, 218, .22); stroke-width: 1; }
.chart-water, .chart-solids { fill: none; stroke-width: 8; stroke-linecap: round; }
.chart-water { stroke: var(--ice-cyan); }
.chart-solids { stroke: var(--magenta); }
.chart-target { fill: url(#balance-zone); stroke: var(--frost); stroke-width: 2; stroke-dasharray: 5 5; }
.chart-cross { fill: var(--frost); stroke: var(--night); stroke-width: 2; }
.chart-axis { position: absolute; color: var(--mist); font-size: .76rem; }
.chart-axis-low { left: 9%; bottom: 6%; }
.chart-axis-high { right: 5%; bottom: 6%; }
.balance-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 2px; color: var(--mist); font-size: .84rem; }
.balance-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-line, .legend-zone { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.legend-water { background: var(--ice-cyan); }
.legend-solids { background: var(--magenta); }
.legend-zone { height: 12px; border: 1px dashed var(--frost); background: rgba(105, 232, 243, .22); }
.balance-detail { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; }
.balance-detail p, .balance-caption { margin: 0; color: var(--mist); font-size: .88rem; }
.balance-dot { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 5px; border-radius: 50%; background: #f7c948; }
.balance-caption { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.problem-item { margin-bottom: 12px; overflow: hidden; }
.problem-item summary { padding: 17px 20px; cursor: pointer; font-weight: 700; list-style: none; }
.problem-item summary::-webkit-details-marker { display: none; }
.problem-item summary::after { float: right; margin-left: 16px; color: var(--ice-cyan); content: "+"; font-size: 1.2rem; line-height: 1; }
.problem-item[open] summary::after { content: "\2013"; }
.problem-item p { margin: 0 20px 20px; color: var(--mist); font-size: .92rem; }

/* Forms */
.form { max-width: 620px; }

.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .95rem; }

.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  color: var(--frost);
  background: rgba(6, 39, 71, .6);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.field input:focus,
.field textarea:focus { outline: 2px solid var(--ice-cyan); outline-offset: 1px; }

.field textarea { min-height: 150px; resize: vertical; }

.form-note { margin-top: 8px; color: var(--mist); font-size: .85rem; }

.form-status { margin-top: 16px; min-height: 22px; color: var(--ice-cyan); font-size: .95rem; }

/* Legal / prose */
.prose { max-width: 720px; }
.prose h2 { margin-top: 30px; font-size: 1.25rem; }
.prose p, .prose li { color: var(--mist); }
.prose a { color: var(--ice-cyan); }

.about-banner {
  width: 100%;
  max-height: 440px;
  margin: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.about-copy { max-width: 800px; }
.about-copy p { margin: 0 0 20px; }

.knowledge-links { max-width: 820px; }
.knowledge-link { display: block; margin-bottom: 16px; text-decoration: none; }
.knowledge-link:hover { border-color: var(--ice-cyan); }

.highlight-box {
  margin: 26px 0;
  padding: 22px 24px;
  border: 1px solid var(--ice-cyan);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(105, 232, 243, .12), rgba(121, 38, 183, .14));
}

.highlight-box p { margin: 0; color: var(--frost); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(3, 24, 46, .6);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 34px;
  color: var(--mist);
  font-size: .88rem;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--mist); text-decoration: none; }
.footer-links a:hover { color: var(--ice-cyan); }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .balance-layout { grid-template-columns: 1fr; }
  .scene { min-height: 320px; order: -1; }
  .ice-ball { width: 210px; height: 210px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    inset: 62px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px 24px;
    background: rgba(3, 24, 46, .97);
    border-bottom: 1px solid var(--line);
    transform: translateY(-140%);
    transition: transform .25s ease;
  }
  .site-nav.open { transform: translateY(0); }
  .site-nav a { padding: 10px 0; width: 100%; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { margin-top: 56px; }
}
