/* =========================================
   Chris Freeman — chrisfreeman.com.au
   Inspired by yasio.dev
   ========================================= */

/* --- Variables --- */
:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e5e5e5;
  --text-dim: #888888;
  --text-muted: #555555;
  --accent: #5918df;
  --accent-light: #7c3aed;
  --accent-glow: rgba(89, 24, 223, 0.3);
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.accent { color: var(--accent-light); }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
}

/* --- CRT Effect (vault66 style) --- */

/* Scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

/* Static horizontal scanlines */
.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.06) 1px,
    rgba(0, 0, 0, 0.06) 2px
  );
  z-index: 1;
}

/* Sweep bar — slow vertical phosphor refresh */
.scanlines::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(124, 58, 237, 0.02) 20%,
    rgba(124, 58, 237, 0.06) 50%,
    rgba(124, 58, 237, 0.02) 80%,
    transparent 100%
  );
  animation: sweep 5s linear infinite;
  z-index: 2;
}

@keyframes sweep {
  0% { top: -120px; }
  100% { top: calc(100% + 120px); }
}

/* Vignette — darkened edges like a real CRT */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* Phosphor glow — subtle inner edge glow */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  box-shadow:
    inset 0 0 80px rgba(124, 58, 237, 0.03),
    inset 0 0 160px rgba(0, 0, 0, 0.15);
}

/* CRT flicker */
@keyframes crt-flicker {
  0% { opacity: 1; }
  3% { opacity: 0.97; }
  6% { opacity: 1; }
  45% { opacity: 1; }
  46% { opacity: 0.98; }
  47% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.96; }
  94% { opacity: 1; }
}

main {
  animation: crt-flicker 4s infinite;
}

/* --- Nav --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--accent-light);
  background: rgba(124, 58, 237, 0.08);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 0 80px;
}

.hero .container {
  text-align: center;
}

.hero-greeting {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent-light);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 300;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.hero-tagline em {
  font-style: italic;
  color: var(--text);
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 48px;
  line-height: 1.8;
}

.hero-arrow {
  font-size: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
}

.hero-arrow a {
  color: var(--accent-light);
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.hero-arrow a:hover {
  border-color: var(--accent-light);
  box-shadow: 0 0 24px var(--accent-glow);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* --- CRT Glitch — phosphor glow + interference --- */
.glitch {
  position: relative;
  display: inline-block;
  color: var(--accent-light);
  text-shadow:
    0 0 4px var(--accent-light),
    0 0 12px var(--accent-glow);
  animation: crt-glitch-main 6s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Phosphor bleed — left channel */
.glitch::before {
  color: var(--accent-light);
  text-shadow: -1px 0 rgba(255, 0, 80, 0.5);
  z-index: -1;
  animation: crt-glitch-left 6s infinite;
}

/* Phosphor bleed — right channel */
.glitch::after {
  color: var(--accent-light);
  text-shadow: 1px 0 rgba(0, 200, 255, 0.5);
  z-index: -2;
  animation: crt-glitch-right 6s infinite;
}

/* Main text — occasional shake */
@keyframes crt-glitch-main {
  0%, 100% { transform: translate(0); }
  30% { transform: translate(0); }
  30.2% { transform: translate(1px, -1px); }
  30.4% { transform: translate(-1px, 0); }
  30.6% { transform: translate(0); }
  65% { transform: translate(0); }
  65.1% { transform: translate(-1px, 1px); }
  65.3% { transform: translate(0); }
}

/* Left channel — colour fringe + slice */
@keyframes crt-glitch-left {
  0%, 100% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  30% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  30.1% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 0); opacity: 1; }
  30.3% { clip-path: inset(50% 0 20% 0); transform: translate(-2px, 0); opacity: 1; }
  30.5% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  65% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  65.1% { clip-path: inset(35% 0 35% 0); transform: translate(-4px, 0); opacity: 1; }
  65.25% { clip-path: inset(70% 0 10% 0); transform: translate(-2px, 0); opacity: 1; }
  65.4% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  87% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  87.1% { clip-path: inset(10% 0 75% 0); transform: translate(-3px, 0); opacity: 1; }
  87.2% { clip-path: inset(0); transform: translate(0); opacity: 0; }
}

