/* ===================================================
   QUEST — クイズサークル公式サイト
   完全リデザイン v2.0
   =================================================== */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* ── CSS Custom Properties ── */
:root {
  /* Brand */
  --quest-blue:    #0b1e3d;
  --quest-accent:  #1a56f0;
  --quest-bright:  #3b82f6;
  --quest-gold:    #f5a623;
  --quest-teal:    #06b6d4;

  /* Light mode */
  --bg:            #f7f8fc;
  --bg-2:          #ffffff;
  --bg-3:          #eef1f8;
  --text:          #111827;
  --text-2:        #4b5563;
  --text-3:        #9ca3af;
  --border:        rgba(0,0,0,.08);
  --border-2:      rgba(0,0,0,.14);
  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow-md:     0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:     0 12px 48px rgba(0,0,0,.12);
  --hero-bg:       #07162f;
  --hero-text:     #ffffff;
  --hero-sub:      rgba(255,255,255,.7);
  --card-bg:       #ffffff;
  --nav-bg:        rgba(255,255,255,.92);
  --nav-border:    rgba(0,0,0,.07);
  --badge-bg:      rgba(26,86,240,.1);
  --badge-text:    #1a56f0;
  --tag-blue:      #dbeafe;
  --tag-blue-t:    #1d4ed8;
  --tag-green:     #d1fae5;
  --tag-green-t:   #065f46;
  --tag-amber:     #fef3c7;
  --tag-amber-t:   #92400e;
  --input-bg:      #f9fafb;
  --input-border:  #d1d5db;
  --input-focus:   #1a56f0;
}
body.dark {
  --bg:            #0d111b;
  --bg-2:          #131926;
  --bg-3:          #1a2236;
  --text:          #f1f5f9;
  --text-2:        #94a3b8;
  --text-3:        #64748b;
  --border:        rgba(255,255,255,.07);
  --border-2:      rgba(255,255,255,.12);
  --shadow-sm:     0 1px 4px rgba(0,0,0,.3);
  --shadow-md:     0 4px 20px rgba(0,0,0,.35);
  --shadow-lg:     0 12px 48px rgba(0,0,0,.5);
  --hero-bg:       #040b18;
  --card-bg:       #131926;
  --nav-bg:        rgba(13,17,27,.9);
  --nav-border:    rgba(255,255,255,.06);
  --badge-bg:      rgba(59,130,246,.15);
  --badge-text:    #60a5fa;
  --tag-blue:      rgba(59,130,246,.2);
  --tag-blue-t:    #93c5fd;
  --tag-green:     rgba(16,185,129,.15);
  --tag-green-t:   #6ee7b7;
  --tag-amber:     rgba(245,158,11,.15);
  --tag-amber-t:   #fcd34d;
  --input-bg:      #1e2a3f;
  --input-border:  #334155;
  --input-focus:   #3b82f6;
}

/* ── Skip link ── */
.skip-link {
  position: fixed; top: 1rem; left: 1rem; z-index: 999;
  background: var(--quest-accent); color: #fff;
  padding: .5rem 1rem; border-radius: 6px;
  transform: translateY(-200%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

/* ── Site Notice ── */
.site-notice {
  background: var(--quest-accent);
  color: #fff;
  font-size: .8125rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: .04em;
  padding: .55rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.site-notice span { font-weight: 700; opacity: .8; }
.site-notice a { opacity: .9; text-decoration: underline; transition: opacity .2s; }
.site-notice a:hover { opacity: 1; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--nav-border);
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 2rem; height: 64px;
  transition: background .3s, border-color .3s;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  flex-shrink: 0;
}
.brand b {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--quest-accent);
  line-height: 1;
}
.brand small {
  font-size: .6875rem;
  color: var(--text-2);
  line-height: 1.4;
  display: none;
}
@media (min-width: 900px) { .brand small { display: block; } }

.desktop-nav {
  display: none;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}
@media (min-width: 900px) { .desktop-nav { display: flex; } }
.desktop-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: .4rem .75rem;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.desktop-nav a:hover { color: var(--text); background: var(--bg-3); }
.desktop-nav a.active { color: var(--quest-accent); }

.header-actions {
  display: flex; align-items: center; gap: .75rem;
  margin-left: auto;
}
@media (min-width: 900px) { .header-actions { margin-left: 0; } }

.theme-button {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text-2);
  border: 1px solid var(--border-2);
  transition: background .2s, color .2s, border-color .2s;
}
.theme-button:hover { background: var(--bg-3); color: var(--text); }

