/* ========================================
   Sacred Temple Riddle Institute
   神聖寺謎解き研究所 — Global Styles
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;600;700&family=Noto+Sans+JP:wght@300;400;500&display=swap');

:root {
  --bg-primary:    #06040c;
  --bg-secondary:  #0e0a18;
  --bg-card:       #140f22;
  --bg-card-hover: #1c1530;
  --gold:          #c9a252;
  --gold-light:    #e8c97a;
  --gold-dim:      #7a6030;
  --red:           #8b1a1a;
  --red-light:     #c42a2a;
  --text-primary:  #e8e0d0;
  --text-secondary:#a89880;
  --text-muted:    #6a5a48;
  --border-gold:   rgba(201,162,82,0.35);
  --glow-gold:     rgba(201,162,82,0.18);
  --glow-red:      rgba(139,26,26,0.25);
  --font-serif:    'Noto Serif JP', 'Yu Mincho', serif;
  --font-sans:     'Noto Sans JP', 'Hiragino Sans', sans-serif;
  --radius:        4px;
  --transition:    0.35s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
::selection { background: var(--gold); color: var(--bg-primary); }

/* ────── NAVIGATION ────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(180deg,rgba(6,4,12,.97) 0%,rgba(6,4,12,.82) 100%);
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.nav-logo {
  font-family: var(--font-serif); font-size: 1rem; font-weight: 700;
  color: var(--gold); text-decoration: none; letter-spacing: .05em;
  text-shadow: 0 0 18px rgba(201,162,82,.6); white-space: nowrap;
}
.nav-logo span { color: var(--red-light); }
.nav-links { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-links li a {
  display: block; padding: 8px 11px; font-size: .75rem; font-family: var(--font-sans);
  color: var(--text-secondary); text-decoration: none; letter-spacing: .04em;
  transition: color var(--transition); white-space: nowrap;
}
.nav-links li a:hover, .nav-links li a.active {
  color: var(--gold-light); text-shadow: 0 0 10px rgba(201,162,82,.5);
}
.nav-cta a {
  background: linear-gradient(135deg,var(--red) 0%,var(--red-light) 100%);
  color: var(--gold-light) !important; border-radius: var(--radius);
  padding: 7px 14px !important; border: 1px solid rgba(201,162,82,.4);
  transition: all var(--transition) !important;
}
.nav-cta a:hover { box-shadow: 0 0 20px var(--glow-red); transform: translateY(-1px); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; background: none; border: none; padding: 4px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--gold); border-radius: 2px; transition: all var(--transition); }

/* ────── HERO ────── */
.hero {
  position: relative; min-height: 92vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden; padding: 100px 24px 60px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.28) saturate(.6); transform: scale(1.04);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%,rgba(139,26,26,.12) 0%,transparent 70%),
              linear-gradient(180deg,rgba(6,4,12,.25) 0%,rgba(6,4,12,.75) 100%);
}
.hero-ornament { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-ornament::before, .hero-ornament::after {
  content: ''; position: absolute; border: 1px solid rgba(201,162,82,.12); border-radius: 50%;
  animation: pulse-ring 6s ease-in-out infinite;
}
.hero-ornament::before { width: 600px; height: 600px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.hero-ornament::after  { width: 900px; height: 900px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 2s; }
@keyframes pulse-ring {
  0%,100% { opacity: .2; transform: translate(-50%,-50%) scale(1); }
  50%     { opacity: .06; transform: translate(-50%,-50%) scale(1.05); }
}
.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero-badge {
  display: inline-block; font-size: .72rem; letter-spacing: .25em; color: var(--gold);
  border: 1px solid var(--border-gold); padding: 5px 18px; border-radius: 2px;
  margin-bottom: 28px; text-transform: uppercase; background: rgba(201,162,82,.06);
}
.hero-title {
  font-family: var(--font-serif); font-size: clamp(2.2rem,5vw,3.8rem);
  font-weight: 700; line-height: 1.25; color: var(--text-primary);
  margin-bottom: 20px; letter-spacing: .04em;
}
.hero-title .accent { color: var(--gold); text-shadow: 0 0 30px rgba(201,162,82,.5); }
.hero-subtitle { font-size: clamp(.95rem,2vw,1.15rem); color: var(--text-secondary); max-width: 580px; margin: 0 auto 40px; letter-spacing: .05em; }
.hero-divider { width: 80px; height: 1px; background: linear-gradient(90deg,transparent,var(--gold),transparent); margin: 0 auto 40px; }

/* ────── BUTTONS ────── */
.btn {
  display: inline-block; padding: 14px 36px; font-family: var(--font-serif);
  font-size: .95rem; letter-spacing: .1em; text-decoration: none;
  border-radius: var(--radius); border: none; cursor: pointer;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg,#7a1515 0%,var(--red-light) 50%,#9a2020 100%);
  color: var(--gold-light); border: 1px solid rgba(201,162,82,.45);
  box-shadow: 0 4px 24px rgba(139,26,26,.4),inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(139,26,26,.6),0 0 60px rgba(201,162,82,.15); border-color: rgba(201,162,82,.7); }
.btn-secondary { background: transparent; color: var(--gold); border: 1px solid var(--border-gold); }
.btn-secondary:hover { background: rgba(201,162,82,.08); transform: translateY(-2px); box-shadow: 0 4px 20px var(--glow-gold); }
.btn-ghost { background: rgba(20,15,34,.7); color: var(--text-secondary); border: 1px solid rgba(168,152,128,.25); }
.btn-ghost:hover { color: var(--gold-light); border-color: var(--border-gold); }

/* ────── SECTIONS ────── */
.section { padding: 100px 24px; position: relative; }
.section-inner { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-eyebrow { font-size: .72rem; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; margin-bottom: 14px; }
.section-title { font-family: var(--font-serif); font-size: clamp(1.7rem,3.5vw,2.6rem); font-weight: 700; color: var(--text-primary); margin-bottom: 16px; letter-spacing: .05em; }
.section-divider { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 18px auto 24px; }
.section-divider::before { content: ''; flex: 1; max-width: 120px; height: 1px; background: linear-gradient(90deg,transparent,var(--gold-dim)); }
.section-divider::after  { content: ''; flex: 1; max-width: 120px; height: 1px; background: linear-gradient(90deg,var(--gold-dim),transparent); }
.divider-symbol { color: var(--gold); font-size: 1.1rem; }
.section-desc { color: var(--text-secondary); font-size: 1rem; max-width: 600px; margin: 0 auto; letter-spacing: .04em; }
.section-alt { background: var(--bg-secondary); }
.glow-line { width: 100%; height: 1px; background: linear-gradient(90deg,transparent 0%,var(--gold-dim) 30%,var(--gold) 50%,var(--gold-dim) 70%,transparent 100%); opacity: .4; }

/* ────── CARDS ────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 28px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 6px;
  padding: 36px 28px; position: relative; overflow: hidden; transition: all var(--transition);
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,transparent,var(--gold),transparent); opacity: 0; transition: opacity var(--transition); }
.card:hover { background: var(--bg-card-hover); border-color: rgba(201,162,82,.6); transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.5),0 0 30px var(--glow-gold); }
.card:hover::before { opacity: 1; }
.card-icon { font-size: 2.2rem; margin-bottom: 18px; display: block; }
.card-title { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gold-light); margin-bottom: 12px; letter-spacing: .05em; }
.card-text { font-size: .9rem; color: var(--text-secondary); line-height: 1.9; }
.card-tag { display: inline-block; margin-top: 16px; padding: 3px 12px; font-size: .72rem; border: 1px solid var(--border-gold); border-radius: 2px; color: var(--gold); letter-spacing: .1em; }

/* ────── IMAGE BLOCK ────── */
.img-block { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--border-gold); box-shadow: 0 8px 40px rgba(0,0,0,.6); }
.img-block img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; filter: brightness(.85) saturate(.8); }
.img-block:hover img { transform: scale(1.03); filter: brightness(.9) saturate(.9); }
.img-block::after { content: ''; position: absolute; inset: 0; border: 1px solid rgba(201,162,82,.2); border-radius: 5px; pointer-events: none; }

/* ────── TWO-COL ────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.two-col.reverse .col-img { order: -1; }

/* ────── BG PATTERN ────── */
.bg-pattern { position: absolute; inset: 0; pointer-events: none; opacity: .025; background-image: repeating-linear-gradient(0deg,transparent,transparent 40px,rgba(201,162,82,1) 40px,rgba(201,162,82,1) 41px),repeating-linear-gradient(90deg,transparent,transparent 40px,rgba(201,162,82,1) 40px,rgba(201,162,82,1) 41px); }

/* ────── STATS ────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--border-gold); border: 1px solid var(--border-gold); border-radius: 6px; overflow: hidden; margin-top: 64px; }
.stat-item { background: var(--bg-card); padding: 32px 20px; text-align: center; transition: background var(--transition); }
.stat-item:hover { background: var(--bg-card-hover); }
.stat-num { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 700; color: var(--gold); text-shadow: 0 0 20px rgba(201,162,82,.4); display: block; }
.stat-label { font-size: .8rem; color: var(--text-muted); letter-spacing: .08em; margin-top: 6px; }

/* ────── ACCORDION ────── */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc-item { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 4px; overflow: hidden; }
.acc-header { width: 100%; background: none; border: none; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left; font-family: var(--font-serif); font-size: 1rem; color: var(--text-primary); letter-spacing: .04em; transition: color var(--transition); }
.acc-header:hover { color: var(--gold-light); }
.acc-arrow { flex-shrink: 0; width: 20px; height: 20px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform var(--transition); margin-left: 16px; }
.acc-item.open .acc-arrow { transform: rotate(225deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .4s ease,padding .4s ease; padding: 0 24px; font-size: .92rem; color: var(--text-secondary); line-height: 1.9; }
.acc-item.open .acc-body { max-height: 400px; padding: 0 24px 20px; }

/* ────── CONTACT FORM ────── */
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: .82rem; color: var(--gold); letter-spacing: .1em; }
.form-group input, .form-group textarea, .form-group select { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: var(--radius); padding: 12px 16px; color: var(--text-primary); font-family: var(--font-sans); font-size: .92rem; outline: none; transition: border-color var(--transition),box-shadow var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--gold); box-shadow: 0 0 12px var(--glow-gold); }
.form-group textarea { min-height: 140px; resize: vertical; }
.form-group select option { background: var(--bg-card); }

