/* ForeSky Astro website — one stylesheet, no frameworks, no web fonts. */

:root {
  --bg: #0a0a0f;
  --bg-2: #0f0f18;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8e8f0;
  --muted: #9a9ab0;
  --primary: #6b48ff;
  --primary-soft: #8f74ff;
  --accent: #ff6b35;
  --cyan: #82b1ff;
  --good: #8bc34a;
  --night: #cc2200;
  --radius: 18px;
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }

:focus-visible { outline: 2px solid var(--primary-soft); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Starfield (pure CSS, static) ---------- */
.stars {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 62%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 28%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 12%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 44%, #cfd8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 70%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 84%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 92%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 58%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 18% 40%, #ffe2d1 50%, transparent 51%);
  background-size: 420px 420px;
  opacity: .8;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .btn { margin-left: 6px; }

.menu-toggle { display: none; }

@media (max-width: 760px) {
  .nav { display: none; }
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--surface); color: var(--text); cursor: pointer;
  }
  .site-header.open .nav {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 64px; left: 0; right: 0; padding: 12px 20px 20px;
    background: rgba(10, 10, 15, 0.97); border-bottom: 1px solid var(--line);
  }
  .site-header.open .nav a { padding: 12px; font-size: 16px; }
  .site-header.open .nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2;
  border: 1px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 8px 30px -8px rgba(107,72,255,.7); }
.btn-primary:hover { background: #7a5bff; }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: rgba(255,255,255,.18); }
.btn-ghost:hover { background: var(--surface-2); }
.btn svg { width: 20px; height: 20px; flex: none; }
.nav .btn { padding: 8px 16px; color: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 96px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 120%; z-index: 0;
  background:
    radial-gradient(600px 400px at 75% 35%, rgba(107,72,255,.35), transparent 70%),
    radial-gradient(500px 360px at 15% 10%, rgba(130,177,255,.14), transparent 70%),
    radial-gradient(500px 300px at 60% 100%, rgba(255,107,53,.12), transparent 70%);
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cyan); background: rgba(130,177,255,.08); border: 1px solid rgba(130,177,255,.2);
  padding: 6px 12px; border-radius: 999px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px); line-height: 1.04; letter-spacing: -.035em; margin: 20px 0 18px; font-weight: 800;
}
.grad { background: linear-gradient(100deg, #fff 10%, var(--primary-soft) 55%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(18px, 2.1vw, 21px); color: var(--muted); max-width: 34em; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; color: var(--muted); font-size: 14px; padding: 0; list-style: none; }
.trust li { display: flex; align-items: center; gap: 6px; }
.trust li::before { content: "✓"; color: var(--good); font-weight: 700; }

@media (max-width: 900px) {
  .hero { padding: 48px 0 72px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: 96px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.025em; margin: 12px 0 14px; }
.section-head p { color: var(--muted); margin: 0; font-size: 18px; }
.kicker { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 700px) { .section { padding: 72px 0; } .section-head { margin-bottom: 40px; } }

/* ---------- Feature grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface), rgba(18,18,26,.6));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: rgba(143,116,255,.4); transform: translateY(-2px); }
.card h3 { margin: 16px 0 8px; font-size: 19px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(107,72,255,.14); color: var(--primary-soft); border: 1px solid rgba(107,72,255,.28);
}
.icon svg { width: 24px; height: 24px; }
.icon.orange { background: rgba(255,107,53,.12); color: var(--accent); border-color: rgba(255,107,53,.28); }
.icon.cyan { background: rgba(130,177,255,.1); color: var(--cyan); border-color: rgba(130,177,255,.25); }
.icon.red { background: rgba(204,34,0,.16); color: #ff5533; border-color: rgba(204,34,0,.35); }

/* ---------- Split / spotlight ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split + .split { margin-top: 96px; }
.split.reverse .duo { order: 2; }
.split h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -.025em; margin: 10px 0 16px; }
.split p { color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 50%; background: rgba(107,72,255,.2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f74ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .duo { order: 0; }
  .split + .split { margin-top: 72px; }
}

/* ---------- Pills / languages ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; list-style: none; padding: 0; margin: 0; }
.pills li { background: var(--surface); border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-size: 15px; color: var(--muted); }

/* ---------- Support band / CTA ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: 28px; padding: 64px 32px; text-align: center;
  background: radial-gradient(500px 260px at 50% 0%, rgba(107,72,255,.45), transparent 70%), var(--surface);
  border: 1px solid rgba(143,116,255,.3);
}
.cta-band h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.025em; margin: 0 0 12px; position: relative; }
.cta-band p { color: var(--muted); max-width: 36em; margin: 0 auto 28px; position: relative; }
.cta-band .cta-row { justify-content: center; position: relative; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; color: var(--muted); font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { color: var(--text); font-size: 14px; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Content pages (privacy, terms, support…) ---------- */
.page-hero { position: relative; overflow: hidden; padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.page-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 260px at 20% 0%, rgba(107,72,255,.28), transparent 70%); }
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(34px, 5vw, 50px); letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 10px; }
.page-hero p { color: var(--muted); margin: 0; max-width: 40em; }

.prose { max-width: 760px; margin: 0 auto; padding: 48px 20px 96px; }
.prose h2 { font-size: 24px; letter-spacing: -.015em; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: 80px; }
.prose h3 { font-size: 18px; margin: 32px 0 8px; scroll-margin-top: 80px; }
.prose p, .prose li { color: #cfcfdc; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.prose strong { color: var(--text); }
.prose .meta { color: var(--muted); font-size: 14px; }
.table-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14.5px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); color: var(--text); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

.notice { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 12px; padding: 16px 20px; margin: 24px 0; }
.notice p { margin: 0; }
.notice.warn { border-left-color: var(--accent); }

.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 16px 18px 16px 60px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 0 !important; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(107,72,255,.2); color: var(--primary-soft); font-weight: 700; font-size: 14px; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 20px; margin: 10px 0; }
details[open] { border-color: rgba(143,116,255,.35); }
summary { cursor: pointer; list-style: none; padding: 18px 28px 18px 0; font-weight: 600; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 14px; font-size: 22px; color: var(--muted); transition: transform .2s ease; }
details[open] summary::after { transform: rotate(45deg); }
details > *:not(summary) { margin-top: 0; }
details > p:last-child, details > ul:last-child { padding-bottom: 18px; margin-bottom: 0; }

