:root {
  --bg: #0b0f14;
  --fg: #e8edf2;
  --muted: #b2bdc8;
  --accent: #7ad1ff;
  --accent-2: #a17dff;
  --card: #101621;
  --card-2: #0e1420;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
  --container: clamp(280px, 92vw, 1200px);
  --step--1: clamp(.78rem, .74rem + .2vw, .92rem);
  --step-0: clamp(.95rem, .9rem + .5vw, 1.05rem);
  --step-1: clamp(1.2rem, 1.05rem + .9vw, 1.4rem);
  --step-2: clamp(1.6rem, 1.4rem + 1.5vw, 2rem);
  --step-3: clamp(2.2rem, 1.8rem + 3vw, 3.2rem);
  --step-4: clamp(3rem, 2.2rem + 4vw, 4.2rem);
}

[data-theme="light"] {
  --bg: #f7f9fb;
  --fg: #111418;
  --muted: #3a4754;
  --card: #ffffff;
  --card-2: #f1f5f9;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font: 400 var(--step-0)/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% 10%, #0f1724 0%, transparent 60%) no-repeat,
              radial-gradient(1200px 800px at 90% 0%, #1a2233 0%, transparent 60%) no-repeat,
              var(--bg);
  color: var(--fg);
  overscroll-behavior-y: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.section { padding: 5rem 0; }
h1,h2,h3 { margin: 0 0 1rem; font-weight: 700; }
h1 { font-size: var(--step-4); letter-spacing: 0.5px; }
h2 { font-size: var(--step-2); }
p { margin: 0 0 1rem; color: var(--muted); }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
  background: color-mix(in oklab, var(--bg), transparent 35%);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--fg); }
.brand-text { font-size: 1.05rem; letter-spacing: .4px; }
.site-nav { display: none; gap: 1rem; }
.site-nav a { padding: .35rem .6rem; border-radius: 999px; }
.site-nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }

.actions { display: flex; gap: .5rem; justify-self: end; }
.btn {
  background: linear-gradient(180deg, #1a2233, #121826);
  color: var(--fg); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: .5rem .8rem; cursor: pointer;
  box-shadow: var(--shadow); font-weight: 600;
}
.btn:active { transform: translateY(1px); }

.hero {
  position: relative; min-height: 92svh; overflow: clip;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-overlay {
  position: relative; z-index: 2; width: var(--container); margin: 0 auto; padding: 22vh 1rem 8vh;
}
.tagline { max-width: 60ch; }
.cta {
  display: inline-block; margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071218; font-weight: 800; padding: .8rem 1.1rem; border-radius: 14px;
  box-shadow: var(--shadow);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; align-items: stretch;
}

/* video badge */
.thumb-wrap { position: relative; }
.badge-play {
  position: absolute; left: 8px; top: 8px;
  background: rgba(0,0,0,.55);
  color: #fff; border: 1px solid rgba(255,255,255,.35);
  padding: .2rem .5rem; border-radius: 999px; font-size: 12px;
  letter-spacing: .3px; backdrop-filter: blur(6px);
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  overflow: clip; box-shadow: var(--shadow);
  display: grid; grid-template-rows: auto auto; transition: transform .25s ease;
}
.card:hover { transform: translateY(-3px); }
.card .thumb { aspect-ratio: 16/10; object-fit: cover; width: 100%; display: block; }
.card .meta { padding: .9rem 1rem; }
.card .title { font-weight: 700; color: var(--fg); margin: 0 0 .25rem; }
.card .sub { font-size: var(--step--1); color: var(--muted); }

.links { display: grid; gap: .5rem; padding-left: 1rem; }
.links a { text-decoration: underline; }

.site-footer { padding: 2rem 0 3rem; border-top: 1px solid rgba(255,255,255,.06); }
.footer-grid { display: grid; gap: .4rem; }
#year { font-variant-numeric: tabular-nums; }

@media (min-width: 840px) {
  .site-nav { display: flex; justify-self: center; }
  .hero-overlay { padding-top: 26vh; }
}

/* Ulrawide nicety */
@media (min-aspect-ratio: 21/9) {
  .hero-overlay { padding-top: 30vh; }
}

/* Reduced motion: pause subtle animations handled in JS */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}

/* ========== Lightbox (背景ぼかしモーダル) ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center;
  padding: 2rem 1rem;
  background: color-mix(in oklab, #000, transparent 55%);
  backdrop-filter: blur(10px) saturate(130%);
}
.lightbox.open { display: grid; }
.lightbox__panel {
  width: min(1120px, 92vw);
  max-height: 86vh;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  animation: lb-in .24s ease both;
}
@keyframes lb-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lightbox__close {
  position: absolute;
  margin: .5rem;
  right: 0; top: 0;
  transform: translateY(6px) translateX(-6px);
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, #1a2233, #121826);
  color: var(--fg);
  border-radius: 12px;
  padding: .45rem .6rem;
  cursor: pointer;
  z-index: 2;
}
.lightbox__media {
  background: #0a0f17;
  display: grid; place-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
/* Lightbox: hidden を確実に非表示にする（画像の代替テキストが見えないように） */
.lightbox__media [hidden] {
  display: none !important;
}

.lightbox__media img {
  width: 100%;
  height: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.lightbox__media iframe {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  display: block;
  background: #000;
}

.lightbox__body {
  display: grid; gap: .6rem;
  padding: 1rem 1.25rem 1.25rem;
}
.lb-title { font-size: clamp(1.2rem, 1rem + .8vw, 1.8rem); color: var(--fg); }
.lb-sub { color: var(--muted); font-size: var(--step--1); }
.lb-desc { color: var(--fg); }
.lb-linkwrap a {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071218; font-weight: 800; padding: .55rem .8rem; border-radius: 10px;
  text-decoration: none;
}

@media (min-width: 900px) {
  .lightbox__panel {
    grid-template-columns: 60% 40%;
    grid-template-rows: auto;
  }
  .lightbox__media { border-bottom: none; border-right: 1px solid rgba(255,255,255,.06); }
}
