:root {
  --ink: #0b1220;
  --ink-soft: #1a2436;
  --muted: #5b677a;
  --line: rgba(11, 18, 32, 0.1);
  --paper: #f3f6fb;
  --paper-2: #e8eef8;
  --white: #ffffff;
  --accent: #00a88a;
  --accent-deep: #007a64;
  --accent-glow: rgba(0, 168, 138, 0.22);
  --danger: #c43c3c;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(11, 18, 32, 0.12);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 168, 138, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 109, 246, 0.12), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, var(--paper) 40%, #eef3f9 100%);
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.35) 46%, transparent 50%),
    repeating-linear-gradient(
      -18deg,
      transparent 0 14px,
      rgba(11, 18, 32, 0.015) 14px 15px
    );
  animation: drift 18s linear infinite;
  opacity: 0.7;
  z-index: 0;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-40px); }
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(243, 246, 251, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(243, 246, 251, 0.92);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 8px 18px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--ink);
}

.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 11rem;
  max-height: 16rem;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  display: none;
}

.lang-menu.open {
  display: block;
  animation: pop 0.18s ease;
}

.lang-menu a.lang-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  box-sizing: border-box;
}

.lang-menu a.lang-option:hover,
.lang-menu a.lang-option.active {
  background: rgba(0, 168, 138, 0.1);
  color: var(--accent-deep);
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: center;
  margin-top: 0.85rem;
  font-size: 0.82rem;
}

.footer-langs a {
  color: var(--accent-deep);
  font-weight: 650;
  text-decoration: none;
}

.footer-langs a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.footer-langs span {
  color: var(--muted);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  padding: 3.5rem 0 2.5rem;
  min-height: min(88vh, 760px);
  display: flex;
  align-items: center;
}

.hero-inner {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
  animation: rise 0.7s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-hero {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.95;
  background: linear-gradient(120deg, var(--ink) 20%, var(--accent-deep) 55%, #2f6df6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h2,
.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--ink-soft);
}

.hero-compact {
  min-height: auto;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.seo-copy p {
  max-width: 62ch;
}

.prose h2 {
  margin: 1.75rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--muted);
  max-width: 62ch;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-top: 1.1rem;
  padding-bottom: 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 720px) {
  .guide-list {
    grid-template-columns: 1fr 1fr;
  }
}

.guide-list a {
  display: block;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 650;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.guide-list a:hover {
  border-color: rgba(0, 168, 138, 0.45);
  background: rgba(0, 168, 138, 0.06);
  color: var(--accent-deep);
}

.device-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .device-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hero-sub {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.downloader {
  display: grid;
  gap: 0.75rem;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row:focus-within {
  border-color: rgba(0, 168, 138, 0.45);
  box-shadow: 0 18px 50px rgba(11, 18, 32, 0.14), 0 0 0 4px var(--accent-glow);
}

#url-input {
  border: 0;
  outline: none;
  background: transparent;
  padding: 0.85rem 0.9rem;
  min-width: 0;
  color: var(--ink);
}

#url-input::placeholder {
  color: #8b96a8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-ghost {
  background: rgba(11, 18, 32, 0.05);
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(11, 18, 32, 0.09);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #0099d6 100%);
  color: white;
  box-shadow: 0 10px 24px var(--accent-glow);
  min-width: 8.5rem;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.downloader.is-fetching .url-row {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.terms-note {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.terms-note a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.status {
  min-height: 1.4rem;
  margin-top: 0.85rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: var(--accent-deep);
  font-weight: 600;
  animation: status-pulse 1.4s ease-in-out infinite;
}

.status-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 168, 138, 0.25);
  border-top-color: var(--accent-deep);
  flex-shrink: 0;
  animation: spin 0.7s linear infinite;
}

.status-text {
  letter-spacing: -0.01em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

/* Result */
.result {
  margin-top: 1.5rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.45s ease both;
}

.result[hidden] {
  display: none;
}

.result-top {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.result-cover {
  width: 110px;
  height: 146px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--paper-2);
}

.result-meta h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.result-author {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 168, 138, 0.12);
  color: var(--accent-deep);
}

.result-body {
  padding: 1.1rem;
}

.result-body > p {
  margin: 0 0 0.85rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.result-body > p.expire-note {
  margin: 1.5rem 0 0;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: normal;
  font-size: 0.82rem;
  color: var(--muted);
}

.format-list {
  display: grid;
  gap: 0.55rem;
}

.format-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.format-btn:hover {
  border-color: rgba(0, 168, 138, 0.45);
  background: rgba(0, 168, 138, 0.06);
  transform: translateY(-1px);
}

.format-btn strong {
  display: block;
  font-size: 0.98rem;
}

.format-btn span {
  color: var(--muted);
  font-size: 0.85rem;
}

.format-btn .chev {
  color: var(--accent-deep);
  font-weight: 800;
}

.another {
  margin-top: 0.85rem;
  background: transparent;
  border: 0;
  color: var(--accent-deep);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.another:hover {
  text-decoration: underline;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.steps {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  padding: 0.25rem 0;
}

.step-num {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.step h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.about p,
.device-grid p {
  color: var(--muted);
  max-width: 58ch;
}

.device-grid h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 0.55rem;
  max-width: 720px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.faq-item button span {
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.faq-item .answer {
  display: none;
  margin: 0;
  padding: 0 0 1rem;
  color: var(--muted);
}

.faq-item.open .answer {
  display: block;
  animation: rise 0.25s ease both;
}

/* Footer */
.site-footer {
  margin-top: 2rem;
  padding: 2.75rem 0 2rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  margin: 0 0 0.5rem;
}

.site-footer p,
.site-footer li {
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer h4 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a:hover {
  color: var(--accent-deep);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

a.btn-primary {
  text-decoration: none;
  color: white;
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding-top: 2.2rem;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .result-top {
    grid-template-columns: 88px 1fr;
  }

  .result-cover {
    width: 88px;
    height: 118px;
  }

  .nav-links a:not(.lang-btn) {
    display: none;
  }
}
