/* Rase — shared styles (rase.jp / mod.rase.jp)
   Default: dark (near-black indigo) + mint. Light is opt-in via the toggle.
   Flat colours only. Motion respects prefers-reduced-motion. */
:root {
  --bg: #0E0D1B;
  --panel: #17152B;
  --text: #F4F3FF;
  --sub: #BDB9DC;
  --line: #2B2850;
  --accent: #4FD1C5;
  --accent-ink: #4FD1C5;
  --btn-text: #0E0D1B;
  --danger: #FF6B6B;
}
:root[data-theme="light"] {
  --bg: #F4F3FF;
  --panel: #FFFFFF;
  --text: #1E1B3A;
  --sub: #4A4670;
  --line: #CFCBEB;
  --accent-ink: #086158;
  --btn-text: #1E1B3A;
  --danger: #B42318;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  animation: page-in .5s ease both;
}
a { color: var(--accent-ink); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

/* scroll progress */
.progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 60;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
}

/* header / footer */
.site-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line);
}
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand small { display: block; font-size: .8rem; font-weight: 400; color: var(--sub); }
.head-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.head-actions a {
  color: var(--text); text-decoration: none; font-size: .95rem; padding: 2px 0;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 2px;
  transition: background-size .25s ease, color .2s;
}
.head-actions a:hover, .head-actions a[aria-current="page"] { background-size: 100% 2px; color: var(--accent-ink); }
.theme-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .85rem; cursor: pointer;
  transition: border-color .2s;
}
.theme-btn:hover { border-color: var(--accent); }

.site-foot { border-top: 1px solid var(--line); margin-top: 16px; padding: 28px 0 40px; color: var(--sub); font-size: .9rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* bottom navigation (phones) */
.bottom-nav { display: none; }

/* sections */
.block { padding: 64px 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
.split > header { max-width: 720px; }
.split > header h2 { margin-top: 8px; }
.split > header p { margin-top: 12px; }

.label {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-ink);
}
h1, h2, h3 { line-height: 1.3; margin: 0; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--sub); }
.small { font-size: .9rem; }

/* hero */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: end; padding: 80px 0 56px; }
.hero.stack { display: block; }
.hero h1 { font-size: clamp(4rem, 12vw, 8rem); letter-spacing: -.03em; line-height: 1; }
.hero h1 .ch { display: inline-block; animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.hero h1 .ch.dot-ch { color: var(--accent); }
.hero .lead { font-size: 1.25rem; margin-bottom: 20px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* marquee */
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.marquee-track { display: inline-flex; animation: marquee 32s linear infinite; }
.marquee-group { display: inline-flex; gap: 48px; padding: 14px 24px; color: var(--sub); font-weight: 700; letter-spacing: .08em; }
.marquee-group i { font-style: normal; color: var(--accent); }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* buttons & links */
.btn {
  display: inline-block; background: var(--accent); color: var(--btn-text);
  padding: 12px 20px; border-radius: 8px; text-decoration: none; font-weight: 700;
  transition: transform .2s ease, filter .2s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px;
  transition: transform .25s ease, border-color .25s ease;
}
a.card:hover, .card.hoverable:hover { transform: translateY(-4px); border-color: var(--accent); }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.grid2 { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.card .num { font-size: .8rem; color: var(--accent-ink); font-weight: 700; letter-spacing: .14em; }
.card .arrow { display: inline-block; transition: transform .25s ease; }
a.card:hover .arrow { transform: translateX(6px); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: .8rem; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--sub); }

/* status (minecraft.js writes .online-dot / .offline-dot) */
.status { display: flex; align-items: center; flex-wrap: wrap; gap: .3em .6em; font-weight: 700; }
.online-dot, .dot { width: .6em; height: .6em; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: .45em; animation: pulse 2s ease-out infinite; }
.offline-dot, .dot.off { background: var(--danger); animation: none; }

/* timeline */
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.tl { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.tl time { display: block; font-weight: 700; font-size: 1.2rem; color: var(--accent-ink); margin-bottom: 8px; }
.tl time span { display: block; font-weight: 400; color: var(--sub); font-size: .9rem; }
.tl.future time { color: var(--sub); }
.tl.blank { background: transparent; border-style: dashed; }

/* link list */
.linklist { display: grid; gap: 10px; }
.linklist a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; text-decoration: none; color: var(--text);
  transition: transform .2s ease, border-color .2s ease;
}
.linklist a:hover { border-color: var(--accent); transform: translateX(4px); }
.linklist span { color: var(--sub); font-size: .9rem; }

/* log */
.log-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.log-item { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.log-item b { color: var(--accent-ink); font-size: 1.05rem; }
.log-item span { display: block; color: var(--sub); font-size: .85rem; }

/* ads */
.ad-slot { border: 1px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.ad-sp { display: none; }

/* scroll reveal (only hidden when JS is running) */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-d="1"] { transition-delay: .08s; }
.js .reveal[data-d="2"] { transition-delay: .16s; }
.js .reveal[data-d="3"] { transition-delay: .24s; }
.js .reveal[data-d="4"] { transition-delay: .32s; }

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(60%); } to { opacity: 1; transform: none; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 209, 197, .55); }
  70%, 100% { box-shadow: 0 0 0 .6em rgba(79, 209, 197, 0); }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* responsive */
@media (max-width: 960px) {
  body { font-size: 16px; padding-bottom: 72px; }
  .wrap { padding: 0 20px; }
  .split, .hero { grid-template-columns: 1fr; gap: 24px; }
  .split { gap: 20px; }
  .cards, .cards-4, .cards-2, .grid2 { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .log-item { grid-template-columns: 1fr; gap: 4px; }
  .block { padding: 44px 0; }
  .hero { padding: 48px 0 36px; }
  .head-actions a { display: none; }
  .ad-pc { display: none; }
  .ad-sp { display: block; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    flex: 1; text-align: center; padding: 12px 4px; font-size: .78rem; font-weight: 700;
    color: var(--sub); text-decoration: none;
  }
  .bottom-nav a[aria-current="page"] { color: var(--accent-ink); box-shadow: inset 0 3px 0 var(--accent); }
}
@media (min-width: 961px) and (max-width: 1100px) {
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
}

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

/* ===== fonts ===== */
:root {
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --font-en: "Space Grotesk", "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
body { font-family: var(--font-jp); }
h1, h2, h3, .brand, .label, .btn, .head-actions a, .theme-btn, .bottom-nav a,
.tl time, .log-item b, .card .num, .tag, .marquee-group { font-family: var(--font-en); }
h1, h2, h3 { font-feature-settings: "palt"; }
h1, h2 { font-weight: 700; }
.hero h1 { font-weight: 700; letter-spacing: -.04em; }

/* ===== more motion (all disabled by prefers-reduced-motion below) ===== */

/* drifting dot grid behind everything */
body { position: relative; overflow-x: hidden; }
body::before {
  content: ""; position: fixed; inset: -60px; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--line) 1.3px, transparent 1.6px);
  background-size: 30px 30px; opacity: .6;
  animation: drift 26s linear infinite;
}
@keyframes drift { to { transform: translate(30px, 30px); } }

/* hero: floating flat shapes */
.hero { position: relative; }
.hero-main { position: relative; z-index: 1; }
.floaters { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaters i { position: absolute; display: block; }
.floaters .f1 { width: 120px; height: 120px; border: 2px solid var(--accent); border-radius: 50%; right: 8%; top: 12%; opacity: .55; animation: float-a 9s ease-in-out infinite; }
.floaters .f2 { width: 44px; height: 44px; background: var(--accent); right: 24%; bottom: 14%; opacity: .85; animation: float-b 7s ease-in-out infinite, spin 18s linear infinite; }
.floaters .f3 { width: 18px; height: 18px; border-radius: 50%; background: var(--text); right: 4%; bottom: 30%; opacity: .5; animation: float-a 5.5s ease-in-out infinite reverse; }
.floaters .f4 { width: 70px; height: 70px; border: 2px dashed var(--sub); right: 34%; top: 8%; opacity: .5; transform: rotate(45deg); animation: spin 28s linear infinite reverse; }
@keyframes float-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -22px; } }
@keyframes float-b { 0%, 100% { translate: 0 0; } 50% { translate: -16px 14px; } }
@keyframes spin { to { rotate: 360deg; } }

