/* ============================================================
   Feelcerca Developer Site — 2026 redesign
   Single stylesheet. Dark, immersive, game-studio tone.
   Mirrors feelcerca.co.jp's fc-2026.css tokens, with a
   documentation-oriented content block (.doc) added.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg:        #0b0f16;
  --bg-2:      #0e131d;
  --panel:     #131a27;
  --panel-2:   #1a2333;
  --line:      rgba(255, 255, 255, .09);
  --line-2:    rgba(255, 255, 255, .16);

  /* Ink */
  --ink:       #eef2f8;
  --ink-soft:  #b3bdce;
  --ink-mute:  #7b8598;

  /* Brand */
  --brand:      #33a1e0;
  --brand-lite: #5cc0f5;
  --brand-deep: #1c5f86;
  --gold:       #ffce4d;
  --magenta:    #ff5c8a;

  /* Effects */
  --radius:    14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow:    0 18px 50px -18px rgba(0, 0, 0, .65);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, .6);
  --ring:      0 0 0 3px rgba(51, 161, 224, .45);

  /* Layout */
  --maxw:      1180px;
  --maxw-doc:  860px;
  --gutter:    clamp(20px, 5vw, 56px);
  --header-h:  68px;

  /* Type */
  --font-jp:      "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-display: "Outfit", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono:    "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  overflow-x: hidden;
}

body {
  min-height: 100%;
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient background glow — fixed, non-interactive */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 15% 0%,  rgba(51, 161, 224, .18), transparent 70%),
    radial-gradient(50% 40% at 100% 10%, rgba(255, 92, 138, .10), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(28, 95, 134, .16), transparent 70%),
    var(--bg);
}

img, svg, video { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: .01em;
}

p { text-wrap: pretty; }

/* Japanese locale: pack lines tight (WebKit breaks Japanese text
   conservatively, leaving a large right-edge gap otherwise). Scoped to
   running prose so it never breaks short labels or buttons. */
html[lang="ja"] p,
html[lang="ja"] li,
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  word-break: break-all;
  overflow-wrap: anywhere;
  line-break: anywhere;
}
html[lang="ja"] .doc pre,
html[lang="ja"] .doc pre code { word-break: normal; line-break: auto; }

button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

::selection { background: rgba(51, 161, 224, .35); color: #fff; }

/* ---------- Utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(48px, 8vw, 96px); }
.section--tight { padding-block: clamp(36px, 6vw, 64px); }
.center { text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-lite);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--brand);
  --_fg: #04121d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .02em;
  background: var(--_bg);
  color: var(--_fg);
  border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(51, 161, 224, .6); }
.btn:active { transform: translateY(0); }
.btn--ghost {
  --_bg: transparent;
  --_fg: var(--ink);
  border-color: var(--line-2);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .06); box-shadow: none; border-color: var(--brand); }
.btn--sm { padding: 9px 16px; font-size: .85rem; }
.btn-arrow { transition: transform .2s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(11, 15, 22, .55);
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(9, 12, 18, .82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand img { height: 30px; width: auto; display: block; }
.brand .kicker {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line-2);
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
@media (max-width: 560px) { .brand .kicker { display: none; } }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  position: relative;
  padding: 8px 12px;
  font-size: .9rem;
  color: var(--ink-soft);
  border-radius: 8px;
  transition: color .18s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a.btn { margin-left: 10px; color: var(--_fg); }
.nav a.btn::after { display: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  position: relative;
  z-index: 120;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: transform .3s var(--ease), opacity .2s var(--ease), background .3s var(--ease);
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top: 7px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateX(-50%) rotate(45deg); top: 0; }
body.nav-open .nav-toggle span::after  { transform: translateX(-50%) rotate(-45deg); top: 0; }

/* ---------- Mobile nav panel ---------- */
@media (max-width: 1040px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 4px;
    padding: 80px var(--gutter) 40px;
    margin: 0;
    background: rgba(9, 12, 18, .96);
    backdrop-filter: blur(16px);
    transform: translateY(-100%);
    transition: transform .42s var(--ease);
    overflow-y: auto;
  }
  body.nav-open .nav { transform: translateY(0); }
  .nav a {
    padding: 16px 8px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav a::after { display: none; }
  .nav a.btn {
    margin: 20px 0 0;
    align-self: flex-start;
    border-radius: var(--radius-pill);
    border-bottom: 1px solid transparent;
    font-size: .95rem;
  }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding-block: clamp(48px, 8vw, 88px) clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: .02em;
}
.page-hero h1 .en {
  display: block;
  margin-top: 10px;
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-lite);
}
.page-hero > .wrap > p { margin-top: 16px; max-width: 62ch; color: var(--ink-soft); }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .8rem;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.breadcrumb a:hover { color: var(--ink-soft); }

