:root {
  --bg: #121014;
  --bg-raised: #1b181f;
  --line: #2c2731;
  --text: #ece6ee;
  --muted: #a49cab;
  --accent: #c8323c;
  --accent-soft: #e0575f;
  --gold: #d6b26a;
  --radius: 14px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  margin: 0 0 .5em;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(18, 16, 20, .85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 20px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(145deg, var(--accent), #7a141c);
  display: grid; place-items: center; font-size: 15px; color: #fff;
}
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 96px 0 72px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto;
  width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 50, 60, .28), transparent);
  pointer-events: none;
}
.eyebrow {
  color: var(--gold); text-transform: uppercase; letter-spacing: .14em;
  font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(34px, 6vw, 58px); max-width: 14ch; }
.hero p { color: var(--muted); font-size: 19px; max-width: 56ch; margin: 0 0 32px; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: 15px; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost { border-color: var(--line); color: var(--text); margin-left: 8px; }
.btn-ghost:hover { border-color: var(--muted); }

/* Sections */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 32px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  display: flex; flex-direction: column;
}
.card h3 { font-size: 22px; margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0 0 16px; }
.card ul { color: var(--muted); padding-left: 20px; margin: 0 0 20px; }
.card ul li { margin-bottom: 4px; }
.card .meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.tag-gold { border-color: rgba(214, 178, 106, .5); color: var(--gold); }

.features { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.features h3 { font-size: 17px; font-family: "Inter", system-ui, sans-serif; letter-spacing: 0; }
.features p { color: var(--muted); margin: 0; font-size: 15px; }

/* Contact */
.contact-box {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; max-width: 640px;
}
.contact-box dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; }
.contact-box dt { color: var(--muted); }
.contact-box dd { margin: 0; overflow-wrap: anywhere; }
.prose { max-width: 68ch; color: var(--muted); }
.prose h2 { color: var(--text); font-size: 24px; margin-top: 40px; }
.prose strong { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 560px) {
  .nav { gap: 14px; font-size: 14px; }
  .hero { padding: 64px 0 48px; }
  .btn-ghost { margin: 10px 0 0; }
  .contact-box dl { grid-template-columns: 1fr; gap: 2px; }
  .contact-box dd { margin-bottom: 12px; }
}

