@font-face {
  font-family: "Riesling";
  src: url("../assets/fonts/riesling.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #f6efe4;
  --surface: #fffaf2;
  --surface-soft: #fbf3e8;
  --ink: #1f1a16;
  --muted: #776a5d;
  --line: rgba(31, 26, 22, 0.12);
  --accent: #8f5f3d;
  --accent-ink: #fffaf2;
  --shadow: 0 24px 70px rgba(64, 46, 30, 0.1);
}

body[data-theme="dark"] {
  --page: #171412;
  --surface: #211d1a;
  --surface-soft: #1c1816;
  --ink: #f8efe3;
  --muted: #b8aa9b;
  --line: rgba(248, 239, 227, 0.14);
  --accent: #d7b58f;
  --accent-ink: #171412;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: var(--page);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(246, 239, 228, 0.96)),
    var(--page);
  transition:
    color 180ms ease,
    background 180ms ease;
}

body[data-theme="dark"] {
  background:
    linear-gradient(180deg, rgba(28, 24, 22, 0.96), rgba(23, 20, 18, 0.96)),
    var(--page);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(22px);
}

.brand {
  color: var(--ink);
  font-family:
    "Riesling", ui-rounded, "SF Pro Rounded", "Avenir Next", Inter,
    ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topnav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.topnav a {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.66rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
  background: var(--surface-soft);
  outline: none;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.18rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.lang-button,
.theme-toggle {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.theme-toggle {
  border-color: var(--line);
  background: var(--surface);
}

.lang-button span {
  font-size: 0.86rem;
  line-height: 1;
}

.lang-button:hover,
.lang-button:focus-visible,
.lang-button.is-active,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--line);
  background: var(--surface-soft);
  outline: none;
}

.lang-button:hover,
.lang-button:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
}

.hero {
  width: min(1120px, 100%);
  min-height: calc(88svh - 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7rem) clamp(1rem, 4vw, 2rem)
    clamp(3.5rem, 7vw, 5rem);
}

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

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: 0;
  font-weight: 850;
}

.lead {
  max-width: 660px;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.76;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.button {
  min-height: 2.8rem;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  background: var(--surface-soft);
  outline: none;
}

.button-primary {
  border-color: transparent;
  color: var(--accent-ink);
  background: var(--accent);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent);
}

.copy-status {
  min-height: 1.35rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.copy-status[data-tone="error"] {
  color: #a33c35;
}

body[data-theme="dark"] .copy-status[data-tone="error"] {
  color: #f0a39a;
}

.hero-art {
  display: grid;
  gap: 0.8rem;
}

.phone,
.result-strip,
.code-panel,
.steps li,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phone {
  min-height: 390px;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 1rem;
}

.phone-top {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.phone-top span {
  width: 2rem;
  height: 0.25rem;
  display: block;
  margin-bottom: 1.2rem;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.42;
}

.phone-top strong,
.phone-top small,
.profile-row strong,
.profile-row small,
.result-strip strong,
.result-strip span {
  display: block;
}

.phone-top strong {
  font-size: 1.42rem;
  line-height: 1;
}

.phone-top small,
.profile-row small,
.result-strip span {
  color: var(--muted);
}

.scan-line {
  height: 0.34rem;
  border-radius: 999px;
  background: var(--accent);
}

.profile-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.profile-row > span {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.profile-row strong {
  font-size: 0.92rem;
}

.profile-row small {
  margin-top: 0.12rem;
  font-size: 0.78rem;
}

.profile-row.is-muted {
  opacity: 0.82;
}

.result-strip {
  padding: 1rem;
}

.result-strip strong {
  font-size: 2.2rem;
  line-height: 1;
}

.result-strip span {
  margin-top: 0.18rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.code-panel {
  grid-column: 1 / -1;
  width: min(940px, 100%);
  min-width: 0;
  overflow: hidden;
  margin-top: clamp(1rem, 2vw, 1.6rem);
  background: #1f1a16;
}

body[data-theme="dark"] .code-panel {
  background: #0f0d0c;
}

.code-panel-head {
  min-height: 2.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.74rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8efe3;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.83rem;
  font-weight: 750;
}

.code-panel pre {
  max-width: 100%;
  max-height: 300px;
  margin: 0;
  overflow: auto;
  padding: 1rem;
}

.code-panel code {
  display: block;
  color: #fffaf2;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace,
    monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.section-muted {
  background: var(--surface-soft);
}

.section-copy {
  width: min(920px, 100%);
  margin: 0 auto;
}

.section h2 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 820;
}

.section-copy > p:not(.eyebrow) {
  max-width: 760px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.12rem);
  line-height: 1.75;
}

.steps,
.feature-grid {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.7rem auto 0;
  padding: 0;
  list-style: none;
}

.steps li,
.feature-grid article {
  min-height: 12rem;
  padding: 1rem;
}

.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
}

.steps h3,
.feature-grid h3 {
  margin: 0;
  font-size: 1.05rem;
}

.steps p,
.feature-grid p {
  margin: 0.68rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.62;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.88rem;
}

.footer nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer a {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-art {
    max-width: 430px;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topnav {
    order: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topnav a {
    justify-content: center;
    padding-inline: 0.42rem;
    font-size: 0.8rem;
  }

  .hero {
    padding-top: 4rem;
  }

  h1 {
    font-size: clamp(2.65rem, 12vw, 4.2rem);
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .code-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

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

  .steps li,
  .feature-grid article {
    min-height: 0;
  }

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

  .footer nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
