:root {
  --terracotta:        #7C3A1E;
  --terracotta-deep:   #5E2C16;
  --terracotta-tint:   #9A4E2A;
  --ochre:             #C98B3A;
  --ochre-light:       #E0AC66;
  --ochre-soft:        rgba(201, 139, 58, 0.16);
  --teal:              #1B4A4A;
  --teal-deep:         #113535;
  --teal-tint:         #276262;

  --darkgreen:         #006400 ;

  --cream:             #EDE5D4;
  --cream-card:        #F7F2E7;
  --cream-card-solid:  #FBF8F1;
  --cream-line:        #E3D9C3;

  --ink:               #2E2013;
  --ink-soft:          #4A3826;
  --ink-muted:         #7A6A56;
  --ink-faint:         #A6957E;

  --border:            rgba(124, 58, 30, 0.16);
  --border-strong:     rgba(124, 58, 30, 0.38);
  --border-teal:       rgba(27, 74, 74, 0.20);

  --on-teal:           #EDE5D4;
  --on-teal-muted:     #9FBFBE;

  /* ---- type ---- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* ---- spacing / shape ---- */
  --section-pad: clamp(4rem, 9vw, 7.5rem);
  --side-pad: clamp(1.5rem, 6vw, 6rem);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* ---- motion ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 180ms;
  --med: 420ms;

  --avatar-size: clamp(200px, 30vw, 380px);
  --avatar-radius: 20px;
  --avatar-ring-gap: clamp(28px, 7vw, 84px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, svg, canvas { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, select, textarea, button { max-width: 100%; }
table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

section[id], .hero {
  scroll-margin-top: 84px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--terracotta);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 4px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(52% 40% at 14% 6%, rgba(124, 58, 30, 0.07), transparent 62%),
    radial-gradient(46% 38% at 88% 14%, rgba(27, 74, 74, 0.07), transparent 65%),
    radial-gradient(60% 50% at 50% 100%, rgba(201, 139, 58, 0.06), transparent 70%),
    var(--cream);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

.stitch-rule {
  height: 1px;
  background-image: linear-gradient(to right, var(--ochre) 0 6px, transparent 6px 14px);
  background-size: 14px 1px;
  background-repeat: repeat-x;
  opacity: 0.55;
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 460px;
  height: 460px;
  margin-left: -230px;
  margin-top: -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 139, 58, 0.14) 0%, rgba(124, 58, 30, 0.05) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transform: translate3d(-1000px, -1000px, 0);
}

@media (max-width: 768px), (hover: none) {
  .cursor-glow { display: none; }
}

/* 
   NAV
 */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.15rem var(--side-pad);
  display: flex;
  transition: background var(--med) var(--ease), border-color var(--med) var(--ease), backdrop-filter var(--med) var(--ease), box-shadow var(--med) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(237, 229, 212, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px -18px rgba(46, 32, 19, 0.4);
}

.nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--terracotta);
}
.blink {
  color: var(--ochre);
  animation: blink 1.1s step-end infinite;
  cursor: default;
}
@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  gap: 2.25rem;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  position: relative;
  padding-bottom: 3px;
  transition: color var(--fast) var(--ease);
}
.nav-index {
  color: var(--ink-faint);
  margin-right: 0.35em;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--ochre);
  transition: width var(--fast) var(--ease);
}
.nav-links a:hover { color: var(--terracotta); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--terracotta);
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 
   REVEAL ANIMATION UTILITY
    */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal var(--med) var(--ease) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.14s; }
.reveal-3 { animation-delay: 0.23s; }
.reveal-4 { animation-delay: 0.32s; }
.reveal-5 { animation-delay: 0.42s; }
.reveal-6 { animation-delay: 0.52s; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

.in-view {
  animation: reveal var(--med) var(--ease) forwards;
}

/* 
   HERO
    */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--side-pad);
  overflow: hidden;
}

/* soft sunburst wash rather than a tech grid — warmer, less corporate */
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    repeating-conic-gradient(from 0deg at 50% 38%, rgba(201, 139, 58, 0.05) 0deg 2deg, transparent 2deg 12deg);
  mask-image: radial-gradient(48% 48% at 50% 38%, black, transparent 78%);
}

