/* =========================
   RESET + VARIABLES
========================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #cfcfcf;
  --primary-dark: #7d7d7d;

  --bg: #252525;
  --bg-soft: #545454;
  --text: #cfcfcf;
  --text-muted: rgba(207, 207, 207, 0.62);
  --border: rgba(207, 207, 207, 0.16);

  --surface: rgba(84, 84, 84, 0.34);
  --surface-hover: rgba(125, 125, 125, 0.28);

  --text-scale: 1;
  --topbar-height: 46px;
  --nav-height: 58px;
  --cta-height: 74px;

  --page-x: 1.25rem;
  --section-gap: 2.25rem;
  --block-gap: 1.25rem;
}

html[data-text="sm"] { --text-scale: 0.9; }
html[data-text="md"] { --text-scale: 1; }
html[data-text="lg"] { --text-scale: 1.18; }

html[data-theme="light"] {
  --primary: #545454;
  --primary-dark: #252525;

  --bg: #cfcfcf;
  --bg-soft: #7d7d7d;
  --text: #252525;
  --text-muted: rgba(37, 37, 37, 0.62);
  --border: rgba(37, 37, 37, 0.16);

  --surface: rgba(255, 255, 255, 0.34);
  --surface-hover: rgba(84, 84, 84, 0.16);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: 0.02em;
  padding-bottom: calc(var(--cta-height) + 1.5rem);
}

/* =========================
   TOP CONTROLS
========================= */

.top-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1100;
  height: var(--topbar-height);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.controls-row {
  min-width: max-content;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.75rem;
  font-size: 12px;
  line-height: 1;
}

.lang-btns,
.text-btns {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lang-btns button,
.text-btns button,
.theme-btn {
  font: inherit;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-btns button.active,
.text-btns button.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.lang-btns button:hover,
.text-btns button:hover,
.theme-btn:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.theme-btn {
  font-size: 14px;
}

/* =========================
   NAV
========================= */

nav {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0 var(--page-x);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
}

/* =========================
   HERO
========================= */

.hero {
  max-width: 480px;
  margin: 0 auto;
  padding:
    calc(var(--topbar-height) + var(--nav-height) + 1.25rem)
    var(--page-x)
    1.25rem;
}

.hero-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin-bottom: 1.35rem;
  background: var(--bg-soft);
}

.hero-img img,
.feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-text {
  text-align: center;
}

.hero-label {
  margin-bottom: 0.55rem;
  font-size: calc(0.68rem * var(--text-scale));
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero-text h1 {
  margin-bottom: 0.65rem;
  font-size: calc(1.7rem * var(--text-scale));
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.07em;
  color: var(--text);
}

.hero-sub {
  margin: 0 auto;
  max-width: 32rem;
  font-size: calc(0.92rem * var(--text-scale));
  color: var(--text-muted);
  line-height: 1.45;
}

/* =========================
   FEATURES
========================= */

.features {
  max-width: 480px;
  margin: 0 auto;
  padding: 0.75rem var(--page-x) 1.25rem;
}

.features-grid {
  display: block;
}

.feature {
  text-align: center;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--border);
}

.feature:first-child {
  padding-top: 1rem;
}

.feature:last-child {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

.feature-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--bg-soft);
}

.feature-icon {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 1.25rem;
  color: var(--primary);
}

.feature h3 {
  margin-bottom: 0.45rem;
  font-size: calc(0.82rem * var(--text-scale));
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.feature p {
  margin: 0 auto;
  max-width: 30rem;
  font-size: calc(0.86rem * var(--text-scale));
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================
   FLOATING CTA
========================= */

.cta-float {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 1200;
  transform: translateX(-50%);

  width: calc(100% - 2.5rem);
  max-width: 400px;
  padding: 0.95rem 2rem;

  background: var(--primary);
  color: var(--bg);

  text-align: center;
  text-decoration: none;
  font-size: calc(0.72rem * var(--text-scale));
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;

  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.cta-float:hover {
  background: var(--primary-dark);
  color: #cfcfcf;
  transform: translateX(-50%) scale(1.02);
}

/* =========================
    GALLERY
========================= */

.gallery {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem var(--page-x) 3rem;
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--bg-soft);
}

/* =========================
    FOOTER
========================= */

footer {
  padding: 1.4rem var(--page-x) 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: calc(0.75rem * var(--text-scale));
  color: var(--text-muted);
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

section {
  scroll-margin-top: calc(var(--topbar-height) + var(--nav-height) + 1rem);
}

/* =========================
   TABLET
========================= */

@media (min-width: 768px) {
  :root {
    --page-x: 2rem;
  }

  .top-bar {
    overflow-x: visible;
  }

  .controls-row {
    justify-content: flex-end;
    padding: 0 2rem;
  }

  .hero,
  .features {
    max-width: 600px;
  }

  .hero {
    padding-top: calc(var(--topbar-height) + var(--nav-height) + 1.75rem);
    padding-bottom: 1.75rem;
  }

  .hero-img {
    aspect-ratio: 2 / 3;
    margin-bottom: 1.75rem;
  }

  .hero-text h1 {
    font-size: calc(2.15rem * var(--text-scale));
  }

  .features {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .feature {
    padding: 2rem 0;
  }

  .feature-img {
    aspect-ratio: 3 / 2;
    margin-bottom: 1.5rem;
  }

  .cta-float {
    width: auto;
    padding: 1rem 4rem;
  }

  .gallery {
    max-width: 600px;
    padding: 1.5rem 2rem 4rem;
  }
}

/* =========================
   DESKTOP
========================= */

@media (min-width: 1024px) {
  :root {
    --page-x: 3rem;
  }

  .hero,
  .features {
    max-width: 900px;
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding:
      calc(var(--topbar-height) + var(--nav-height) + 2.25rem)
      var(--page-x)
      4rem;
  }

  .hero-img {
    margin-bottom: 0;
    aspect-ratio: 3 / 4;
  }

  .hero-text {
    text-align: left;
  }

  .hero-text h1 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
  }

  .features {
    padding: 3rem var(--page-x) 4.5rem;
  }

  .features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }

  .feature {
    padding: 0;
    border-bottom: none;
  }

  .feature:first-child,
  .feature:last-child {
    padding-top: 0;
    padding-bottom: 0;
  }

  .feature-img {
    aspect-ratio: 1 / 1;
    margin-bottom: 1.35rem;
  }

  .gallery {
    max-width: 900px;
    padding: 2rem 3rem 5rem;
  }

  .gallery-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .gallery-grid img {
    flex: 1 1 calc(50% - 0.5rem);
    aspect-ratio: 1 / 1;
  }
}