.join-button {
  display: none;
  font-size: .8125rem; font-weight: 700;
  letter-spacing: .04em;
  background: var(--quest-accent); color: #fff;
  padding: .5rem 1.125rem; border-radius: 100px;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
.join-button:hover { opacity: .88; transform: translateY(-1px); }
@media (min-width: 680px) { .join-button { display: inline-flex; } }

.menu-button {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; width: 36px; height: 36px;
  border-radius: 6px; color: var(--text);
  transition: background .2s;
}
.menu-button:hover { background: var(--bg-3); }
.menu-button i {
  width: 20px; height: 2px;
  background: currentColor;
  display: block; border-radius: 1px;
  transition: transform .3s, opacity .3s;
}
.menu-button[aria-expanded="true"] i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-button[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) { .menu-button { display: none; } }

/* ── Mobile Menu ── */
.mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99;
  background: var(--bg-2);
  padding: 80px 2rem 2rem;
  display: flex; flex-direction: column; gap: .5rem;
  overflow-y: auto;
  animation: slideDown .3s ease;
}
.mobile-menu[hidden] { display: none; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-menu a {
  font-size: 1.125rem; font-weight: 500;
  color: var(--text); padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  display: block; transition: color .2s;
}
.mobile-menu a:hover { color: var(--quest-accent); }
.mobile-menu .join-button {
  display: inline-flex; margin-top: 1rem;
  font-size: .9375rem; padding: .75rem 1.5rem;
  border-radius: 100px;
}
@media (min-width: 900px) { .mobile-menu { display: none !important; } }

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.content { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--quest-accent); margin-bottom: .5rem;
}
.section-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 1.5rem;
  margin-bottom: 2.5rem; flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800; line-height: 1.25;
  color: var(--text);
}
.text-link {
  font-size: .875rem; font-weight: 600;
  color: var(--quest-accent);
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .4rem 0; border-bottom: 1px solid transparent;
  transition: border-color .2s;
  white-space: nowrap;
}
.text-link:hover { border-color: var(--quest-accent); }
.prose { color: var(--text-2); line-height: 1.85; }
.prose + .prose { margin-top: 1rem; }

/* ── Buttons ── */
a.primary, button.primary, .btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--quest-accent); color: #fff;
  font-size: .9375rem; font-weight: 700;
  padding: .75rem 1.75rem; border-radius: 100px;
  transition: opacity .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(26,86,240,.3);
}
a.primary:hover, button.primary:hover, .btn-primary:hover {
  opacity: .9; transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(26,86,240,.4);
}
a.secondary, button.secondary, .btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: transparent; color: var(--text);
  font-size: .9375rem; font-weight: 700;
  padding: .75rem 1.75rem; border-radius: 100px;
  border: 1.5px solid var(--border-2);
  transition: background .2s, border-color .2s, transform .2s;
}
a.secondary:hover, button.secondary:hover, .btn-secondary:hover {
  background: var(--bg-3); border-color: var(--text-3);
  transform: translateY(-1px);
}

