/* ================================================================
   ANCIENT FROST GATE — GLOBAL STYLESHEET
   © 2026 株式会社エンシェントフロストゲート
   ================================================================ */

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

/* ── VARIABLES ───────────────────────────────────────────────── */
:root {
  --bg-void:       #030710;
  --bg-dark:       #060B18;
  --bg-deep:       #0A0E1A;
  --bg-surface:    #0F1628;
  --bg-card:       rgba(12, 25, 50, 0.65);
  --frost-white:   #E8F4F8;
  --frost-pale:    #C8E8F0;
  --ice-cyan:      #88CCE0;
  --ice-blue:      #4AAFE8;
  --stone-gray:    #8090A0;
  --cold-silver:   #A8B8C8;
  --cold-accent:   #A8DADC;
  --glow:          #00C4FF;
  --glow-dim:      rgba(0, 196, 255, 0.15);
  --border-frost:  rgba(168, 218, 220, 0.18);
  --border-glow:   rgba(0, 196, 255, 0.35);
  --text-primary:  #D8EEF8;
  --text-secondary:#8AAABB;
  --text-muted:    #456070;
  --font-jp:       'Noto Serif JP', 'Yu Mincho', serif;
  --font-cin:      'Cinzel', serif;
  --font-orb:      'Orbitron', sans-serif;
  --ease:          cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t:             0.4s;
  --header-h:      72px;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-jp);
  overflow-x: hidden;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--ice-cyan); border-radius: 2px; }

/* ── FROST CANVAS ────────────────────────────────────────────── */
#frostCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: 0.35;
}

/* ── HEADER ──────────────────────────────────────────────────── */
#siteHeader {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  z-index: 900;
  transition: background var(--t) var(--ease), border-color var(--t);
  border-bottom: 1px solid transparent;
}
#siteHeader.scrolled {
  background: rgba(6, 11, 24, 0.94);
  backdrop-filter: blur(24px);
  border-bottom-color: var(--border-frost);
}

/* ── LOGO ────────────────────────────────────────────────────── */
.logo-wrap { display: flex; align-items: center; gap: 0.85rem; }
.logo-svg { width: 56px; height: 44px; flex-shrink: 0; }
.logo-text-block { display: flex; flex-direction: column; gap: 0.1rem; }
.logo-en {
  font-family: var(--font-cin); font-size: 0.78rem;
  letter-spacing: 0.25em; color: var(--ice-cyan);
  text-transform: uppercase; line-height: 1;
}
.logo-jp {
  font-family: var(--font-jp); font-size: 0.6rem; font-weight: 300;
  letter-spacing: 0.12em; color: var(--stone-gray); line-height: 1.3;
}

/* ── NAV TOGGLE ──────────────────────────────────────────────── */
#navToggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 8px; z-index: 1100;
}
#navToggle span {
  display: block; width: 26px; height: 1.5px;
  background: var(--ice-cyan);
  transition: transform var(--t) var(--ease), opacity var(--t);
  transform-origin: center;
}
#navToggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#navToggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#navToggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── NAV SIDEBAR ─────────────────────────────────────────────── */
#mainNav {
  position: fixed; top: 0; right: -340px; width: 320px; height: 100%;
  background: rgba(4, 8, 20, 0.97);
  backdrop-filter: blur(30px);
  border-left: 1px solid var(--border-frost);
  z-index: 1000;
  transition: right 0.55s var(--ease);
  padding: 5.5rem 2.5rem 3rem;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
#mainNav.open { right: 0; }
#mainNav::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 200px;
  background: linear-gradient(180deg, rgba(0,196,255,0.06) 0%, transparent 100%);
  pointer-events: none;
}

.nav-header-logo { text-align: center; margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-frost); }
.nav-header-logo .nh-en { font-family: var(--font-cin); font-size: 0.85rem; letter-spacing: 0.3em; color: var(--ice-cyan); }
.nav-header-logo .nh-jp { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.2em; margin-top: 0.3rem; }

.nav-links { flex: 1; }
.nav-links li { border-bottom: 1px solid rgba(168,218,220,0.07); }
.nav-links a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 0;
  font-size: 0.88rem; letter-spacing: 0.15em;
  color: var(--text-secondary);
  transition: color 0.3s, padding-left 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ice-cyan); padding-left: 0.5rem; }