.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(2rem, 6vw, 5rem);
  width: 100%;
}

.hero-inner {
  max-width: 900px;
  flex: 1 1 400px;
  min-width: 0;
}

/* ---- floating portrait / avatar frame ---- */
.hero-visual {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
}

.avatar-float {
  position: relative;
  width: var(--avatar-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: avatarFloat 5s var(--ease) infinite;
}
@keyframes avatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* dotted ring — a nod to a potter's wheel, turning slowly */
.avatar-ring {
  position: absolute;
  top: 0; left: 50%;
  width: calc(var(--avatar-size) + var(--avatar-ring-gap));
  height: calc(var(--avatar-size) + var(--avatar-ring-gap));
  margin-left: calc((var(--avatar-size) + var(--avatar-ring-gap)) / -2);
  margin-top: calc(var(--avatar-ring-gap) / -2);
  border-radius: 50%;
  border: 2px dotted var(--ochre);
  opacity: 0.55;
  animation: avatarSpin 26s linear infinite;
  pointer-events: none;
}
@keyframes avatarSpin {
  to { transform: rotate(360deg); }
}

.avatar-frame {
  position: relative;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: var(--avatar-radius);
  overflow: hidden;
  background: linear-gradient(155deg, var(--teal-tint), var(--teal-deep));
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px -24px rgba(94, 44, 22, 0.45), inset 0 0 0 1px rgba(237, 229, 212, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  display: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: calc(var(--avatar-size) * 0.28);
  letter-spacing: -0.01em;
  color: var(--ochre-light);
}
.avatar-frame.is-fallback {
  background:
    radial-gradient(circle at 32% 22%, rgba(201, 139, 58, 0.30), transparent 60%),
    linear-gradient(155deg, var(--teal-tint), var(--teal-deep));
}
.avatar-frame.is-fallback .avatar-fallback { display: block; }

.avatar-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ochre-light);
  opacity: 0.9;
}
.corner-tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.corner-tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.corner-br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.avatar-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--terracotta);
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}
.eyebrow-dim { color: var(--ink-faint); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.32em;
  color: var(--ink);
}
.hero-repeat {
  color: var(--terracotta);
  font-style: italic;
  font-weight: 500;
  position: relative;
}

.hero-sub {
  margin-top: 1.75rem;
  max-width: 34em;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-muted);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.9rem 1.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  display: inline-block;
}
.btn-primary {
  background: var(--terracotta);
  color: var(--cream);
  box-shadow: 0 10px 24px -12px rgba(124, 58, 30, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--terracotta-tint);
  box-shadow: 0 14px 28px -12px rgba(124, 58, 30, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--terracotta);
  background: rgba(251, 248, 241, 0.5);
}
.btn-ghost:hover {
  border-color: var(--ochre);
  background: var(--ochre-soft);
  transform: translateY(-2px);
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: var(--side-pad);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--ochre-light), transparent);
  animation: scrollLine 1.8s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.01% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}


/* ============================================================
   SECTION SHARED
   ============================================================ */
section:not(.hero) {
  padding: var(--section-pad) var(--side-pad);
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}
section:not(.hero)::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--side-pad);
  right: var(--side-pad);
  height: 1px;
  background-image: linear-gradient(to right, var(--ochre) 0 6px, transparent 6px 14px);
  background-size: 14px 1px;
  background-repeat: repeat-x;
  opacity: 0.4;
}

.section-head {
  margin-bottom: 3rem;
  max-width: 640px;
}
.section-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ochre);
  letter-spacing: 0.08em;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
  color: var(--terracotta);
}
.section-note {
  margin-top: 0.85rem;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-copy p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  max-width: 46em;
}
.about-copy strong {
  color: var(--terracotta);
  font-weight: 600;
}