/* the dot after RASE bobs; letters react to hover */
.hero h1 .dot-ch { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both, bob 2.4s ease-in-out 1.4s infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.12em; } }
.hero h1 .ch { transition: translate .25s ease, color .25s ease; }
.hero h1 .ch:hover { translate: 0 -.1em; color: var(--accent); }

/* primary CTA pulses */
.btn.pulse { animation: pulse 2.4s ease-out infinite; }

/* second marquee: outline text, opposite direction */
.marquee.rev .marquee-track { animation-direction: reverse; animation-duration: 46s; }
.marquee.outline { border-top: 0; }
.marquee.outline .marquee-group { font-size: clamp(2rem, 6vw, 4.5rem); line-height: 1.1; padding: 18px 24px; letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1px var(--sub); }
.marquee.outline .marquee-group i { color: var(--accent); -webkit-text-stroke: 0; font-size: .5em; align-self: center; }

/* heading underline sweeps in when revealed */
.js .reveal h2::after {
  content: ""; display: block; height: 3px; width: 0; margin-top: 10px; background: var(--accent);
  transition: width .8s ease .35s;
}
.js .reveal.in h2::after { width: 56px; }

/* cards: accent edge slides in on hover */
.card { position: relative; overflow: hidden; }
.card::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
a.card:hover::after, .card.hoverable:hover::after { transform: scaleX(1); }

/* timeline cards rise one after another */
.timeline .tl:nth-child(odd) { animation: tl-float 7s ease-in-out infinite; }
.timeline .tl:nth-child(even) { animation: tl-float 7s ease-in-out -3.5s infinite; }
@keyframes tl-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

/* leaving a page */
body.leaving { opacity: 0; transition: opacity .22s ease; }

/* ad block */
.ad-block[hidden] { display: none; }

@media (max-width: 960px) {
  .floaters .f1 { width: 70px; height: 70px; right: 4%; top: 6%; }
  .floaters .f2 { width: 28px; height: 28px; right: 12%; }
  .floaters .f4 { display: none; }
  .marquee.outline .marquee-group { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none !important; }
  body.leaving { opacity: 1; }
}

/* keep decorative shapes clear of the text and buttons */
.floaters .f2 { right: 6%; bottom: 10%; }
.floaters .f3 { right: 3%; top: 55%; bottom: auto; }
@media (max-width: 960px) {
  .floaters .f2, .floaters .f3, .floaters .f4 { display: none; }
  .floaters .f1 { opacity: .35; }
}