/* ---------- Hero (landing) ---------- */
.dev-hero {
  position: relative;
  padding-block: clamp(56px, 10vw, 120px);
  overflow: hidden;
}
.dev-hero .eyebrow { margin-bottom: 20px; }
.dev-hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.14;
  max-width: 16ch;
}
.dev-hero h1 .accent {
  background: linear-gradient(100deg, var(--brand-lite), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dev-hero p {
  margin-top: 20px;
  max-width: 54ch;
  color: var(--ink-soft);
}
.dev-hero .hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.dev-hero .hero-dragon {
  position: absolute;
  right: clamp(-12px, 2vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(140px, 24vw, 300px);
  opacity: .5;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5));
  pointer-events: none;
}
@media (max-width: 900px) { .dev-hero .hero-dragon { display: none; } }

/* ---------- Card grid (landing index) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
}
.doc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.doc-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.doc-card .tag {
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-lite);
}
.doc-card h3 { font-size: 1.15rem; }
.doc-card p { font-size: .92rem; color: var(--ink-soft); flex: 1; }
.doc-card .go {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.doc-card .go::after { content: " →"; color: var(--brand-lite); }

/* ---------- Link list ---------- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.link-list a:hover {
  transform: translateX(4px);
  border-color: var(--brand);
  background: rgba(51, 161, 224, .08);
}
.link-list a::after { content: "↗"; color: var(--brand-lite); }
.link-list a.internal::after { content: "→"; }

/* ---------- Documentation content (.doc) ---------- */
.doc {
  max-width: var(--maxw-doc);
  margin-inline: auto;
}
.doc > *:first-child { margin-top: 0; }

.doc p { margin: 0 0 1.2rem; color: var(--ink-soft); }
.doc p strong, .doc li strong { color: var(--ink); font-weight: 700; }
.doc a:not(.btn) {
  color: var(--brand-lite);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(92, 192, 245, .4);
}
.doc a:not(.btn):hover { color: var(--brand); text-decoration-color: currentColor; }

.doc h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  margin: 2.8rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.doc h2 .en {
  font-family: var(--font-display);
  font-size: .55em;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-left: 10px;
}
.doc h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  margin: 2rem 0 .8rem;
  color: var(--ink);
}
.doc h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-right: .6em;
  vertical-align: -.15em;
  background: var(--brand);
  border-radius: 2px;
}
.doc h4 {
  font-size: 1.02rem;
  margin: 1.6rem 0 .6rem;
  color: var(--brand-lite);
  letter-spacing: .02em;
}
.doc h5 {
  font-size: .82rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 1.4rem 0 .5rem;
}
.doc h6 {
  font-size: .8rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-mute);
  margin: 1.2rem 0 .4rem;
}

.doc ul, .doc ol { margin: 0 0 1.3rem; padding-left: 1.4rem; }
.doc li { margin-bottom: .55rem; color: var(--ink-soft); }
.doc li::marker { color: var(--brand); }
.doc ul ul, .doc ol ol, .doc ul ol, .doc ol ul { margin: .5rem 0 .3rem; }
.doc ol { counter-reset: doc-ol; list-style: none; padding-left: 0; }
.doc ol > li {
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: .9rem;
}
.doc ol > li::before {
  counter-increment: doc-ol;
  content: counter(doc-ol);
  position: absolute;
  left: 0;
  top: .15em;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  color: var(--brand-lite);
  background: rgba(51, 161, 224, .12);
  border: 1px solid var(--line-2);
  border-radius: 50%;
}
.doc ol > li ul { list-style: disc; padding-left: 1.2rem; }
.doc ol ol { counter-reset: none; }