/* Right channel — opposite offset */
@keyframes crt-glitch-right {
  0%, 100% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  30.1% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  30.15% { clip-path: inset(22% 0 58% 0); transform: translate(3px, 0); opacity: 1; }
  30.35% { clip-path: inset(52% 0 18% 0); transform: translate(2px, 0); opacity: 1; }
  30.5% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  65.1% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  65.15% { clip-path: inset(37% 0 33% 0); transform: translate(4px, 0); opacity: 1; }
  65.3% { clip-path: inset(72% 0 8% 0); transform: translate(2px, 0); opacity: 1; }
  65.4% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  87.1% { clip-path: inset(0); transform: translate(0); opacity: 0; }
  87.15% { clip-path: inset(12% 0 73% 0); transform: translate(3px, 0); opacity: 1; }
  87.25% { clip-path: inset(0); transform: translate(0); opacity: 0; }
}

/* --- Blinking Cursor --- */
.cursor {
  font-family: var(--mono);
  color: var(--accent-light);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- DOS Boot Screen --- */
.dos-screen {
  background: #000000;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius);
  padding: 32px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: #aaaaaa;
  overflow: hidden;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(124, 58, 237, 0.05);
}

.dos-line {
  opacity: 0;
  animation: dos-appear 0.01s forwards;
  white-space: pre-wrap;
}

@keyframes dos-appear {
  to { opacity: 1; }
}

/* Staggered delays for boot sequence feel */
.dos-delay-1  { animation-delay: 0.3s; color: #ffffff; }
.dos-delay-2  { animation-delay: 0.5s; color: #888888; }
.dos-delay-3  { animation-delay: 0.7s; }
.dos-delay-4  { animation-delay: 1.0s; }
.dos-delay-5  { animation-delay: 1.4s; }
.dos-delay-6  { animation-delay: 1.7s; }
.dos-delay-7  { animation-delay: 2.0s; color: #ffffff; }
.dos-delay-8  { animation-delay: 2.3s; }
.dos-delay-9  { animation-delay: 2.6s; color: #bbbbbb; }
.dos-delay-10 { animation-delay: 3.0s; }
.dos-delay-11 { animation-delay: 3.3s; color: #bbbbbb; }
.dos-delay-12 { animation-delay: 3.7s; }
.dos-delay-13 { animation-delay: 4.0s; color: #bbbbbb; }
.dos-delay-14 { animation-delay: 4.4s; }
.dos-delay-15 { animation-delay: 4.7s; color: #bbbbbb; }
.dos-delay-16 { animation-delay: 5.1s; }
.dos-delay-17 { animation-delay: 5.5s; color: #ffffff; }

/* --- Sections --- */
.section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 48px;
}

.section-title .accent {
  color: var(--accent-light);
}

.section-body p {
  font-size: 1.0625rem;
  color: var(--text-dim);
  max-width: 640px;
  line-height: 1.85;
  margin-bottom: 24px;
}

.section-body p:last-child {
  margin-bottom: 0;
}

/* --- Retro Cards Grid --- */
.retro-grid-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ============================
   01: Windows 95 Window
   ============================ */
.win95-window {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  border-radius: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  overflow: hidden;
  transition: transform 0.3s;
}
.win95-window:hover { transform: translateY(-2px); }

.win95-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  padding: 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
}

.win95-title {
  padding-left: 2px;
}

.win95-buttons {
  display: flex;
  gap: 2px;
}

.win95-btn {
  width: 16px;
  height: 14px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: #000000;
  line-height: 1;
}

.win95-menubar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  display: flex;
  gap: 12px;
  font-size: 0.6875rem;
  color: #000000;
}

.win95-body {
  background: #ffffff;
  padding: 16px;
  margin: 4px;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

.win95-body h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #000080;
  margin-bottom: 8px;
}

.win95-body p {
  font-size: 0.8125rem;
  color: #000000;
  line-height: 1.6;
}

.win95-statusbar {
  background: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 2px 8px;
  font-size: 0.625rem;
  color: #000000;
}

/* ============================
   02: NES Cartridge
   ============================ */
.nes-cart {
  background: #2a2a2a;
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  border: 2px solid #3a3a3a;
  transition: transform 0.3s;
  position: relative;
}
.nes-cart:hover { transform: translateY(-2px); }

.nes-top {
  height: 20px;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.nes-notch {
  width: 40px;
  height: 10px;
  background: #0a0a0a;
  border-radius: 0 0 4px 4px;
}

.nes-label {
  margin: 12px;
  background: linear-gradient(180deg, #e8d5a3, #d4b876);
  border-radius: 4px;
  padding: 12px;
  text-align: center;
  border: 2px solid #b8973d;
}

.nes-label-top {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b5a30;
  margin-bottom: 8px;
}

.nes-label-title {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.2;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.nes-label-seal {
  font-family: var(--mono);
  font-size: 0.5rem;
  color: #8b7340;
  letter-spacing: 0.05em;
  border: 1px solid #8b7340;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
}

.nes-body {
  padding: 12px 16px 16px;
}

.nes-body p {
  font-size: 0.8125rem;
  color: #999999;
  line-height: 1.65;
}

/* ============================
   03: DOS Terminal
   ============================ */
.dos-terminal {
  background: #000000;
  border: 1px solid #333333;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s;
}
.dos-terminal:hover { transform: translateY(-2px); }

.dos-terminal-bar {
  background: #1a1a1a;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: #666666;
  border-bottom: 1px solid #333333;
}

.dos-terminal-body {
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #aaaaaa;
}

.dos-t-line {
  white-space: pre-wrap;
}

.dos-t-title {
  color: #ffffff;
  font-weight: 500;
}

/* ============================
   04: Floppy Disk
   ============================ */
.floppy {
  background: #1a1a2e;
  border-radius: 6px;
  border: 2px solid #2a2a4a;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s;
}
.floppy:hover { transform: translateY(-2px); }

.floppy-metal {
  background: linear-gradient(180deg, #555555, #444444, #555555);
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.floppy-slot {
  width: 60%;
  height: 10px;
  background: #222222;
  border-radius: 2px;
  border: 1px solid #333333;
}

.floppy-label {
  margin: 12px;
  background: #ffffff;
  border-radius: 2px;
  padding: 12px;
}

.floppy-label-lines {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dddddd;
}

.floppy-label-lines span:first-child {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a1a2e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.floppy-date {
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: #999999;
}

.floppy-label-body p {
  font-size: 0.8125rem;
  color: #333333;
  line-height: 1.6;
}

.floppy-hole {
  width: 16px;
  height: 16px;
  background: var(--bg);
  border-radius: 50%;
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #2a2a4a;
}

/* Responsive */
@media (max-width: 768px) {
  .retro-grid-cards {
    grid-template-columns: 1fr;
  }
}

/* --- Approach List --- */
.approach-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approach-list li {
  font-family: var(--mono);
  font-size: 0.9375rem;
  color: var(--text-dim);
  padding-left: 0;
  transition: color 0.2s;
}

.approach-list li:hover {
  color: var(--text);
}

.approach-list li .accent {
  margin-right: 8px;
}

/* --- Philosophy --- */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .philosophy-grid { grid-template-columns: 1fr; }
}

/* ============================
   Arcade Cabinet — CONTROL
   ============================ */
.arcade-cab {
  background: #1a1a1a;
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
  border: 2px solid #333333;
  transition: transform 0.3s;
}
.arcade-cab:hover { transform: translateY(-2px); }

.arcade-bezel {
  background: #111111;
  padding: 12px;
  border-bottom: 2px solid #333333;
}

.arcade-screen {
  background: #000000;
  border: 3px solid #222222;
  border-radius: 4px;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.arcade-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
  pointer-events: none;
  z-index: 1;
}

.arcade-content {
  position: relative;
  z-index: 2;
}

.arcade-title {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff4444;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.5), 0 0 20px rgba(255, 68, 68, 0.2);
  margin-bottom: 12px;
  letter-spacing: 0.15em;
}

.arcade-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #ffffff;
  line-height: 1.8;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.arcade-insert {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: #ffcc00;
  letter-spacing: 0.1em;
  animation: arcade-blink 1.2s step-end infinite;
}

@keyframes arcade-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.arcade-controls {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arcade-joystick {
  width: 28px;
  height: 28px;
  background: #222222;
  border-radius: 50%;
  border: 3px solid #444444;
  position: relative;
}
.arcade-joystick::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #555555;
  border-radius: 50%;
}

.arcade-buttons-row {
  display: flex;
  gap: 8px;
}

.arcade-button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.ab-red { background: #cc2222; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }
.ab-blue { background: #2244cc; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.3); }

/* ============================
   Text Adventure — EXPLORE
   ============================ */
.text-adventure {
  background: #000000;
  border: 1px solid #333333;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s;
}
.text-adventure:hover { transform: translateY(-2px); }

.ta-header {
  background: #1a1a1a;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: #666666;
  border-bottom: 1px solid #333333;
}

.ta-body {
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #22bb44;
}

.ta-line {
  white-space: pre-wrap;
}

.ta-prompt {
  color: #ffffff;
}

.ta-response {
  color: #22bb44;
}

.ta-highlight {
  color: #44ff66;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(68, 255, 102, 0.3);
}

/* ============================
   Calculator LCD — THINK
   ============================ */
.calc {
  background: #1a1a2e;
  border-radius: 6px;
  border: 2px solid #2a2a4a;
  overflow: hidden;
  transition: transform 0.3s;
}
.calc:hover { transform: translateY(-2px); }

.calc-brand {
  font-family: var(--sans);
  font-size: 0.5625rem;
  font-weight: 700;
  color: #777799;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 12px 4px;
}

.calc-display {
  margin: 4px 10px 8px;
  background: #8fa881;
  border-radius: 3px;
  padding: 2px;
  border: 1px solid #6b8560;
}

.calc-display-inner {
  background: #9ab88d;
  padding: 8px 12px;
  border-radius: 2px;
}

.calc-small {
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: #3a5530;
  margin-bottom: 4px;
}

.calc-result {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a3010;
  letter-spacing: 0.1em;
  text-align: right;
}

.calc-body {
  padding: 8px 12px 12px;
}

.calc-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #9999bb;
  margin-bottom: 10px;
  text-align: center;
  font-style: italic;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.calc-key {
  font-family: var(--mono);
  font-size: 0.5625rem;
  text-align: center;
  padding: 6px 2px;
  border-radius: 3px;
  background: #2a2a4a;
  color: #9999bb;
  border: 1px solid #3a3a5a;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  user-select: none;
}

.calc-key:active {
  transform: scale(0.93);
  background: #3a3a5a;
}

.ck-fn {
  background: #2a2a4a;
  color: #cc6666;
}

.ck-num {
  background: #333355;
  color: #ccccdd;
}

.ck-num:active {
  background: #444477;
}

.ck-op {
  background: #3a2a50;
  color: var(--accent-light);
}

.ck-op:active {
  background: #4a3a60;
}

.ck-eq {
  background: var(--accent);
  color: #ffffff;
  grid-column: span 2;
}

.ck-eq:active {
  background: var(--accent-light);
}

.ck-zero {
  grid-column: span 2;
}

/* Canvas styling for arcade */
#arcadeCanvas {
  position: relative;
  z-index: 2;
  cursor: crosshair;
  border-radius: 2px;
}

.arcade-credits {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.arcade-button {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.arcade-button:active {
  transform: scale(0.9);
}

.ab-red:hover { box-shadow: 0 0 12px rgba(204, 34, 34, 0.5); }
.ab-blue:hover { box-shadow: 0 0 12px rgba(34, 68, 204, 0.5); }

/* --- Contact --- */
.section-contact {
  text-align: center;
}

.contact-desc {
  font-size: 1.0625rem;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all 0.3s;
  min-width: 160px;
}

.contact-link:hover {
  border-color: var(--accent-light);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-2px);
}

.contact-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
}

.contact-handle {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.contact-link:hover .contact-handle {
  color: var(--text);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer p {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-built {
  font-style: italic;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { animation: fadeIn 0.8s ease both; }
.section { animation: fadeIn 0.6s ease both; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* --- Selection --- */
::selection { background: var(--accent); color: #fff; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-name { margin-bottom: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .contact-links { flex-direction: column; align-items: center; }
  .contact-link { width: 100%; max-width: 300px; }
}

@media (max-width: 480px) {
  .container { padding: 0 20px; }
  .hero { padding: 80px 0 48px; }
  .section { padding: 48px 0; }
  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