/* ── Badge & Tag ── */
.badge {
  font-family: 'DM Mono', monospace;
  font-size: .6875rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--badge-bg); color: var(--badge-text);
  padding: .2rem .6rem; border-radius: 100px;
  display: inline-flex; align-items: center;
}
.tag {
  font-family: 'DM Mono', monospace;
  font-size: .6875rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 4px;
  display: inline-block;
}
.tag-notice, .tag[data-tag="NOTICE"] { background: var(--tag-blue); color: var(--tag-blue-t); }
.tag-activity, .tag[data-tag="ACTIVITY"] { background: var(--tag-green); color: var(--tag-green-t); }
.tag-report, .tag[data-tag="REPORT"] { background: var(--tag-amber); color: var(--tag-amber-t); }
.tag-update { background: var(--tag-amber); color: var(--tag-amber-t); }
.tag-event { background: var(--tag-blue); color: var(--tag-blue-t); }

/* ── Hero ── */
.hero {
  background: var(--hero-bg);
  color: var(--hero-text);
  min-height: calc(100svh - 90px);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(26,86,240,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(6,182,212,.1) 0%, transparent 60%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%; max-width: 1140px;
  margin: 0 auto; padding: 5rem 1.5rem 4rem;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1fr 1fr; padding: 6rem 1.5rem 5rem; }
}
.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: .75rem; letter-spacing: .16em;
  opacity: .55; margin-bottom: 1rem;
  text-transform: uppercase;
}
.hero h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 700; line-height: .95;
  letter-spacing: -.01em; margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--quest-bright), var(--quest-teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-lead {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--hero-sub); line-height: 1.75;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-visual {
  display: flex; align-items: center; justify-content: center;
}
.hero-mark {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(8rem, 18vw, 14rem);
  font-weight: 700;
  color: rgba(255,255,255,.04);
  line-height: 1; user-select: none;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.hero-stats {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 2rem; margin-top: 3rem;
}
.hero-stat { }
.hero-stat b {
  font-family: 'Oswald', monospace;
  font-size: 2rem; font-weight: 700;
  display: block; color: #fff; line-height: 1;
}
.hero-stat span { font-size: .8125rem; opacity: .55; }

/* ── Page Hero ── */
.page-hero {
  background: var(--hero-bg); color: #fff;
  padding: 5rem 1.5rem 4.5rem;
}
.page-hero .content { max-width: 720px; }
.page-hero .section-label { color: rgba(255,255,255,.5); }
.page-hero h1 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1.1;
  margin-bottom: 1rem;
}
.page-hero p { font-size: 1.0625rem; opacity: .75; }

/* ── Find Grid ── */
.find-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.find-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem 1.5rem;
  transition: box-shadow .25s, transform .25s, border-color .25s;
  display: flex; flex-direction: column; gap: .5rem;
  cursor: pointer;
}
.find-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--quest-accent);
}
.find-card .number {
  font-family: 'DM Mono', monospace;
  font-size: .75rem; font-weight: 700;
  color: var(--quest-accent); display: block;
  margin-bottom: .25rem;
}
.find-card h3 {
  font-size: 1.0625rem; font-weight: 800;
  color: var(--text); margin-bottom: .25rem;
}
.find-card p { font-size: .875rem; color: var(--text-2); flex: 1; }
.find-card strong {
  font-size: .8125rem; font-weight: 700;
  color: var(--quest-accent); display: block;
  margin-top: .75rem;
}