.release { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 24px 26px; margin: 18px 0; }
.release header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.release h2 { margin: 0 !important; padding: 0 !important; font-size: 22px; }
.release .tag { font-size: 12px; font-weight: 700; color: var(--good); background: rgba(139,195,74,.12); border: 1px solid rgba(139,195,74,.3); padding: 3px 10px; border-radius: 999px; }
.release ul { list-style: none; padding: 0 !important; margin: 14px 0 0; }
.release li { padding-left: 32px; position: relative; }
.release li .e { position: absolute; left: 0; top: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Language switcher ---------- */
.header-end { display: flex; align-items: center; gap: 8px; order: 3; }
.site-header .wrap { flex-wrap: nowrap; }
.nav { order: 2; margin-left: auto; }
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: none; }
.lang summary:hover, .lang[open] summary { color: var(--text); background: var(--surface-2); }
.lang summary svg { width: 16px; height: 16px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.8); display: grid;
}
.lang-menu a { color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 9px; font-size: 15px; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a[aria-current] { color: var(--text); font-weight: 600; }
.lang-menu a[aria-current]::after { content: " ✓"; color: var(--primary-soft); }
@media (min-width: 761px) { .header-end { margin-left: 8px; } }
details.lang { background: none; border: 0; padding: 0; margin: 0; }
@media (max-width: 760px) { .header-end { margin-left: auto; } }
.pills a { color: inherit; text-decoration: none; } .pills li:hover { color: var(--text); border-color: rgba(143,116,255,.4); }

/* ---------- Real screenshots ---------- */
.shot { margin: 0; position: relative; }
.shot img {
  display: block; width: 100%; height: auto; aspect-ratio: 720 / 1420; object-fit: cover; object-position: top;
  border-radius: 30px; background: #0d0b1f;
  border: 7px solid #1c1b29;
  box-shadow: 0 0 0 1px rgba(255,255,255,.09), 0 30px 60px -24px rgba(0,0,0,.9);
}
.shot figcaption {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; padding: 6px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
.shot.night figcaption { color: #ff6633; background: #1a0300; border-color: rgba(204,34,0,.45); }

/* Hero: dashboard in front, the "Tonight" card tilted behind */
.hero-shots { position: relative; width: min(300px, 70%); margin: 0 auto; }
.hero-shots::before {
  content: ""; position: absolute; inset: 10% -30%; z-index: 0;
  background: radial-gradient(closest-side, rgba(107,72,255,.55), transparent); filter: blur(20px);
}
.hero-shots .front { position: relative; z-index: 2; }
.hero-shots .back {
  position: absolute; z-index: 1; width: 86%; top: 7%; left: -44%;
  transform: rotate(-9deg); opacity: .9;
}
.hero-shots .back img { box-shadow: 0 30px 60px -20px rgba(0,0,0,.95); }
@media (max-width: 900px) {
  .hero-shots { width: min(260px, 66%); transform: translateX(14%); }
  .hero-shots .back { left: -40%; }
}

/* Two screenshots side by side */
.duo { display: flex; justify-content: center; align-items: flex-start; gap: 18px; padding-bottom: 24px; }
.duo .shot { width: min(250px, 47%); }
.duo .shot:nth-child(2) { margin-top: 48px; }

/* Swipeable gallery */
.gallery-section { overflow: hidden; }
.gallery {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 8px max(20px, calc((100vw - var(--max)) / 2 + 20px)) 20px;
  scroll-padding-inline: max(20px, calc((100vw - var(--max)) / 2 + 20px));
  scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent;
}
.gallery:focus-visible { outline: none; }
.gallery-item { flex: 0 0 240px; margin: 0; scroll-snap-align: start; }
.gallery-item figcaption { margin-top: 18px; }
.gallery-item strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.gallery-item span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.gallery-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.gallery-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: transparent; color: var(--text); font-size: 18px; cursor: pointer;
}
.gallery-btn:hover { background: var(--surface-2); }
@media (max-width: 620px) { .gallery-item { flex-basis: 70%; } .gallery-nav { display: none; } }
