/* ==========================================================================
   FrostKey landing page
   1. Tokens   2. Base   3. Language switch   4. Layout   5. Header
   6. Hero   7. Stick   8. Cards   9. Compare, roadmap, mission   10. Footer
   ========================================================================== */


/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #000;
  --fg: #f2f2f2;
  --muted: #8c8c8c;
  --line: #2a2a2a;
  --accent: #f26a0f;
  --accent-glow: rgba(242, 106, 15, 0.4);

  --font-en: "Michroma", "Eurostile", Arial, sans-serif;    /* Latin headings */
  --font-ru: "Unbounded", "Russo One", Arial, sans-serif;        /* Cyrillic headings */
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Active heading font and weight; switched to Russian values in section 3 */
  --head: var(--font-en);
  --head-weight: 400;

  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}


/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: inherit; }

html { scroll-padding-top: env(safe-area-inset-top, 0); }

body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--font-body);
  text-align: center;
  overflow-x: hidden;
}

/* Faint grid that fades out toward the edges */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 18%, #000, transparent);
          mask-image: radial-gradient(ellipse 60% 50% at 50% 18%, #000, transparent);
}

h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: var(--head-weight);
  line-height: 1.25;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }


/* 3. Language switch (no JavaScript) ---------------------------------------
   The radio inputs sit before everything else in <body>, so the :checked
   state can reach every later element through the "~" sibling selector.   */
.switch {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#en:checked ~ * .ru,
#ru:checked ~ * .en { display: none; }

/* Russian headings use Unbounded (Michroma has no Cyrillic).
   Unbounded is very wide, so Russian headings are set a little smaller. */
#ru:checked ~ header,
#ru:checked ~ main,
#ru:checked ~ footer {
  --head: var(--font-ru);
  --head-weight: 400;
}
#ru:checked ~ main h1 { font-size: clamp(1.4rem, 4.4vw, 2.5rem); line-height: 1.3; letter-spacing: 0; }
#ru:checked ~ main h2 { font-size: 0.95rem; }
#ru:checked ~ main h3 { font-size: 0.8rem; }


/* 4. Layout ---------------------------------------------------------------- */
.wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Each section is introduced by a thin orange vertical stem */
.section { padding-bottom: 4.5rem; }

.section::before {
  content: "";
  display: block;
  width: 1px;
  height: 4rem;
  margin: 0 auto 2.5rem;
  background: linear-gradient(var(--accent), transparent);
}

.section h2 { font-size: 1.1rem; }

.note {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.btn {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.9rem 2.4rem;
  background: var(--accent);
  color: #000;
  font-weight: 500;
  text-decoration: none;
  /* cut corners */
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.btn:hover { background: var(--fg); }


/* 5. Header (language buttons) --------------------------------------------- */
.lang {
  display: inline-flex;
  margin-top: 1.5rem;
  border: 1px solid var(--line);
}

.lang label {
  padding: 0.3rem 0.9rem;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

#en:checked ~ header label[for="en"],
#ru:checked ~ header label[for="ru"] {
  background: var(--fg);
  color: var(--bg);
}

#en:focus-visible ~ header label[for="en"],
#ru:focus-visible ~ header label[for="ru"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* 6. Hero ------------------------------------------------------------------ */
.hero { padding-top: 4rem; padding-bottom: 3rem; }

.hero__mark {
  display: block;
  width: 128px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 28px var(--accent-glow));
}

.hero__word {
  margin-top: 1.5rem;
  padding-left: 0.7em;            /* balances the trailing letter-spacing */
  font: 400 1rem var(--font-en);
  letter-spacing: 0.7em;
}

.hero h1 {
  max-width: 18ch;
  margin: 3.5rem auto 0;
  font-size: clamp(1.8rem, 5.5vw, 3.2rem);
}

.hero__lead {
  max-width: 32rem;
  margin: 1.5rem auto 0;
  color: var(--muted);
}


/* 7. Stick, built from blocks ---------------------------------------------- */
.stick {
  display: flex;
  gap: 6px;
  max-width: 46rem;
  height: clamp(64px, 13vw, 104px);
  margin: 2.5rem auto 0;
}

.stick > * {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: clamp(0.55rem, 1.6vw, 0.8rem);
}

.stick__module {
  flex: 1;
  border: 1px solid #3a3a3a;
  border-bottom: 2px solid var(--accent);
}

.stick__core {
  flex: 3.2;
  border: 1px solid #3a3a3a;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  font: 400 clamp(0.6rem, 1.8vw, 0.95rem) var(--font-en);
  text-shadow: 0 0 14px var(--accent-glow);
  box-shadow: 0 0 36px rgba(242, 106, 15, 0.15);
}

/* Dashed empty slots: "there are more modules" */
.stick__more {
  flex: 0.6;
  border: 1px dashed #3a3a3a;
}

@media (max-width: 600px) {
  .stick__more:last-child { display: none; }
}


/* 8. Cards with corner brackets -------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.card {
  position: relative;
  padding: 2rem 1.5rem;
  border: 1px solid var(--line);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
}
.card::before { top: -1px;    left: -1px;  border-right: 0; border-bottom: 0; }
.card::after  { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; }

.card h3 { font-size: 0.95rem; }

.card p {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}


/* 9. Compare, roadmap, mission ------------------------------------ */
.mission p {
  max-width: 34rem;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* "Today" vs "FrostKey" */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.panel { position: relative; padding: 2rem 1.5rem; border: 1px solid var(--line); }
.panel h3 { font-size: 0.95rem; }
.panel--no h3 { color: var(--muted); }
.panel ul { margin: 1.25rem 0 0; padding: 0; list-style: none; }
.panel li { padding: 0.35rem 0; }
.panel--no li { color: var(--muted); }
.panel li::before { margin-right: 0.6rem; }
.panel--no li::before  { content: "\2715"; color: var(--muted); }
.panel--yes li::before { content: "\2713"; color: var(--accent); }

/* Roadmap: a line of diamonds, the current stage glows */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}
.step {
  position: relative;
  display: block;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.step::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--muted);
  transform: translateX(-50%) rotate(45deg);
}
.step--now { color: var(--accent); }
.step--now::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.step b {
  display: block;
  margin-bottom: 0.6rem;
  font: 400 0.85rem var(--head);
}
.step p {
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .steps { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1rem; }
}

/* Links inside cards */
.card a {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}
.card a:hover { color: var(--fg); }


/* 10. Footer --------------------------------------------------------------- */
.footer {
  padding: 1rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer__mark {
  display: block;
  width: 32px;
  height: auto;
  margin: 0 auto 1.25rem;
  opacity: 0.7;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  margin-bottom: 1.25rem;
}

.footer__links a {
  color: var(--fg);
  text-decoration: none;
}
.footer__links a:hover { color: var(--accent); }