/* ── Session Block ── */
.session-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.session-main {
  display: grid; grid-template-columns: 1fr auto;
  gap: 1.5rem; align-items: start;
  padding: 2rem; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
@media (max-width: 640px) { .session-main { grid-template-columns: 1fr; } }
.session-date {
  font-family: 'DM Mono', monospace;
  font-size: .8rem; letter-spacing: .1em;
  color: var(--quest-accent); margin-bottom: .75rem;
}
.session-main h3 {
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: .5rem; color: var(--text);
}
.session-main p { font-size: .9375rem; color: var(--text-2); }
.session-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
@media (min-width: 640px) { .session-details { grid-template-columns: repeat(4, 1fr); } }
.session-details > div {
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.session-details > div:last-child,
.session-details > div:nth-child(2) { border-right: none; }
@media (min-width: 640px) {
  .session-details > div:nth-child(2) { border-right: 1px solid var(--border); }
  .session-details > div:last-child { border-right: none; }
}
.session-details span {
  font-family: 'DM Mono', monospace;
  font-size: .6875rem; letter-spacing: .1em;
  color: var(--text-3); display: block; margin-bottom: .3rem;
}
.session-details b { font-size: .9rem; font-weight: 700; color: var(--text); }

/* ── News / Activity Log ── */
.news-list { display: flex; flex-direction: column; gap: .5rem; }
.news-row {
  display: grid;
  grid-template-columns: 100px auto 1fr auto;
  gap: .75rem 1.25rem; align-items: center;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: box-shadow .2s, transform .2s;
}
@media (max-width: 600px) {
  .news-row { grid-template-columns: 1fr; gap: .4rem; }
  .news-row time { font-size: .75rem; }
}
.news-row:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.news-row time {
  font-family: 'DM Mono', monospace;
  font-size: .8rem; color: var(--text-3);
}
.news-row b { font-size: .9375rem; font-weight: 700; color: var(--text); }
.news-row .arrow { color: var(--text-3); }

/* ── Schedule Cards ── */
.schedule-list { display: flex; flex-direction: column; gap: 1rem; }
.schedule-card {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
  padding: 1.5rem 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: box-shadow .25s, transform .25s, border-color .25s;
  cursor: pointer;
}
@media (max-width: 640px) {
  .schedule-card { grid-template-columns: 1fr; }
  .schedule-card .arrow { display: none; }
}
.schedule-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--quest-accent);
}
.schedule-card time {
  font-family: 'DM Mono', monospace;
  font-size: .8125rem; font-weight: 500;
  color: var(--quest-accent);
}
.schedule-card h3 { font-size: 1rem; font-weight: 700; margin: .3rem 0 .2rem; }
.schedule-card p { font-size: .875rem; color: var(--text-2); }
.schedule-card .arrow { color: var(--text-3); font-size: 1.125rem; }

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.article-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: box-shadow .25s, transform .25s;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.article-card h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.article-card p { font-size: .875rem; color: var(--text-2); flex: 1; }
.article-card time { font-family: 'DM Mono', monospace; font-size: .75rem; color: var(--text-3); margin-top: auto; }

/* ── Split / Two-column ── */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 760px) {
  .split { grid-template-columns: 1fr 1fr; align-items: start; }
}
.split h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 1rem; color: var(--text);
}

/* ── Check list ── */
.check-list { display: flex; flex-direction: column; gap: .75rem; }
.check-list li {
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .9375rem; color: var(--text-2);
}
.check-list li::before {
  content: '✓';
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--quest-accent), var(--quest-bright));
  color: #fff; font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; margin-top: .1rem;
}

/* ── Member Grid ── */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.member {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  text-align: center;
  transition: box-shadow .25s, transform .25s;
}
.member:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--quest-accent), var(--quest-teal));
  color: #fff; font-family: 'Oswald', sans-serif;
  font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
}
.member h3 { font-size: 1rem; font-weight: 800; color: var(--text); }
.member .meta { font-size: .8rem; color: var(--text-3); }
.member p { font-size: .875rem; color: var(--text-2); }

/* ── Guide Grid ── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.guide-grid > div {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
  position: relative;
}
.guide-grid > div > span {
  font-family: 'DM Mono', monospace;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; color: var(--quest-accent);
  display: block; margin-bottom: .75rem;
}
.guide-grid h3 { font-size: 1.0625rem; font-weight: 800; margin-bottom: .5rem; color: var(--text); }
.guide-grid p { font-size: .875rem; color: var(--text-2); margin-bottom: 1rem; }

/* ── CTA section ── */
.cta {
  background: linear-gradient(135deg, #071a3e 0%, #0f2d6b 100%);
  color: #fff; border-radius: 24px; margin: 3rem 0;
  padding: 4rem 2rem; text-align: center;
  position: relative; overflow: hidden;
}
.cta::before {
  content: '?';
  position: absolute; right: -1rem; top: -1rem;
  font-family: 'Oswald', sans-serif;
  font-size: 14rem; font-weight: 700;
  color: rgba(255,255,255,.03); line-height: 1;
  user-select: none;
}
.cta .section-label { color: rgba(255,255,255,.5); margin-bottom: .75rem; }
.cta h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800; margin-bottom: 1rem; line-height: 1.2;
}
.cta p { opacity: .75; max-width: 500px; margin: 0 auto 2rem; font-size: 1rem; }

