:root{
  --bg-top:#0b1a35;         /* 宇宙の濃い青 */
  --bg-bottom:#02060c;      /* ほぼ黒 */
  --surface:#0f1420;        /* cards / inputs background */
  --panel:#121826;          /* darker panel */
  --text:#e7edf3;           /* main text */
  --muted:#8aa0b2;          /* secondary text */
  --line:rgba(255,255,255,.10);
  --line-strong:rgba(255,255,255,.18);
  --acc:#6bd9ff;            /* accent */
  --acc2:#a6ff6b;           /* accent 2 */
  --radius:18px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --shadow-soft:0 6px 18px rgba(0,0,0,.25);
}

/* ---------- Reset ---------- */
*{box-sizing:border-box}
html,body{height:100%}
html{ background: var(--bg-bottom); }
body{
  margin:0;
  /* ページ全体を一つのグラデーションで塗る（リピートなし） */
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100dvh;
  overflow-x:hidden;
  color:var(--text);
  font: 16px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP",
        "Hiragino Kaku Gothic ProN", "Yu Gothic", "メイリオ", sans-serif;
}
/* ほんのり星空っぽい粒子（固定） */
body::before{
  content:"";
  position:fixed; inset:0; pointer-events:none; z-index:-1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.10) 0, transparent 60%),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.08) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,.07) 0, transparent 60%),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,.06) 0, transparent 60%);
  background-repeat:no-repeat;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--acc);text-decoration:none}
a:hover{opacity:.92}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--acc); outline-offset:2px; border-radius:10px;
}
.muted{color:var(--muted)}
.small{font-size:.86rem}

/* ---------- Layout ---------- */
.container{max-width:1100px;margin:0 auto;padding:0 20px}
.section__title{font-size:1.6rem;font-weight:800;margin:0 0 .6rem}

/* ---------- Header / Nav ---------- */
header{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(8px);
  background: rgba(11,15,20,.55);
  border-bottom:1px solid var(--line);
}
.nav{display:flex;align-items:center;justify-content:space-between;height:64px}
.nav__brand{display:flex;align-items:center;gap:.6rem;font-weight:800;letter-spacing:.2px;color:var(--text)}
.nav__brand-logo{width:28px;aspect-ratio:1;border-radius:8px;
  background:conic-gradient(from 90deg, var(--acc), var(--acc2)); box-shadow:var(--shadow-soft)}