/* ────── BADGE ────── */
.badge { display: inline-block; padding: 4px 14px; font-size: .72rem; letter-spacing: .12em; border-radius: 2px; font-family: var(--font-sans); }
.badge-gold { background: rgba(201,162,82,.12); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-red  { background: rgba(139,26,26,.2); color: var(--red-light); border: 1px solid rgba(139,26,26,.4); }

/* ────── RANK TABLE ────── */
.rank-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 6px; overflow: hidden; }
.rank-table th { background: rgba(201,162,82,.08); padding: 14px 20px; font-family: var(--font-serif); font-size: .82rem; letter-spacing: .12em; color: var(--gold); text-align: left; border-bottom: 1px solid var(--border-gold); }
.rank-table td { padding: 14px 20px; font-size: .9rem; color: var(--text-secondary); border-bottom: 1px solid rgba(201,162,82,.08); }
.rank-table tr:last-child td { border-bottom: none; }
.rank-table tr:hover td { background: rgba(201,162,82,.04); color: var(--text-primary); }
.rank-num { font-family: var(--font-serif); color: var(--gold); font-weight: 700; }
.rank-1 { color: #FFD700 !important; }
.rank-2 { color: #C0C0C0 !important; }
.rank-3 { color: #CD7F32 !important; }

/* ────── ACHIEVEMENTS ────── */
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 20px; }
.achievement { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 6px; padding: 24px 16px; text-align: center; transition: all var(--transition); }
.achievement:hover { transform: translateY(-3px); box-shadow: 0 8px 24px var(--glow-gold); border-color: var(--gold); }
.achievement-icon { font-size: 2rem; margin-bottom: 10px; }
.achievement-name { font-size: .78rem; color: var(--gold); letter-spacing: .06em; }

/* ────── POLICY ────── */
.policy-content { max-width: 800px; margin: 0 auto; }
.policy-section { margin-bottom: 48px; padding-bottom: 48px; border-bottom: 1px solid rgba(201,162,82,.12); }
.policy-section:last-child { border-bottom: none; }
.policy-h2 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--gold-light); margin-bottom: 16px; padding-left: 16px; border-left: 3px solid var(--red-light); letter-spacing: .04em; }
.policy-h3 { font-family: var(--font-serif); font-size: 1.05rem; color: var(--text-primary); margin: 20px 0 10px; }
.policy-p { font-size: .92rem; color: var(--text-secondary); line-height: 1.95; margin-bottom: 12px; }
.policy-list { list-style: none; padding-left: 0; }
.policy-list li { font-size: .92rem; color: var(--text-secondary); padding: 6px 0 6px 24px; position: relative; line-height: 1.8; }
.policy-list li::before { content: '◈'; position: absolute; left: 0; color: var(--gold-dim); font-size: .75rem; top: 9px; }