.nav-links .nav-en {
  font-family: var(--font-cin); font-size: 0.62rem;
  letter-spacing: 0.2em; color: var(--text-muted);
  transition: color 0.3s;
}
.nav-links a:hover .nav-en, .nav-links a.active .nav-en { color: var(--ice-blue); }

.nav-footer-info { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-frost); }
.nav-footer-info p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 0.3rem; }

/* ── OVERLAY ─────────────────────────────────────────────────── */
#navOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 950; opacity: 0; pointer-events: none;
  transition: opacity 0.4s; backdrop-filter: blur(4px);
}
#navOverlay.active { opacity: 1; pointer-events: all; }

/* ── MAIN ────────────────────────────────────────────────────── */
main { position: relative; z-index: 10; min-height: 100vh; padding-top: var(--header-h); }

/* ── CONTAINER ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 2.5rem; }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 2.5rem; }

/* ── TYPOGRAPHY ──────────────────────────────────────────────── */
.eyebrow {
  display: block; font-family: var(--font-cin);
  font-size: 0.65rem; letter-spacing: 0.5em; color: var(--ice-blue);
  text-transform: uppercase; margin-bottom: 1.2rem;
}
.section-title {
  font-family: var(--font-cin); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 3.5rem); letter-spacing: 0.05em;
  color: var(--frost-white); line-height: 1.2; margin-bottom: 0.6rem;
}
.section-title-jp {
  font-family: var(--font-jp); font-weight: 300;
  font-size: clamp(0.9rem, 1.8vw, 1.2rem); letter-spacing: 0.35em;
  color: var(--stone-gray); margin-bottom: 2.5rem;
}
.section-desc {
  font-size: clamp(0.82rem, 1.2vw, 0.95rem); font-weight: 300;
  color: var(--text-secondary); line-height: 2.2; max-width: 580px;
}
.text-center { text-align: center; }
.text-center .section-desc { margin: 0 auto; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-frost {
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 2.2rem;
  border: 1px solid var(--ice-cyan); color: var(--ice-cyan);
  font-family: var(--font-jp); font-size: 0.82rem; letter-spacing: 0.2em;
  background: transparent; position: relative; overflow: hidden;
  transition: color var(--t), border-color var(--t), box-shadow var(--t);
}
.btn-frost::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(168,218,220,0.12), transparent);
  opacity: 0; transition: opacity var(--t);
}
.btn-frost:hover {
  color: var(--frost-white); border-color: var(--glow);
  box-shadow: 0 0 24px var(--glow-dim);
}
.btn-frost:hover::after { opacity: 1; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem 1.8rem;
  border: 1px solid var(--border-frost); color: var(--text-secondary);
  font-family: var(--font-jp); font-size: 0.78rem; letter-spacing: 0.15em;
  background: transparent;
  transition: color var(--t), border-color var(--t);
}
.btn-ghost:hover { color: var(--ice-cyan); border-color: var(--ice-cyan); }

/* ── CARDS ───────────────────────────────────────────────────── */
.frost-card {
  background: var(--bg-card);
  border: 1px solid var(--border-frost);
  backdrop-filter: blur(12px); position: relative; overflow: hidden;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.frost-card:hover {
  border-color: rgba(168,218,220,0.45);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px var(--glow-dim);
}
.frost-card::before {
  content: ''; position: absolute; top: -1px; left: 30px; right: 30px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ice-cyan), transparent);
  opacity: 0; transition: opacity var(--t);
}
.frost-card:hover::before { opacity: 0.8; }

/* ── DIVIDERS ────────────────────────────────────────────────── */
.frost-line {
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--ice-cyan), transparent);
  opacity: 0.25; margin: 4rem 0;
}
.frost-line-short {
  width: 80px; height: 1px;
  background: linear-gradient(90deg, var(--ice-cyan), transparent);
  opacity: 0.6; margin-bottom: 1.5rem;
}

