:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #eef3f8;
  --text: #10243d;
  --text-muted: #475b73;
  --line: #cfdae6;
  --brand: #1f75be;
  --brand-dark: #145890;
  --accent: #ef7f2f;
  --ok: #1f7a48;
  --danger: #9e1b32;
  --focus: #0b6efd;
  --radius: 14px;
  --shadow: 0 12px 28px rgba(16, 36, 61, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fbff, #f2f6fb 40%, #edf2f8);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

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

a {
  color: var(--brand-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

a:hover {
  color: var(--brand);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 248, 251, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.header-shell {
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 168px;
  height: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.36rem 0.52rem;
  border-radius: 8px;
}

.site-nav a:hover {
  background: var(--surface-alt);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 0.6rem;
}

.lang-switch select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0.2rem 0.45rem;
  font-size: 0.9rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.mobile-nav {
  display: none;
}

.mobile-nav[hidden] {
  display: none !important;
}

main {
  padding: 2rem 0 3rem;
}

.hero {
  display: grid;
  gap: 1.2rem;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #f2f7fe);
  box-shadow: var(--shadow);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.8rem);
  margin-bottom: 0.8rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.7rem;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
}

p,
ul,
ol {
  margin-top: 0;
}

.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 64ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.button-primary {
  background: var(--brand);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--brand-dark);
  color: #ffffff;
}

.button-secondary {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

.section {
  margin-top: 1.2rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#beta-form {
  display: grid;
  gap: 0.8rem;
  max-width: 640px;
}

.beta-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

#beta-form input[type="email"],
#beta-form input[type="text"],
#beta-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 0.72rem;
}

#beta-form input[type="email"]:focus-visible,
#beta-form input[type="text"]:focus-visible,
#beta-form select:focus-visible,
#beta-form input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.beta-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 400;
  margin-bottom: 0;
}

.beta-check input[type="checkbox"] {
  margin-top: 0.2rem;
}

#beta-form button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

#beta-status {
  margin-top: 0.85rem;
  max-width: 640px;
}

.card-grid {
  display: grid;
  gap: 0.85rem;
}

.card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}

.card h3 {
  color: var(--text);
}

.card p {
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid #d2e4f7;
  background: #e9f3ff;
  color: #0f4a79;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-18 {
  display: inline-block;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeeff;
  color: #0e3d66;
  font-weight: 600;
  border: 1px solid #bddaf4;
}

.notice {
  border-left: 5px solid var(--accent);
  padding: 0.9rem 1rem;
  background: #fff7ef;
  border-radius: 10px;
}

.danger {
  border-left-color: var(--danger);
  background: #fff0f3;
}

.ok {
  border-left-color: var(--ok);
  background: #edf8f1;
}

.screenshot-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.screenshot-card {
  margin: 0;
}

.screenshot-card button {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 20;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(16, 36, 61, 0.14);
  cursor: pointer;
}

.screenshot-card img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: contain;
  background: #f3f7fc;
}

.screenshot-hint {
  display: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
}

.legal-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 2rem;
}

.footer-inner {
  padding: 1.2rem 0 2rem;
  color: var(--text-muted);
  display: grid;
  gap: 0.7rem;
}

.footer-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a {
  color: var(--text);
  text-decoration-color: rgba(16, 36, 61, 0.35);
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--brand-dark);
  text-decoration-color: currentColor;
}

.page-intro {
  margin-bottom: 1rem;
}

.article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.article section + section {
  margin-top: 1.3rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(12, 21, 33, 0.88);
  z-index: 100;
  padding: 1rem;
}

.lightbox.open {
  display: grid;
}

.lightbox-dialog {
  width: min(1000px, 100%);
  position: relative;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: 86vh;
  margin: 0 auto;
  border-radius: 10px;
  border: 2px solid #d8e5f5;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: 1px solid #6a829d;
  background: rgba(16, 36, 61, 0.84);
  color: #ffffff;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1.1rem;
}

.lightbox-close {
  top: -12px;
  right: -8px;
}

.lightbox-prev {
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
}

.lightbox-next {
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
}

.lightbox-caption {
  color: #e8f0fb;
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .screenshot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .lang-switch {
    margin-left: auto;
  }

  .lang-switch select {
    min-height: 34px;
    font-size: 0.85rem;
  }

  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .mobile-nav:not([hidden]) {
    display: grid;
    gap: 0.1rem;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    z-index: 1000;
    max-height: min(70vh, 520px);
    overflow: auto;
    margin: 0;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
  }

  .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.2rem 0.6rem;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
  }

  .mobile-nav a:hover {
    background: var(--surface-alt);
  }
}

@media (min-width: 861px) {
  .menu-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .screenshot-hint {
    display: block;
  }

  .screenshot-grid {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    padding-inline: 0.8rem;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0.8rem;
    scroll-padding-right: 0.8rem;
    -webkit-overflow-scrolling: touch;
  }

  .screenshot-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1724;
    --surface: #132132;
    --surface-alt: #1a2d42;
    --text: #e7f1fc;
    --text-muted: #b9cadb;
    --line: #29425b;
    --focus: #7ec2ff;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  }

  body {
    background: linear-gradient(180deg, #0f1b2a, #102031 45%, #0d1826);
  }

  .site-header {
    background: rgba(15, 27, 42, 0.95);
  }

  .site-footer {
    background: var(--surface-alt);
  }

  .site-footer a,
  .legal-links a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration-color: rgba(255, 255, 255, 0.35);
  }

  .site-footer a:hover,
  .site-footer a:focus-visible,
  .legal-links a:hover,
  .legal-links a:focus-visible {
    text-decoration-color: rgba(255, 255, 255, 0.7);
    outline: 2px solid rgba(255, 255, 255, 0.25);
    outline-offset: 2px;
  }

  .hero {
    background: linear-gradient(135deg, #13253a, #0f2236);
  }

  .button-secondary {
    color: var(--text);
  }

  .notice {
    color: #2a1b08;
  }

  .danger {
    color: #3a0f19;
  }

  .ok {
    color: #0d2718;
  }
}