/* ────── RIDDLE CARD ────── */
.riddle-card { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 8px; padding: 48px 40px; text-align: center; position: relative; overflow: hidden; }
.riddle-card::before { content: '謎'; position: absolute; font-family: var(--font-serif); font-size: 200px; color: rgba(201,162,82,.03); top: -30px; right: -20px; pointer-events: none; line-height: 1; }
.riddle-number { font-size: .72rem; letter-spacing: .25em; color: var(--gold-dim); margin-bottom: 16px; }
.riddle-question { font-family: var(--font-serif); font-size: clamp(1.1rem,2.5vw,1.5rem); color: var(--text-primary); line-height: 1.7; margin-bottom: 32px; }
.riddle-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; margin: 0 auto 28px; }
.riddle-option { background: var(--bg-secondary); border: 1px solid rgba(168,152,128,.25); border-radius: 4px; padding: 12px 20px; font-size: .9rem; color: var(--text-secondary); cursor: pointer; transition: all var(--transition); text-align: center; }
.riddle-option:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(201,162,82,.06); }

/* ────── DIFFICULTY ────── */
.difficulty { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.difficulty-label { font-size: .75rem; color: var(--text-muted); letter-spacing: .06em; }
.difficulty-dots { display: flex; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-secondary); border: 1px solid var(--border-gold); }
.dot.active { background: var(--gold); box-shadow: 0 0 6px rgba(201,162,82,.6); }
.dot.active.hard { background: var(--red-light); box-shadow: 0 0 6px rgba(196,42,42,.6); }