/* ── REVEAL ANIMATION ────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.85s var(--ease), transform 0.85s var(--ease); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(30px); transition: opacity 0.85s var(--ease), transform 0.85s var(--ease); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }

/* ── POPUP NOTIFICATION ──────────────────────────────────────── */
#popup {
  position: fixed; bottom: 2.5rem; right: 2.5rem;
  padding: 1rem 1.5rem; min-width: 280px; max-width: 360px;
  background: rgba(8, 15, 35, 0.96);
  border: 1px solid var(--ice-cyan); color: var(--frost-white);
  font-size: 0.82rem; letter-spacing: 0.05em; line-height: 1.6;
  z-index: 9999; opacity: 0; transform: translateY(16px) scale(0.98);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none; backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(0,196,255,0.12);
}
#popup.show { opacity: 1; transform: translateY(0) scale(1); }
#popup.popup-success { border-color: #4AE8A8; box-shadow: 0 0 30px rgba(74,232,168,0.15); }
#popup.popup-error { border-color: #E84A88; box-shadow: 0 0 30px rgba(232,74,136,0.15); }
#popup .popup-icon { margin-right: 0.5rem; }

/* ── SECTION PADDING ─────────────────────────────────────────── */
.section-pad { padding: 6rem 0; }
.section-pad-lg { padding: 8rem 0; }
.section-pad-sm { padding: 4rem 0; }

/* ── HERO BASE ───────────────────────────────────────────────── */
.hero-section {
  position: relative; width: 100%;
  min-height: 100vh; display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-attachment: fixed;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(3,7,16,0.88) 0%,
    rgba(6,11,24,0.72) 40%,
    rgba(10,20,40,0.80) 100%
  );
}
.hero-content { position: relative; z-index: 5; }

/* ── GRID LAYOUTS ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* ── IMAGE ASPECT RATIOS ─────────────────────────────────────── */
.img-16x9 { aspect-ratio: 16/9; overflow: hidden; }
.img-4x3  { aspect-ratio: 4/3;  overflow: hidden; }
.img-1x1  { aspect-ratio: 1/1;  overflow: hidden; }
.img-3x4  { aspect-ratio: 3/4;  overflow: hidden; }
.img-panel { aspect-ratio: 2/3; overflow: hidden; }
.img-wide  { aspect-ratio: 21/9; overflow: hidden; }
.img-16x9 img, .img-4x3 img, .img-1x1 img, .img-3x4 img, .img-panel img, .img-wide img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.frost-card:hover .img-16x9 img,
.frost-card:hover .img-4x3 img,
.frost-card:hover .img-1x1 img { transform: scale(1.06); }

/* ── TAG / BADGE ─────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--border-frost);
  font-size: 0.65rem; letter-spacing: 0.2em; color: var(--text-muted);
  font-family: var(--font-cin);
}
.tag.tag-active { border-color: var(--ice-cyan); color: var(--ice-cyan); }

/* ── NUMBER ACCENT ───────────────────────────────────────────── */
.num-accent {
  font-family: var(--font-orb); font-size: 0.6rem;
  color: var(--ice-blue); letter-spacing: 0.3em; opacity: 0.7;
}

/* ── GLITCH TEXT ─────────────────────────────────────────────── */
@keyframes glitch-1 {
  0%, 90%, 100% { clip-path: none; transform: none; }
  92% { clip-path: polygon(0 15%, 100% 15%, 100% 35%, 0 35%); transform: translateX(-3px); }
  94% { clip-path: polygon(0 60%, 100% 60%, 100% 75%, 0 75%); transform: translateX(3px); }
  96% { clip-path: none; transform: none; }
}
.glitch { animation: glitch-1 6s infinite; }

/* ── FROST GLOW PULSE ────────────────────────────────────────── */
@keyframes frost-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}
.frost-pulse { animation: frost-pulse 3s ease-in-out infinite; }