.doc code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: .15em .45em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-lite);
  word-break: break-word;
}
.doc pre {
  margin: 0 0 1.4rem;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.65;
}
.doc pre code {
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: .86rem;
}

.doc blockquote {
  margin: 0 0 1.4rem;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--brand);
  color: var(--ink-mute);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: .92rem;
}
.doc th, .doc td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc th {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-lite);
}
.doc td { color: var(--ink-soft); }

.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }

.doc figure { margin: 0 0 1.6rem; }
.doc figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.doc figcaption {
  margin-top: 8px;
  font-size: .8rem;
  color: var(--ink-mute);
  text-align: center;
}

.doc .lead {
  font-size: 1.06rem;
  color: var(--ink);
}
.doc .callout {
  margin: 0 0 1.6rem;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  font-size: .92rem;
}

/* ---------- Centered message state (thanks / 404) ---------- */
.state {
  min-height: 52vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
  padding-block: clamp(60px, 12vw, 140px);
}
.state h1 { font-size: clamp(2rem, 6vw, 3rem); }
.state p { max-width: 46ch; margin-inline: auto; color: var(--ink-soft); }
.state .btn { justify-self: center; margin-top: 10px; }
.state .code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 14vw, 8rem);
  line-height: 1;
  background: linear-gradient(120deg, var(--brand-lite), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Forms ---------- */
.form {
  max-width: 40rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.field .note { color: var(--magenta); font-size: .78rem; font-weight: 400; }
.field input,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(51, 161, 224, .25);
}
.field textarea { resize: vertical; min-height: 170px; }
.form .btn { align-self: flex-start; border: 0; }
.form-note { max-width: 40rem; margin: 0 auto 26px; font-size: .88rem; color: var(--ink-mute); }

/* ---------- SNS row ---------- */
.sns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.sns a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-2);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .03em;
  transition: transform .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.sns a:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: var(--brand);
  background: rgba(51, 161, 224, .1);
}
.sns svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(60px, 9vw, 120px);
  padding-top: clamp(44px, 7vw, 76px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(4, 8, 14, .6));
  overflow: hidden;
}
.site-footer .wrap { position: relative; z-index: 1; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand .brand img { height: 34px; }
.footer-brand p { font-size: .88rem; color: var(--ink-mute); max-width: 34ch; }
.footer-col h4 {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  padding: 6px 0;
  font-size: .9rem;
  color: var(--ink-soft);
  transition: color .18s var(--ease);
}
.footer-col a:hover { color: var(--brand-lite); }
.footer-bottom {
  margin-top: clamp(32px, 5vw, 52px);
  padding-block: 24px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--ink-mute);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-bottom a:hover { color: var(--ink-soft); }
.footer-watermark {
  position: absolute;
  right: -4%;
  bottom: -34%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 22vw, 20rem);
  line-height: 1;
  letter-spacing: -.03em;
  color: rgba(255, 255, 255, .022);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.trademarks {
  margin-top: 24px;
  font-size: .72rem;
  line-height: 1.7;
  color: var(--ink-mute);
}
.trademarks summary {
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: .04em;
  color: var(--ink-mute);
  list-style: none;
}
.trademarks summary::-webkit-details-marker { display: none; }
.trademarks summary::before { content: "▸ "; }
.trademarks[open] summary::before { content: "▾ "; }
.trademarks p { margin-top: 10px; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s;
  z-index: 90;
}
.to-top.is-visible { opacity: 1; transform: translateY(0); }
.to-top:hover { background: var(--brand); color: #04121d; }

/* ---------- Scroll reveal (only when JS is active) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }
.reveal:nth-child(4) { transition-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