/* ────── PAGE HERO ────── */
.page-hero { padding: 140px 24px 80px; text-align: center; position: relative; overflow: hidden; }
.page-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.2) saturate(.5); }
.page-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg,rgba(6,4,12,.3) 0%,rgba(6,4,12,.85) 100%); }
.page-hero-content { position: relative; z-index: 2; }

/* ────── FOOTER ────── */
.site-footer { background: var(--bg-secondary); border-top: 1px solid var(--border-gold); padding: 64px 24px 32px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand h3 { font-family: var(--font-serif); font-size: 1.1rem; color: var(--gold); margin-bottom: 12px; letter-spacing: .06em; }
.footer-brand p { font-size: .83rem; color: var(--text-muted); line-height: 1.85; }
.footer-col h4 { font-family: var(--font-serif); font-size: .85rem; color: var(--gold); letter-spacing: .12em; margin-bottom: 16px; text-transform: uppercase; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { font-size: .83rem; color: var(--text-muted); text-decoration: none; transition: color var(--transition); letter-spacing: .03em; }
.footer-col ul li a:hover { color: var(--gold-light); }
.footer-bottom { padding-top: 28px; border-top: 1px solid rgba(201,162,82,.12); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-bottom p { font-size: .78rem; color: var(--text-muted); letter-spacing: .04em; }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { font-size: .78rem; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.footer-legal a:hover { color: var(--gold); }

/* ────── KANJI WATERMARK ────── */
.kanji-bg { position: absolute; font-family: var(--font-serif); font-size: clamp(120px,20vw,220px); font-weight: 700; color: rgba(201,162,82,.025); pointer-events: none; user-select: none; line-height: 1; }

/* ────── TEXT HELPERS ────── */
.text-gold { color: var(--gold); }
.text-red  { color: var(--red-light); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 32px; }
.mt-lg { margin-top: 64px; }

/* ────── ANIMATIONS ────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glow-pulse { 0%,100% { text-shadow: 0 0 20px rgba(201,162,82,.4); } 50% { text-shadow: 0 0 40px rgba(201,162,82,.8),0 0 60px rgba(201,162,82,.3); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.animate-fade-up { animation: fadeInUp .8s ease forwards; }
.animate-glow    { animation: glow-pulse 3s ease-in-out infinite; }
.animate-float   { animation: float 4s ease-in-out infinite; }

/* ────── RESPONSIVE ────── */
@media (max-width:960px) {
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .two-col.reverse .col-img { order: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
}
@media (max-width:768px) {
  .nav-links { display: none; position: fixed; top: 68px; left: 0; right: 0; background: rgba(6,4,12,.98); flex-direction: column; padding: 20px 0; border-bottom: 1px solid var(--border-gold); }
  .nav-links.open { display: flex; }
  .nav-links li a { padding: 12px 32px; font-size: .9rem; }
  .nav-toggle { display: flex; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .riddle-options { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width:480px) {
  .section { padding: 70px 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .btn { padding: 12px 28px; font-size: .88rem; }
}