.about-meta {
  display: grid;
  gap: 0.9rem;
}
.meta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--cream-card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.meta-card:hover {
  border-color: var(--border-strong);
  background: var(--cream-card-solid);
  transform: translateX(4px);
}
.meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.meta-value {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dot-live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--darkgreen);
  box-shadow: 0 0 8px rgba(10, 240, 2, 0.7);
  display: inline-block;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-groups {
  display: grid;
  gap: 2.5rem;
}
.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  margin-bottom: 1rem;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 0.85rem;
}
.skill-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream-card);
  padding: 1.4rem 1.1rem;
  text-align: left;
  color: var(--ink);
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.skill-card:hover,
.skill-card:focus-visible {
  border-color: var(--ochre);
  background: var(--cream-card-solid);
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -18px rgba(94, 44, 22, 0.4);
}
.skill-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--terracotta);
}
.skill-hint {
  margin-top: 1.75rem;
  min-height: 1.4em;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal);
  transition: opacity var(--fast) var(--ease);
}

/* ============================================================
   GOALS
   ============================================================ */
.goals-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.goals-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.goal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-now {
  background: var(--terracotta);
  box-shadow: 0 0 8px rgba(124, 58, 30, 0.5);
}
.dot-next {
  background: var(--ochre);
}
.dot-later {
  background: var(--cream-line);
  border: 1px solid var(--border-strong);
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1rem;
}

.goal-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream-card);
  padding: 1.35rem 1.4rem;
  color: var(--ink);
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.goal-card .goal-dot { margin-bottom: 0.1rem; }

.goal-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--ink);
}

.goal-desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--med) var(--ease), opacity var(--fast) var(--ease), margin-top var(--med) var(--ease);
}

.goal-card:hover,
.goal-card:focus-visible,
.goal-card.active {
  border-color: var(--ochre);
  background: var(--cream-card-solid);
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -18px rgba(94, 44, 22, 0.4);
}
.goal-card:hover .goal-desc,
.goal-card:focus-visible .goal-desc,
.goal-card.active .goal-desc {
  max-height: 6em;
  opacity: 1;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-links {
  display: grid;
  gap: 0.9rem;
  max-width: 640px;
}
.contact-link {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  background: var(--cream-card);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.contact-link:hover,
.contact-link:focus-visible {
  border-color: var(--ochre);
  background: var(--cream-card-solid);
  transform: translateX(6px);
  box-shadow: 0 14px 26px -18px rgba(94, 44, 22, 0.35);
}
.contact-link-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 5.5rem;
}
.contact-link-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
  flex: 1;
}
.contact-link-arrow {
  color: var(--ink-faint);
  font-size: 1.1rem;
  transition: transform var(--fast) var(--ease), color var(--fast) var(--ease);
}
.contact-link:hover .contact-link-arrow {
  color: var(--terracotta);
  transform: translate(3px, -3px);
}

@media (max-width: 520px) {
  .contact-link { flex-wrap: wrap; }
  .contact-link-label { min-width: 100%; }
}

/* ============================================================
   FOOTER — deep teal, the page's dark contrast section
   ============================================================ */
.footer {
  text-align: center;
  padding: 3.5rem var(--side-pad) 4rem;
  background: var(--teal-deep);
  color: var(--on-teal);
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: var(--side-pad); right: var(--side-pad);
  height: 1px;
  background-image: linear-gradient(to right, var(--ochre) 0 6px, transparent 6px 14px);
  background-size: 14px 1px;
  background-repeat: repeat-x;
  opacity: 0.5;
}
.footer-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--on-teal);
}
.footer-alias { color: var(--on-teal-muted); }
.footer-tagline {
  margin-top: 0.6rem;
  color: var(--on-teal-muted);
  font-size: 0.9rem;
}
.coffee-btn {
  background: none;
  border: none;
  margin-left: 0.35rem;
  font-size: 0.9rem;
  transform: translateY(1px);
  transition: transform var(--fast) var(--ease);
  filter: grayscale(1) opacity(0.7);
}
.coffee-btn:hover {
  transform: scale(1.2) translateY(1px);
  filter: none;
}
.footer-copy {
  margin-top: 1rem;
  color: var(--on-teal-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  opacity: 0.85;
}

/* ============================================================
   EASTER EGG GAME MODAL
   ============================================================ */
.game-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 53, 53, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--med) var(--ease);
  padding: 1.5rem;
}
.game-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.game-panel {
  background: var(--teal-deep);
  border: 1px solid rgba(201, 139, 58, 0.3);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 540px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: translateY(10px);
  transition: transform var(--med) var(--ease);
}
.game-modal.open .game-panel { transform: translateY(0); }

