/* ==========================================================================
   Treasure Fan Page — css/style.css
   Polarity identity: #06090a near-black, #e0e0e0 silver, #ff4400 fire-orange
   Teko 700 headings / Inter body — stark precise card style
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Teko:wght@700&family=Inter:wght@400;500&display=swap');

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --bg:            #06090a;
  --bg-card:       #0c1012;
  --bg-alt:        #090d0f;
  --text:          #e0e0e0;
  --text-muted:    #666c70;
  --accent:        #e0e0e0;
  --accent-orange: #ff4400;
  --border:        #1a2024;
  --border-accent: #2a3338;
  --font-display:  'Teko', sans-serif;
  --font-body:     'Inter', sans-serif;

  --nav-height:    60px;
  --container-max: 1200px;
}

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes reveal-fade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hero-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  overflow-x: hidden;
  padding-top: var(--nav-height);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover,
a:focus {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

ul, ol { list-style: none; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h4 { font-size: clamp(1.3rem, 2.5vw, 2rem); }

p { margin-bottom: 1rem; }

strong { color: var(--accent); }

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.site-section:nth-of-type(odd)  { background: var(--bg); }
.site-section:nth-of-type(even) { background: var(--bg-alt); }

/* --------------------------------------------------------------------------
   Skip Link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#site-nav {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border-accent);
  z-index: 1000;
  display: flex;
  align-items: center;
}

#site-nav .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.nav-logo span {
  color: var(--accent-orange);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.4rem;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
  transition: color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active {
  border-bottom: 1px solid var(--accent-orange);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent);
  transition: transform 0.2s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.4rem 0; font-size: 0.9rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
#hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.25;
  filter: sepia(0.4) brightness(0.7);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 4rem 1.5rem;
  max-width: 960px;
  animation: hero-fade-in 0.8s ease both;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-orange);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 16vw, 11rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-title .t-orange {
  color: var(--accent-orange);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stat .num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--accent-orange);
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.45rem 1.5rem;
  border: 1px solid;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent);
  color: var(--bg);
}

.btn-secondary {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--accent-orange);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   Section Headers
   -------------------------------------------------------------------------- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-orange);
  display: block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Cards — stark silver border
   -------------------------------------------------------------------------- */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-left: 2px solid var(--accent);
  transition: border-left-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.game-card:hover {
  border-left-color: var(--accent-orange);
  box-shadow: 0 2px 16px rgba(255, 68, 0, 0.1);
}

.game-card__cover {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.game-card__body {
  padding: 1.25rem;
}

.game-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.game-card__year {
  font-size: 0.78rem;
  color: var(--accent-orange);
  font-weight: 500;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-card__desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Games Grid
   -------------------------------------------------------------------------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Platform Filter
   -------------------------------------------------------------------------- */
#platform-filter,
#game-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--border-accent);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.filter-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.filter-btn[data-filter="mega-drive"].filter-active  { background: var(--accent-orange); border-color: var(--accent-orange); }
.filter-btn[data-filter="saturn"].filter-active      { background: #a0c8e0; border-color: #a0c8e0; color: var(--bg); }
.filter-btn[data-filter="n64"].filter-active         { background: #c8a020; border-color: #c8a020; color: var(--bg); }
.filter-btn[data-filter="gcn"].filter-active         { background: #8060c0; border-color: #8060c0; color: var(--bg); }

.filter-hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.6rem;
}

.tag {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag--mega-drive { border-color: var(--accent-orange); color: var(--accent-orange); }
.tag--saturn     { border-color: #a0c8e0; color: #a0c8e0; }
.tag--n64        { border-color: #c8a020; color: #c8a020; }
.tag--gcn        { border-color: #8060c0; color: #8060c0; }
.tag--other      { border-color: var(--border-accent); }
.tag--shmup      { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   History / Article body
   -------------------------------------------------------------------------- */
.history-body {
  max-width: 72ch;
  margin: 0 auto;
}

.history-chapter {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.history-chapter:last-child {
  border-bottom: none;
}

.history-chapter h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.history-chapter h3 .year {
  color: var(--accent-orange);
  font-size: 0.85em;
}

.history-chapter p { color: var(--text); }

/* --------------------------------------------------------------------------
   Person cards
   -------------------------------------------------------------------------- */
.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-top: 2px solid var(--accent);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.person-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
}

.person-card .role {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  display: block;
}

.person-card p {
  color: var(--text);
  font-size: 0.93rem;
}

/* --------------------------------------------------------------------------
   Gallery grid
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  overflow: hidden;
  transition: border-color 0.15s;
}

.gallery-item:hover {
  border-color: var(--accent);
}

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gallery-item__caption {
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.gallery-item__caption strong {
  color: var(--accent);
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg);
  border: 1px dashed var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Video embeds
   -------------------------------------------------------------------------- */
.video-section {
  margin-bottom: 3rem;
}

.video-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.video-section p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  max-width: 72ch;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-accent);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --------------------------------------------------------------------------
   Resources
   -------------------------------------------------------------------------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.resource-item {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-left: 2px solid var(--accent-orange);
  padding: 1.25rem;
  transition: border-left-color 0.15s;
}

.resource-item:hover {
  border-left-color: var(--accent);
}

.resource-item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}

.resource-item p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.resource-item a {
  font-size: 0.8rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Flagship deep dive
   -------------------------------------------------------------------------- */
.flagship-section {
  max-width: 72ch;
  margin: 0 auto;
}

.flagship-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent-orange);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.flagship-section p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
}

.mechanic-block {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-left: 3px solid var(--accent-orange);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.mechanic-block h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.mechanic-block p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Scroll Reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: #030608;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.site-footer__text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.site-footer__text a { color: var(--accent-orange); }

/* --------------------------------------------------------------------------
   Polarity Split Easter Egg
   -------------------------------------------------------------------------- */
#polarity-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#polarity-overlay.polarity-active {
  opacity: 1;
  pointer-events: all;
}

.pol-left {
  flex: 1;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1.5rem;
}

.pol-right {
  flex: 1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 1.5rem;
}

.pol-divider {
  width: 3px;
  background: var(--accent-orange);
  flex-shrink: 0;
  height: 100%;
}

.pol-label {
  font-family: 'Teko', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 4rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
}

.pol-left .pol-label {
  color: #e0e0e0;
  text-align: right;
}

.pol-right .pol-label {
  color: #000000;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.mt-sm  { margin-top: 0.75rem; }
.mt-md  { margin-top: 1.5rem; }
.mb-sm  { margin-bottom: 0.75rem; }
.mb-md  { margin-bottom: 1.5rem; }
.text-orange { color: var(--accent-orange); }
.text-silver { color: var(--accent); }
.text-muted  { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .hero-stats { gap: 2rem; }
  .games-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; align-items: center; }
}
