/*
  Elm Craft Games — styles
  Sleek minimal foundation with subtle retro accents
*/

/* CSS Variables */
:root {
  --bg: #0b0c0f;           /* near-black */
  --bg-elev: #11131a;      /* elevated panels */
  --text: #e8eaf0;         /* primary text */
  --muted: #a8afc0;        /* muted text */
  --line: #1c2030;         /* hairlines */
  --accent: #00ffa3;       /* neon elm green */
  --accent-2: #66ccff;     /* cool blue */
  --shadow: rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --maxw: 1200px;
}

/* Base Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  color: var(--text);
  background: radial-gradient(1200px 600px at 70% -10%, rgba(0,255,163,0.08), transparent),
              radial-gradient(800px 400px at 20% -10%, rgba(102,204,255,0.08), transparent),
              var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Local Header Font: Soloist */
@font-face {
  font-family: 'Soloist';
  src: url('fonts/soloist.ttf') format('truetype');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.15; font-family: 'Soloist', Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; text-align: center; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.75rem); font-weight: 700; letter-spacing: 0.01em; }
h2 { font-size: clamp(1.5rem, 1.6vw + 1rem, 2.25rem); font-weight: 700; letter-spacing: 0.008em; }
h3 { font-size: clamp(1.1rem, 0.6vw + .9rem, 1.35rem); font-weight: 600; letter-spacing: 0.006em; }
p { margin: 0 0 1rem; color: var(--muted); }

.lead { font-size: clamp(1.05rem, .7vw + 1rem, 1.25rem); color: #d7dbea; }

/* Layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 8vw, 96px) 0; position: relative; }
/* Center general section copy and card text for a unified look */
.section p { text-align: center; }
.card .card-body, .card .card-body p { text-align: center; }
.list-compact { text-align: center; }

/* Subtle grid lines for retro vibe */
main { position: relative; }
main::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(600px 300px at 60% 0%, black, transparent 70%);
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(120%) blur(10px); background: rgba(11,12,15,0.6); border-bottom: 1px solid rgba(255,255,255,0.04); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 600; }
.brand-mark { width: 36px; height: 36px; display: block; }
.brand-name { letter-spacing: 0.2px; }

.primary-nav { display: flex; align-items: center; gap: 16px; }
.primary-nav a { color: var(--text); text-decoration: none; padding: 10px 12px; border-radius: 10px; transition: background .2s ease, color .2s ease, transform .08s ease; font-size: 0.95rem; }
.primary-nav a:hover { background: rgba(255,255,255,0.04); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 14px; color: var(--text); text-decoration: none; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); transition: transform .08s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.14); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 8px 12px; border-radius: 12px; font-size: .95rem; }

.btn-primary { background: linear-gradient(135deg, rgba(0,255,163,0.18), rgba(102,204,255,0.18)); border-color: rgba(0,255,163,0.35); box-shadow: 0 6px 18px rgba(0,255,163,0.15), inset 0 0 0 1px rgba(255,255,255,0.06); }
.btn-primary:hover { background: linear-gradient(135deg, rgba(0,255,163,0.24), rgba(102,204,255,0.22)); }

.btn-ghost { background: transparent; border: 1px dashed rgba(255,255,255,0.18); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-style: solid; }

/* Mobile nav toggle */
.nav-toggle { display: none; position: relative; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; background: transparent; color: var(--text); }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); transition: transform .2s ease, opacity .2s ease; }
.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 25px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero { padding-top: clamp(48px, 8vw, 96px); position: relative; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; justify-items: center; min-height: clamp(380px, 58vh, 560px); text-align: center; }
.hero-copy { text-align: center; }
.hero-logo { width: clamp(140px, 20vw + 120px, 320px); height: auto; display: block; margin: 0 auto 32px; position: relative; will-change: filter; filter: drop-shadow(0 6px 20px rgba(0,255,163,0.14)) drop-shadow(0 3px 14px rgba(102,204,255,0.12)); animation: neonPulse 5.5s ease-in-out infinite; }
.hero-logo:hover { filter: drop-shadow(0 10px 28px rgba(0,255,163,0.25)) drop-shadow(0 6px 22px rgba(102,204,255,0.22)); }
.hero-copy h1 { letter-spacing: inherit; color: #ffffff; }
.cta-row { display: flex; gap: 12px; margin-top: 20px; justify-content: center; }
.hero-backdrop { position: absolute; inset: 0; overflow: hidden; }
.hero-backdrop::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 260px at 50% 8%, rgba(0,255,163,0.20), rgba(102,204,255,0.16) 50%, transparent 70%), linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.35) 100%); filter: blur(0.2px); }
.grid-glow { position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(102,204,255,0.18) 1px, transparent 1px), linear-gradient(to top, rgba(0,255,163,0.18) 1px, transparent 1px); background-size: 40px 40px; opacity: .9; mix-blend-mode: screen; animation: drift 28s linear infinite; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-40px); } }

