@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #070b17;
  --bg-2: #0b1224;
  --line: #1d2a4a;
  --text: #dbe1ee;
  --muted: #8f9ab3;
  --ember-rgb: 255 138 61;
  --sans: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans CJK JP", system-ui, sans-serif;
  --gutter: max(16px, calc((100% - 1080px) / 2));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  background:
    radial-gradient(1200px 700px at 78% 8%, rgb(var(--ember-rgb) / 0.08), transparent 60%),
    radial-gradient(900px 600px at 10% 40%, rgba(60, 90, 170, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 50%, var(--bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-break: strict;
  word-break: auto-phrase;
}

/* Scoped to main so the toggle always shows both languages. */
:root[data-lang="en"] main [lang="ja"],
:root[data-lang="ja"] main [lang="en"] { display: none !important; }

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

#embers {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.site-header, main, .site-footer { position: relative; z-index: 1; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
}
.brand { font-weight: 600; font-size: 17px; }

.lang-toggle { display: flex; gap: 14px; }
.lang-toggle button {
  font: inherit; font-size: 14px; color: var(--muted);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
}
/* data-lang, not aria-pressed, so it's right before main.js runs. */
.lang-toggle button:hover,
:root[data-lang="en"] [data-set-lang="en"],
:root[data-lang="ja"] [data-set-lang="ja"] { color: var(--text); }

main { flex: 1; padding: 0 var(--gutter); }

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

.intro { padding: clamp(56px, 14vh, 140px) 0 clamp(48px, 10vh, 112px); max-width: 38em; text-wrap: balance; }
.intro h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 500; line-height: 1.4; }
.intro p { margin-top: 12px; font-size: 18px; color: var(--muted); text-wrap: wrap; }
.clause { display: inline-block; }
.nowrap { white-space: nowrap; }

.work { padding: 40px 0 48px; border-top: 1px solid var(--line); }
h2 { margin-bottom: 24px; font-size: 14px; font-weight: 500; color: var(--muted); }
h3 { font-size: 16px; font-weight: 600; }
.when { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

.project { max-width: 760px; }
.project p { margin-top: 4px; color: var(--muted); text-wrap: pretty; }
.shot {
  display: block; width: 100%; height: auto; margin-bottom: 16px; border-radius: 6px;
  background: var(--bg-2); box-shadow: 0 0 0 1px var(--line);
  filter: brightness(0.85); transition: filter 0.3s;
}
.shot:hover { filter: none; }

.site-footer { padding: 72px var(--gutter) 40px; text-align: center; font-size: 14px; color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.links { display: flex; justify-content: center; gap: 20px; }

.campfire { position: relative; margin-bottom: 28px; }
.campfire::before {
  content: ""; position: absolute; left: 50%; top: -30px; width: 180px; height: 100px; margin-left: -90px;
  background: radial-gradient(closest-side, rgb(var(--ember-rgb) / 0.16), transparent);
  animation: glow 2.2s ease-in-out infinite alternate;
}
.bonfire {
  position: relative; display: block; width: 40px; height: 40px; margin: 0 auto;
  filter: drop-shadow(0 0 6px rgb(var(--ember-rgb) / 0.5));
}
.bonfire .flame { transform-origin: 16px 25px; animation: flicker 2.2s ease-in-out infinite alternate; }
.bonfire .core { animation-duration: 1.3s; }
.bonfire-lit {
  position: relative; margin-top: 10px; padding-left: 0.25em;
  font: 13px Georgia, "Times New Roman", serif; letter-spacing: 0.25em; text-transform: uppercase;
  color: #f0c674; text-shadow: 0 0 10px rgb(var(--ember-rgb) / 0.6);
}
@keyframes flicker {
  0% { transform: scale(1, 1); }
  40% { transform: scale(0.95, 1.06); }
  100% { transform: scale(1.03, 0.96); }
}
@keyframes glow { from { opacity: 0.6; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bonfire .flame, .campfire::before { animation: none; } }