.nav__links{display:flex;align-items:center;gap:1rem}
.nav__links a{font-weight:700;color:#cfe8f7}
.nav__links a[aria-current="page"]{color:#fff;text-decoration:underline}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.6rem;
  padding:.8rem 1.1rem; border-radius:999px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color:var(--text); font-weight:700; box-shadow:var(--shadow-soft);
}
.btn--primary{background:linear-gradient(180deg, var(--acc), #4dc4ea); color:#072c3a; border-color:transparent}
.btn--ghost{background:transparent}

/* ---------- Hero ---------- */
.hero{padding:72px 0 36px}
.hero__grid{display:grid; grid-template-columns:1.2fr .8fr; gap:36px}
.tag{
  display:inline-block; padding:.3rem .75rem; border-radius:999px;
  background:rgba(107,217,255,.14); color:var(--acc); font-weight:700; font-size:.85rem
}
.hero__art{
  border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow);
  background:linear-gradient(160deg, rgba(107,217,255,.18), rgba(166,255,107,.12)); padding:20px;
  display:grid; place-items:center
}
.hero__art-placeholder{
  aspect-ratio:16/10; width:100%; border-radius:14px;
  background:repeating-linear-gradient(135deg,#1b2538,#1b2538 16px,#182033 16px,#182033 36px);
  display:grid; place-items:center; color:#b9c8d6; font-weight:700
}

/* ---------- Sections / Cards ---------- */
.cards{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px }
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid var(--line); border-radius:var(--radius);
  padding:18px; box-shadow:var(--shadow-soft)
}
.section__head{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin:22px 0}

/* ---------- Gallery ---------- */
.gallery{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px}
.card-thumb{
  border-radius:14px; border:1px solid var(--line); box-shadow:var(--shadow-soft);
  cursor:pointer; background:var(--panel);
}

/* ---------- Manual ---------- */
.manual-card img{border-radius:14px; border:1px solid var(--line); cursor:zoom-in}

/* ---------- News (画像 + タイトル) ---------- */
.news-grid{ grid-template-columns: repeat(3, 1fr) }
.news-card{ padding:0; overflow:hidden }
.news-card__link{ display:block; color:inherit }
.news-card__thumb{ aspect-ratio:16/9; width:100%; overflow:hidden; background:#0b0f14 }
.news-card__thumb img{ width:100%; height:100%; object-fit:cover; display:block }
.news-card__title{ margin:10px 12px 14px; font-size:1rem; line-height:1.4 }

/* ---------- Overlays / Modals ---------- */
.overlay{ position:fixed; inset:0; align-items:center; justify-content:center; background:rgba(0,0,0,.7); z-index:100; overflow-y:auto; padding:16px 12px; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action:pan-y }
.modal{
  max-width:1000px; width:90%; background:#0f1420;
  border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow);
  max-height:96vh; display:flex; flex-direction:column; overflow:hidden
}
.modal__grid{ display:grid; grid-template-columns:1fr 1fr; min-height:420px; flex:1 1 auto; overflow:auto }
.modal__left{ padding:16px; border-right:1px solid var(--line); display:grid; place-items:center;
  background:linear-gradient(180deg,#1b2538,#0f1420) }
.modal__left img{ max-height:70vh; width:auto }
.modal__right{ padding:18px }
.modal__right h3{ margin:0 0 8px }
.modal__foot{ display:flex; justify-content:flex-end; gap:8px; padding:12px 14px; border-top:1px solid var(--line) }

/* 画像ライトボックス */
.img-modal-inner{ position:relative; max-width:96vw; max-height:96vh }
#img-modal-img{ max-width:96vw; max-height:96vh; border-radius:12px; border:1px solid var(--line) }
.img-modal-close{ position:absolute; right:0; top:-52px }

/* ---------- Footer（別背景） ---------- */
footer{
  margin-top:48px;
  padding:48px 0;
  color:#a9bdd0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-top:1px solid var(--line);
}
.footer-grid{display:grid; grid-template-columns: 1fr; gap:16px}

/* ---------- Utilities ---------- */
.hidden{display:none !important}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .hero__grid{grid-template-columns:1fr}
  .cards{grid-template-columns:1fr 1fr}
  .gallery{grid-template-columns:1fr 1fr}
  .news-grid{grid-template-columns:1fr 1fr}
  /* ナビの詰まり・はみ出し対策 */
  .nav{flex-wrap:wrap; height:auto; row-gap:8px; padding:6px 0}
  .nav__links{flex-wrap:wrap}
  /* セクション見出しが窮屈なときは縦積み */
  .section__head{flex-wrap:wrap; align-items:flex-start}
  /* フィルター行列の可変化（inline-style上書き） */
  #filters > div{ grid-template-columns:1fr 1fr !important }
}
@media (max-width: 560px){
  .cards{grid-template-columns:1fr}
  .nav__links{gap:.7rem}
  .section__title{font-size:1.35rem}
  .img-modal-close{ top:-48px }
  /* 極小幅でナビ文言を省略表示 */
  .nav__brand span{ display:none }
  /* ナビリンクの折返し/サイズ調整 */
  .nav__links{ font-size:.95rem }
  /* フィルターを1カラムに */
  #filters > div{ grid-template-columns:1fr !important }
  /* 手引き（説明書）を縦1列に */
  #home-manual{ grid-template-columns:1fr !important }
}

/* さらに小さい端末でギャラリーを1列に */
@media (max-width: 400px){
  .gallery{ grid-template-columns:1fr }
}

/* モーダルを縦積みにして横スクロールを防止 */
@media (max-width: 760px){
  .modal__grid{ grid-template-columns:1fr }
  .modal__left{ border-right:none; border-bottom:1px solid var(--line) }
}

/* ---------- Print ---------- */
@media print{
  header, footer, #filters { filter: grayscale(1) }
  a { text-decoration: underline }
}

/* ==== Hero A4 frame ==== */
.hero__art-frame{
  width:100%;
  display:grid;
  place-items:center;
  border-radius:14px;
  border:1px solid var(--line);
  background:#0b0f14;
  box-shadow:var(--shadow-soft);
  overflow:hidden;
  /* 画面が縦に長くなりすぎないように */
  max-height:70vh;
}
.hero__art-frame img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.hero__art-frame.a4-portrait{ aspect-ratio: 210 / 297; }   /* A4縦 */
.hero__art-frame.a4-landscape{ aspect-ratio: 297 / 210; }  /* A4横 */

/* ホームの特徴セクション下にゆとりを追加 */
#features{ margin-bottom: 32px; }     /* お好みで 24〜48px に調整可 */
#home-highlights{ margin-top: 8px; }  /* ほんのり */


/* ==== Filters: dark themed form controls ==== */
#filters{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* 入力欄・セレクトの共通 */
#filters input,
#filters select{
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.02);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

#filters input::placeholder{ color: #9fb3c8; opacity: .8 }

#filters input:focus,
#filters select:focus{
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--acc) 40%, transparent);
  background: rgba(255,255,255,.08);
}

#filters input[type="number"]::-webkit-outer-spin-button,
#filters input[type="number"]::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0; }
#filters input[type="number"]{ -moz-appearance: textfield; }

#filters select{
  appearance: none;
  padding-right: 34px;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23cfe8f7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px 18px;
  background-position: right 10px center;
}

#filters label{
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}
#filters label > input{ flex: 1; }

#features{ margin-bottom: 36px; }
#filters select{
  color-scheme: dark;
}

#filters select option{
  background-color: #0b1220; /* ダークパネル色 */
  color: #e7edf3;            /* 明るい文字 */
}

#filters select option:checked{
  background-color: #162238;
  color: #ffffff;
}