.game-close {
  position: absolute;
  top: 0.85rem; right: 1rem;
  background: none;
  border: none;
  color: var(--on-teal-muted);
  font-size: 1.6rem;
  line-height: 1;
}
.game-close:hover { color: var(--on-teal); }

.game-title {
  font-family: var(--font-mono);
  color: var(--ochre-light);
  font-size: 1rem;
  letter-spacing: 0.04em;
}
.game-sub {
  color: var(--on-teal-muted);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  margin-bottom: 1.1rem;
}
#gameCanvas {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 2 / 1;
  background: #123434;
  border: 1px solid rgba(201, 139, 58, 0.25);
  border-radius: var(--radius-sm);
  image-rendering: pixelated;
  touch-action: none;
}
.game-hud {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--on-teal-muted);
}
.game-hud b { color: var(--on-teal); }
.game-instructions {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--on-teal-muted);
  opacity: 0.8;
}

/* ============================================================
   RESPONSIVE
   Breakpoints used throughout this file:
     Mobile          320px – 767px  (default / mobile-first base)
     Tablet / iPad   768px – 1024px
     Laptop          1025px – 1440px
     Large desktop   1441px and up
   ============================================================ */

/* ---- Nav: hamburger for everything up to and including tablet,
   full inline nav from laptop widths up. Drawer uses the deep teal
   surface — the same dark contrast tone as the footer. ---- */
@media (max-width: 1024px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100svh;
    width: min(78vw, 340px);
    background: var(--teal-deep);
    border-left: 1px solid rgba(201, 139, 58, 0.25);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    transform: translateX(100%);
    transition: transform var(--med) var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a {
    font-size: 1.15rem;
    padding: 0.5rem 0; /* larger tap target once stacked in the drawer */
    display: inline-block;
    color: var(--on-teal-muted);
  }
  .nav-links a:hover { color: var(--ochre-light); }
  .nav-index { color: rgba(159, 191, 190, 0.55); }
  .nav-toggle { display: flex; }
}

/* ---- Hero: stack the portrait under the copy any time the row
   would otherwise get too tight to breathe (mobile + tablet). ---- */
@media (max-width: 1024px) {
  .hero-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-inner { max-width: 100%; }
  .hero-visual { justify-content: center; }
  .hero-actions { justify-content: flex-start; }
}

/* ---- About: single column on phones only; tablets keep the
   two-column layout since there's room for it. ---- */
@media (max-width: 767px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ---- General mobile polish: tighter section rhythm, tighter
   hero letter-spacing, comfortable full-width buttons. ---- */
@media (max-width: 767px) {
  .hero-title { gap: 0 0.2em; }
  section:not(.hero) { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
}

/* ---- Very small phones: reclaim a little extra horizontal room. ---- */
@media (max-width: 374px) {
  .skills-groups { gap: 2rem; }
  .goal-card, .skill-card, .contact-link, .meta-card { padding-left: 1.1rem; padding-right: 1.1rem; }
}

/* ---- Short / landscape phones and tablets: the hero shouldn't
   force a full viewport height when there isn't much of it. ---- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 6rem; padding-bottom: 3rem; }
  .avatar-float { animation: none; }
}

/* ---- Laptop and up: restore the roomier nav gap and hero gap
   now that there's space for them (fluid values already scale,
   this just nudges a couple of fixed gaps back up). ---- */
@media (min-width: 1025px) {
  .nav-links { gap: 2.5rem; }
}

/* ---- Large desktop: cap how wide the hero copy gets so lines
   don't run on forever on big Windows monitors / ultrawides. ---- */
@media (min-width: 1441px) {
  .hero-sub { max-width: 38em; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-glow { display: none; }
  .reveal { opacity: 1; transform: none; animation: none; }
}