/* Work / case studies */
.cs-meta { display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 8px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); max-width: 860px; }
.cs-meta dt { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; }
.cs-meta dd { margin: 4px 0 0; color: var(--text); font-size: 15px; }
.cs-body { max-width: 72ch; color: var(--muted); }
.cs-body h2 { color: var(--text); font-size: 24px; margin-top: 8px; }
.cs-body strong { color: var(--text); }
.cs-body ul { padding-left: 20px; }
.cs-body li { margin-bottom: 6px; }
.diagram { margin: 28px 0 8px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 560px; height: auto; }
.diagram svg .box { fill: #221e27; stroke: var(--line); stroke-width: 1.5; }
.diagram svg .box-accent { fill: rgba(200, 50, 60, .14); stroke: var(--accent); stroke-width: 1.5; }
.diagram svg .box-gold { fill: rgba(214, 178, 106, .1); stroke: var(--gold); stroke-width: 1.5; }
.diagram svg text { fill: var(--text); font: 600 14px "Inter", system-ui, sans-serif; }
.diagram svg text.sub { fill: var(--muted); font-weight: 400; font-size: 12px; }
.diagram svg .wire { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.diagram svg .wire-accent { stroke: var(--accent-soft); stroke-width: 2; fill: none; }
.diagram svg .arrow { fill: var(--muted); }
.diagram svg .arrow-accent { fill: var(--accent-soft); }
.caption { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.note { margin-top: 40px; padding: 16px 20px; border-left: 3px solid var(--gold); background: var(--bg-raised); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 15px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent-soft); text-decoration: none; }
.back { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.read-more { margin-top: 18px; font-weight: 600; font-size: 15px; }

/* Landing */
.brand-text { white-space: nowrap; }
.hero-home { padding: 88px 0 40px; }
.hero-home h1 { max-width: 16ch; }
.hero-home .role { color: var(--text); font-size: clamp(19px, 2.4vw, 23px); font-weight: 600; margin: -4px 0 14px; max-width: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 40px 0 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 860px; }
.stats div { background: var(--bg-raised); padding: 18px 20px; }
.stats b { display: block; font-family: "Cinzel", Georgia, serif; font-size: 26px; color: var(--text); line-height: 1.2; }
.stats span { color: var(--muted); font-size: 14px; }

.doors { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.door {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; color: var(--text); overflow: hidden;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1.2), border-color .2s, box-shadow .25s;
}
.door::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 50, 60, .22), transparent);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.door:hover, .door:focus-visible { text-decoration: none; transform: translateY(-4px); border-color: rgba(200, 50, 60, .55); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.door:hover::after, .door:focus-visible::after { opacity: 1; }
.door:active { transform: translateY(-1px) scale(.99); }
.door-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: rgba(200, 50, 60, .14); border: 1px solid rgba(200, 50, 60, .45); color: var(--accent-soft); }
.door-icon svg { width: 22px; height: 22px; }
.door .eyebrow { margin: 4px 0 0; font-size: 12px; }
.door h3 { font-size: 24px; margin: 0; }
.door p { color: var(--muted); margin: 0; }
.door .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.door .go { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 15px; color: var(--accent-soft); display: inline-flex; align-items: center; gap: 8px; }
.door .go i { font-style: normal; transition: transform .25s cubic-bezier(.2, .8, .2, 1.4); }
.door:hover .go i { transform: translateX(5px); }
.thumbs { display: flex; gap: 8px; }
.thumbs img { width: 33%; aspect-ratio: 315 / 250; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #1e1e1e; }

.links { display: flex; flex-wrap: wrap; gap: 10px; }
.links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 15px; transition: border-color .2s, transform .2s;
}
.links a:hover { text-decoration: none; border-color: var(--muted); transform: translateY(-2px); }
.links svg { width: 16px; height: 16px; color: var(--muted); }

/* Experience */
.timeline { display: grid; gap: 20px; }
.job { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.job-head h3 { font-size: 22px; margin: 0; }
.job-dates { color: var(--gold); font-weight: 600; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
.job-org { color: var(--muted); margin: 4px 0 16px; }
.job ul { color: var(--muted); padding-left: 20px; margin: 0; }
.job li { margin-bottom: 8px; }
.job li strong { color: var(--text); }
.skills { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.skills dt { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; padding-top: 3px; }
.skills dd { margin: 0; color: var(--muted); }

/* Games */
.game-card { padding: 0; overflow: hidden; transition: transform .25s cubic-bezier(.2, .8, .2, 1.2), border-color .2s; }
.game-card:hover { transform: translateY(-4px); border-color: rgba(200, 50, 60, .55); }
.game-card .cover { display: block; aspect-ratio: 315 / 250; background: #1e1e1e; overflow: hidden; }
.game-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.game-card:hover .cover img { transform: scale(1.04); }
.game-card .body { padding: 24px 28px 28px; display: flex; flex-direction: column; flex: 1; }
.game-card .meta .btn { margin: 0; }

/* Entrance */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
  .rise-2 { animation-delay: .08s; } .rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .door, .game-card, .links a, .door .go i, .game-card .cover img { transition: none; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
  .nav { gap: 12px; }
  .hero-home { padding: 56px 0 40px; }
  .stats div { padding: 14px 16px; }
  .stats b { font-size: 22px; }
  .door, .job { padding: 22px; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 12px; }
}
.doors-section { padding: 40px 0 72px; }
.games-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.games-grid .card h3 { font-size: 20px; }
.games-grid .card .body { padding: 20px 22px 24px; }
.cover-gen {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 35%, rgba(200, 50, 60, .35), transparent 65%), linear-gradient(160deg, #2a2230, #121014) !important;
  color: var(--gold); text-align: center; text-decoration: none !important;
}
.cover-gen svg { width: 42px; height: 42px; transition: transform .4s; }
.cover-gen span { font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: 18px; line-height: 1.15; color: var(--text); letter-spacing: .04em; }
.game-card:hover .cover-gen svg { transform: scale(1.08) rotate(-4deg); }

/* Case-study screenshots */
.shot { margin: 0 0 40px; }
.shot img {
  display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-raised);
}
.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }
.work-card { overflow: hidden; }
.work-thumb { display: block; margin: -28px -28px 22px; aspect-ratio: 16 / 9; overflow: hidden; background: #1e1e1e; border-bottom: 1px solid var(--line); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.work-card { transition: transform .25s cubic-bezier(.2, .8, .2, 1.2), border-color .2s; }
.work-card:hover { transform: translateY(-4px); border-color: rgba(200, 50, 60, .55); }
.work-card:hover .work-thumb img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .work-card, .work-thumb img { transition: none; } }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.games-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.callout { font-size: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(88, 101, 242, .12); border: 1px solid rgba(88, 101, 242, .4); }
.card .callout { color: var(--text); }
.callout strong { color: #a5b0ff; }
.tag-discord { border-color: rgba(88, 101, 242, .6); color: #a5b0ff; }