/* ── Form ── */
.form-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 2.5rem;
  max-width: 780px;
}
.form-wrap h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }
.form-note { font-size: .875rem; color: var(--text-2); margin-bottom: 2rem; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field span {
  font-size: .8125rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: .35rem;
}
.field span em { color: #e53e3e; font-style: normal; font-size: .75rem; }
.field span small { font-size: .75rem; color: var(--text-3); font-weight: 400; }
.field input, .field select, .field textarea {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  padding: .65rem .85rem;
  font-size: .9375rem; font-family: inherit;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(26,86,240,.12);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem; padding-right: 2.5rem; }
.submit {
  margin-top: 1.5rem;
  background: var(--quest-accent); color: #fff;
  font-size: .9375rem; font-weight: 700;
  padding: .8rem 2rem; border-radius: 100px;
  display: inline-flex; align-items: center; gap: .5rem;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 14px rgba(26,86,240,.3);
  cursor: pointer;
}
.submit:hover { opacity: .88; transform: translateY(-1px); }
.form-success {
  background: var(--tag-green); border: 1px solid rgba(16,185,129,.3);
  border-radius: 12px; padding: 1.25rem 1.5rem;
  color: var(--tag-green-t); font-weight: 600;
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1.5rem;
}

/* ── Footer ── */
.site-footer {
  background: #040c1d; color: rgba(255,255,255,.7);
  margin-top: 0; padding-top: 4rem;
}
.footer-grid {
  max-width: 1140px; margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}
@media (max-width: 680px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
.footer-brand b { font-family: 'Oswald', sans-serif; font-size: 1.4rem; color: #fff; }
.footer-brand small { color: rgba(255,255,255,.4); }
.footer-grid p { font-size: .875rem; margin-top: .75rem; line-height: 1.7; color: rgba(255,255,255,.45); }
.footer-grid strong {
  font-family: 'DM Mono', monospace; font-size: .6875rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.35); display: block; margin-bottom: .75rem;
}
.footer-grid a {
  display: block; font-size: .875rem; color: rgba(255,255,255,.6);
  margin-bottom: .5rem; transition: color .2s;
}
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 1.25rem 1.5rem;
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
  font-size: .75rem; color: rgba(255,255,255,.3);
}
.footer-bottom a { color: rgba(255,255,255,.4); text-decoration: underline; }
.footer-bottom a:hover { color: rgba(255,255,255,.7); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; border-radius: 100px;
  padding: .75rem 1.5rem; font-size: .9rem;
  opacity: 0; transition: opacity .3s, transform .3s;
  pointer-events: none; z-index: 999; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Animations ── */
.fade-in { animation: fadeIn .5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── Stats Strip ── */
.stats-strip {
  background: var(--quest-accent);
  color: #fff; padding: 2rem 1.5rem;
}
.stats-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; gap: 3rem; flex-wrap: wrap;
  justify-content: center; align-items: center;
}
.stat-item { text-align: center; }
.stat-item b {
  font-family: 'Oswald', sans-serif;
  font-size: 2.25rem; font-weight: 700;
  display: block; line-height: 1;
}
.stat-item span { font-size: .8125rem; opacity: .8; }

/* ── Research / Data ── */
.research-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem; overflow: hidden;
}
.research-card h3 { font-size: 1.125rem; font-weight: 800; margin-bottom: .5rem; }

/* ── Admin specific ── */
.admin-layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-sidebar.open { display: flex; }
}
.admin-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .25rem;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.admin-sidebar .brand { padding: .5rem 0 1.5rem; }
.admin-nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; border-radius: 8px;
  font-size: .9rem; font-weight: 500; color: var(--text-2);
  transition: background .2s, color .2s; cursor: pointer;
}
.admin-nav-item:hover { background: var(--bg-3); color: var(--text); }
.admin-nav-item.active { background: var(--badge-bg); color: var(--quest-accent); font-weight: 700; }
.admin-nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.admin-content { padding: 2rem; max-width: 1000px; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.admin-header h1 { font-size: 1.5rem; font-weight: 800; }

.admin-table-wrap {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  font-family: 'DM Mono', monospace; font-size: .6875rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500;
  padding: .85rem 1.25rem; text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.admin-table td {
  padding: .9rem 1.25rem; font-size: .875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-3); }
.admin-action-btn {
  font-size: .75rem; font-weight: 600; padding: .25rem .6rem;
  border-radius: 6px; cursor: pointer; transition: background .2s;
  border: 1px solid var(--border-2); color: var(--text-2);
  background: transparent;
}
.admin-action-btn:hover { background: var(--bg-3); color: var(--text); }
.admin-action-btn.danger { color: #e53e3e; border-color: rgba(229,62,62,.3); }
.admin-action-btn.danger:hover { background: rgba(229,62,62,.08); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.5rem;
}
.stat-card .num {
  font-family: 'Oswald', sans-serif; font-size: 2.25rem;
  font-weight: 700; color: var(--quest-accent); line-height: 1;
}
.stat-card .label { font-size: .8125rem; color: var(--text-2); margin-top: .25rem; }

.admin-form-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem; max-width: 600px;
}
.admin-form-card h2 { font-size: 1.125rem; font-weight: 800; margin-bottom: 1.5rem; }
.admin-field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.admin-field label { font-size: .8125rem; font-weight: 600; color: var(--text); }
.admin-field input, .admin-field select, .admin-field textarea {
  background: var(--input-bg); border: 1.5px solid var(--input-border);
  border-radius: 8px; padding: .55rem .75rem;
  font-size: .9rem; font-family: inherit; color: var(--text);
  outline: none; transition: border-color .2s;
  appearance: none;
}
.admin-field input:focus, .admin-field select:focus, .admin-field textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(26,86,240,.1);
}
.admin-field textarea { min-height: 80px; resize: vertical; }