/* Hero title default appearance */

/* Subtle neon pulse on the logo */
@keyframes neonPulse {
  0%, 100% { filter: drop-shadow(0 6px 20px rgba(0,255,163,0.14)) drop-shadow(0 3px 14px rgba(102,204,255,0.12)); }
  50%      { filter: drop-shadow(0 10px 30px rgba(0,255,163,0.26)) drop-shadow(0 6px 22px rgba(102,204,255,0.22)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
}

/* Cards & Grids */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.section#games .cards-grid { grid-template-columns: 1fr; }
.cards-grid.three { grid-template-columns: repeat(3, 1fr); }
.project.card { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: stretch; }
.project-left { display: grid; grid-template-rows: auto; gap: 12px; align-items: stretch; }
.project .card-media { position: relative; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, rgba(0,255,163,0.15), rgba(102,204,255,0.15)); border: 1px solid rgba(255,255,255,0.06); box-shadow: inset 0 0 40px rgba(0,0,0,0.3); aspect-ratio: 16 / 10; height: auto; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project .card-body { display: grid; align-content: start; gap: 12px; max-width: 62ch; margin-inline: auto; }
.app-badge { display: block; width: 100%; border-radius: var(--radius); overflow: hidden; border: none; background: transparent; }
.app-badge img { display: block; width: 100%; height: auto; filter: none; transition: transform .08s ease; }
.app-badge:hover img { transform: translateY(-1px); }
/* Keep badge a tasteful width when placed under copy */
.project .card-body .app-badge { width: 140px; margin: 6px auto 0; display: block; }
.placeholder { position: relative; }
.placeholder::after { content: "PRESS START"; position: absolute; bottom: 12px; right: 12px; font-family: "VT323", monospace; color: rgba(0,255,163,0.9); letter-spacing: 1px; font-size: 16px; text-shadow: 0 0 8px rgba(0,255,163,0.6); }

.card { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 20px; box-shadow: 0 12px 32px var(--shadow); }
.card:hover { box-shadow: 0 14px 40px rgba(0,0,0,0.5); }
.card-body { padding: 14px 4px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tags span { font-size: .85rem; color: #cfe7ff; background: rgba(102,204,255,0.1); border: 1px solid rgba(102,204,255,0.25); padding: 4px 8px; border-radius: 999px; }

.two-col { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; align-items: start; }

/* Narrower About text column to avoid wide measure */
#about .two-col > div:first-child { max-width: 62ch; margin-inline: auto; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 26px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .4em; width: 16px; height: 16px; border-radius: 3px; background: rgba(0,255,163,0.12); border: 1px solid rgba(0,255,163,0.5); box-shadow: 0 0 10px rgba(0,255,163,0.2) inset; }

.list-compact { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list-compact a { color: var(--text); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,0.14); padding-bottom: 4px; }
.list-compact a:hover { border-bottom-style: solid; }

/* Tighter spacing between About and Selected Work */
#about { padding-bottom: clamp(28px, 5vw, 48px); }
#games { padding-top: clamp(20px, 4vw, 36px); }

/* Center the Contact content on wide screens */
#contact .contact-wrap { max-width: 680px; margin: 0 auto; text-align: center; }

/* Footer */
.site-footer { padding: 28px 0 48px; border-top: 1px solid rgba(255,255,255,0.06); background: rgba(0,0,0,0.2); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 10px; opacity: .9; }
.footer-brand img { width: 24px; height: 24px; }
.fineprint { color: var(--muted); font-size: .95rem; }

/* Retro scanlines overlay (toggleable) */
.scanlines { position: fixed; inset: 0; pointer-events: none; background: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 100% 3px; mix-blend-mode: soft-light; opacity: .15; transition: opacity .3s ease; }
.retro-off .scanlines { opacity: 0; }

/* Accessibility & focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Responsive */
@media (max-width: 1024px) {
  .hero-copy .hero-logo { margin-left: auto; margin-right: auto; }
  .two-col { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .primary-nav { position: fixed; inset: 64px 12px auto 12px; background: rgba(17,19,26,0.98); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 8px; display: none; flex-direction: column; gap: 4px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
  .nav-open .primary-nav { display: flex; }
  .nav-toggle { display: inline-block; }
  .cards-grid { grid-template-columns: 1fr; }
  .project.card { grid-template-columns: 1fr; gap: 16px; }
  .project .card-media { aspect-ratio: 16 / 10; }
  .cards-grid.three { grid-template-columns: 1fr; }
}

/* Small pixel underline accent on hover */
a:hover { text-shadow: 0 0 8px rgba(102,204,255,0.25); }
