:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f2f2f2;
  --muted: #8a8a8a;
  --accent: #ff2d2d;
  --border: rgba(255, 255, 255, 0.14);
  --field-bg: rgba(255, 255, 255, 0.04);
  --field-focus: rgba(255, 45, 45, 0.08);
  --font-display:
    "Space Grotesk", "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  /* 100dvh: モバイルのアドレスバー出没で下端が切れるのを防ぐ */
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* トップページのみ 1 画面に収める。下層ページはスクロールさせる */
body.home {
  height: 100dvh;
  overflow: hidden;
}

/* 下層ページ共通のレイアウト */
body.page {
  font-weight: 300;
  align-items: center;
  padding: 6rem 1.5rem 5rem;
}

body.page--center {
  justify-content: center;
  padding-top: 5rem;
  padding-bottom: 3rem;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 2px;
  z-index: 100;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------------
   右下から画面に染み出す赤いグラデーション。
   静止画なので要素は 1 つ、背景レイヤーの重ねだけで作る。
   レイヤーは上に書いたものが手前。

   grain: 広い面のグラデーションは 8bit の階調不足で同心円状のバンディングが
          出るため、微細なノイズを重ねてディザリングする。
          レイヤー単位に opacity は指定できないので SVG 側に焼き込んでいる
   core:  芯になる濃い部分
   spread:外側へ広がる薄い層。深い赤に寄せて奥行きを出す
   floor: 画面下端を持ち上げる帯。右下の塊が浮かないよう地を作る
   ------------------------------------------------------------------ */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E"),
    radial-gradient(
      46vmax 46vmax at 86% 96%,
      rgba(255, 78, 52, 0.26) 0%,
      rgba(255, 48, 34, 0.12) 38%,
      rgba(255, 28, 22, 0.04) 62%,
      rgba(255, 25, 20, 0) 78%
    ),
    radial-gradient(
      80vmax 80vmax at 95% 106%,
      rgba(255, 52, 40, 0.14) 0%,
      rgba(196, 26, 32, 0.06) 44%,
      rgba(128, 16, 26, 0.02) 64%,
      rgba(90, 12, 22, 0) 80%
    ),
    linear-gradient(
      to top,
      rgba(255, 45, 35, 0.09) 0%,
      rgba(255, 36, 28, 0.035) 24%,
      rgba(255, 30, 25, 0) 52%
    );
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
}

/* ------------------------------------------------------------------
   トップページ
   ------------------------------------------------------------------ */
.hero {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.site-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.75rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0;
}

.site-name .red {
  color: var(--accent);
  font-weight: 500;
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 0;
  font-size: 0.875rem;
}

.footer a {
  color: #cccccc;
  text-decoration: none;
}

.footer a:hover {
  color: #ff4040;
}

.footer .divider {
  margin: 0 0.75em;
  color: #555555;
}

/* ------------------------------------------------------------------
   下層ページ共通パーツ
   ------------------------------------------------------------------ */
#home-link {
  position: fixed;
  top: 1rem;
  right: 1.2rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: rgba(242, 242, 242, 0.3);
  text-decoration: none;
  transition: color 0.2s;
  z-index: 10;
}

#home-link:hover,
#home-link:focus-visible {
  color: var(--ink);
}

#home-link .red {
  color: var(--accent);
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
}

.container--narrow {
  max-width: 480px;
}

/* スキップリンクの着地点。プログラム的なフォーカスなので枠は出さない */
[tabindex="-1"]:focus {
  outline: none;
}

.heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

.heading .red {
  color: var(--accent);
}