/* ── Login Page ── */
.login-page {
  min-height: 100svh; display: flex; align-items: center;
  justify-content: center; background: var(--bg);
  padding: 2rem;
}
.login-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 3rem 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand { justify-content: center; margin-bottom: 2rem; }
.login-card h1 { font-size: 1.25rem; font-weight: 800; text-align: center; margin-bottom: .25rem; }
.login-card p { font-size: .875rem; color: var(--text-2); text-align: center; margin-bottom: 2rem; }
.login-error {
  background: #fee2e2; border: 1px solid #fca5a5;
  color: #991b1b; border-radius: 8px;
  padding: .75rem 1rem; font-size: .875rem; font-weight: 500;
  margin-bottom: 1rem;
}
body.dark .login-error { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.3); color: #fca5a5; }

/* ── Tabs ── */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.tab-btn {
  padding: .6rem 1.1rem; border-radius: 8px 8px 0 0;
  font-size: .875rem; font-weight: 600;
  color: var(--text-2); cursor: pointer; transition: color .2s, background .2s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--quest-accent); border-bottom-color: var(--quest-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .3s; }

/* ── Responsive utilities ── */
@media (max-width: 860px) {
  .section { padding: 3rem 0; }
  .page-hero { padding: 3.5rem 1.5rem 3rem; }
}
@media (max-width: 600px) {
  .form-wrap { padding: 1.5rem; }
  .admin-content { padding: 1.25rem; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Focus visible ── */
:focus-visible { outline: 2px solid var(--quest-accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