/* ── SCROLL INDICATOR ────────────────────────────────────────── */
.scroll-indicator {
  position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  z-index: 10;
}
.scroll-indicator span {
  font-family: var(--font-cin); font-size: 0.6rem;
  letter-spacing: 0.4em; color: var(--text-muted);
}
.scroll-line {
  width: 1px; height: 60px;
  background: linear-gradient(180deg, var(--ice-cyan), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── PAGE TITLE BAND ─────────────────────────────────────────── */
.page-title-section {
  position: relative; padding: 5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-frost);
  overflow: hidden;
}
.page-title-section::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,196,255,0.04) 0%, transparent 70%);
}
.page-number {
  font-family: var(--font-orb); font-size: 6rem; font-weight: 700;
  position: absolute; right: 2rem; bottom: -1rem;
  color: rgba(168,218,220,0.04); letter-spacing: -0.05em;
  pointer-events: none; line-height: 1; user-select: none;
}

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block; font-size: 0.75rem; letter-spacing: 0.2em;
  color: var(--text-muted); margin-bottom: 0.5rem;
  font-family: var(--font-cin);
}
.form-input, .form-textarea, .form-select {
  width: 100%; background: rgba(10,20,40,0.6);
  border: 1px solid var(--border-frost); color: var(--text-primary);
  font-size: 0.88rem; padding: 0.85rem 1.2rem; letter-spacing: 0.05em;
  outline: none; transition: border-color var(--t), box-shadow var(--t);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--ice-cyan);
  box-shadow: 0 0 0 3px rgba(136,204,224,0.08);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

/* ── FOOTER ──────────────────────────────────────────────────── */
#siteFooter {
  position: relative; z-index: 10;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-frost);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 3rem;
  padding-bottom: 3rem; border-bottom: 1px solid rgba(168,218,220,0.07);
  margin-bottom: 2rem;
}
.footer-brand .brand-en {
  font-family: var(--font-cin); font-size: 1.05rem;
  letter-spacing: 0.2em; color: var(--ice-cyan); margin-bottom: 0.25rem;
}
.footer-brand .brand-jp {
  font-family: var(--font-jp); font-size: 0.72rem;
  letter-spacing: 0.2em; color: var(--stone-gray); margin-bottom: 1rem;
}
.footer-brand p { font-size: 0.78rem; color: var(--text-muted); line-height: 2; }
.footer-col h5 {
  font-family: var(--font-cin); font-size: 0.65rem;
  letter-spacing: 0.35em; color: var(--ice-blue);
  text-transform: uppercase; margin-bottom: 1.2rem;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.08em; transition: color 0.3s; }
.footer-col ul a:hover { color: var(--ice-cyan); }
.footer-col p { font-size: 0.78rem; color: var(--text-muted); line-height: 2; }
.footer-col a.footer-email { color: var(--ice-blue); transition: color 0.3s; }
.footer-col a.footer-email:hover { color: var(--ice-cyan); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.68rem; color: var(--text-muted);
  font-family: var(--font-cin); letter-spacing: 0.12em;
}

/* ── BREADCRUMB ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2rem;
  font-family: var(--font-cin); letter-spacing: 0.15em;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.3s; }
.breadcrumb a:hover { color: var(--ice-cyan); }
.breadcrumb .sep { color: var(--border-frost); }

/* ── DECORATIVE LINES ────────────────────────────────────────── */
.deco-lines {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: 0.12;
}
.deco-lines svg { width: 100%; height: 100%; }

/* ── ICE TEXTURE ─────────────────────────────────────────────── */
.ice-bg {
  background-image:
    radial-gradient(ellipse at 15% 15%, rgba(168,218,220,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(0,196,255,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(74,175,232,0.02) 0%, transparent 60%);
}

/* ── QUOTE / LORE TEXT ───────────────────────────────────────── */
.lore-quote {
  border-left: 2px solid var(--ice-cyan); padding: 1.5rem 2rem;
  background: rgba(0,196,255,0.03); font-size: 1rem; font-weight: 300;
  color: var(--frost-pale); line-height: 2.2; letter-spacing: 0.05em;
  font-style: italic; margin: 2rem 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .container, .container-sm, .container-wide { padding: 0 1.5rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .section-pad { padding: 4rem 0; }
  .section-pad-lg { padding: 5rem 0; }
  #siteHeader { padding: 0 1.5rem; }
  #mainNav { width: 290px; padding: 5rem 2rem 2.5rem; }
  .page-number { font-size: 4rem; }
  #popup { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }
}
