/* dragnius.com, v3.2 (2026-12). Hand-written, no framework. Day and night themes. */

:root,
[data-theme="night"] {
  --bg: #0e1422;
  --surface: #151d31;
  --surface-2: #1b2540;
  --line: #26304d;
  --ink: #efe9dc;
  --ink-2: #c9c3b6;
  --ink-3: #9d988c;
  --accent: #f2b84b;       /* amber */
  --accent-text: #f2b84b;
  --on-accent: #0e1422;
  --star: #efe9dc;
  --drake: #efe9dc;
  --ridge: rgba(239, 233, 220, .35);
  --screen: #07090e;
  color-scheme: dark;
}
[data-theme="day"] {
  --bg: #f6f1e4;
  --surface: #fffaf0;
  --surface-2: #efe7d4;
  --line: #e0d6c0;
  --ink: #1f2a44;
  --ink-2: #3d4660;
  --ink-3: #5d6478;
  --accent: #e07a5f;       /* coral, for fills */
  --accent-text: #a8452c;  /* darker coral, for text on paper */
  --on-accent: #1f2a44;
  --star: #1f2a44;
  --drake: #1f2a44;
  --ridge: rgba(31, 42, 68, .35);
  --screen: #07090e;
  color-scheme: light;
}

:root {
  --display: "Space Grotesk", "Inter", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s ease, color .5s ease;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden], .hidden { display: none !important; }

.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 20; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 16px; }

/* Header */
.site-header { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding-top: 24px; padding-bottom: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.logo svg { width: 34px; height: 28px; color: var(--drake); transition: transform .4s cubic-bezier(.3,1.5,.5,1); }
.logo:hover svg { transform: translateX(-3px) rotate(-6deg); }
.header-right { display: flex; align-items: center; gap: 6px; }
.site-header nav { display: flex; gap: 2px; font-size: 15px; }
.site-header nav a {
  text-decoration: none; color: var(--ink-2); padding: 10px 12px; border-radius: 8px;
  background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 2px; background-repeat: no-repeat;
  background-position: 12px calc(100% - 8px); transition: background-size .25s, color .15s;
}
.site-header nav a:hover { color: var(--ink); background-size: calc(100% - 24px) 2px; }

.theme-toggle {
  position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; overflow: hidden;
  transition: border-color .2s, transform .15s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle svg { position: absolute; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: transform .5s cubic-bezier(.3,1.4,.5,1), opacity .3s; }
.icon-moon { fill: currentColor !important; stroke: none !important; }
[data-theme="night"] .icon-sun { transform: translateY(26px) rotate(90deg); opacity: 0; }
[data-theme="day"] .icon-moon { transform: translateY(-26px) rotate(-90deg); opacity: 0; }

/* Hero */
.hero { position: relative; overflow: hidden; min-height: min(84vh, 760px); display: flex; align-items: center; padding: 40px 0 120px; margin-top: -92px; padding-top: 132px; }
.sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; transition: opacity .8s ease; }
.stars circle { fill: var(--star); opacity: .7; }
.sparkles use { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.tw { animation: twinkle 3.6s ease-in-out infinite; }
.tw-2 { animation-delay: 1.2s; } .tw-3 { animation-delay: 2.3s; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
[data-theme="day"] .stars, [data-theme="day"] .sparkles { opacity: 0; transition: opacity .6s; }
.stars, .sparkles { transition: opacity .8s; }

.hero-inner { position: relative; z-index: 2; width: 100%; }
.hero-text { max-width: 560px; }
.hello { margin: 0 0 14px; font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--accent-text); }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 5.2vw, 70px); line-height: 1.04; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.lede { margin: 22px 0 0; font-size: clamp(18px, 1.4vw, 20px); color: var(--ink-2); max-width: 40ch; }

.hero-drake {
  /* Width is whatever is left to the right of the hero text (text starts at the wrap's edge and needs ~550px), capped. */
  --dw: min(860px, 58vw, calc(100vw - max(var(--gutter), (100vw - var(--wrap)) / 2) - 550px));
  position: absolute; z-index: 1; right: 0; top: 50%; transform: translateY(-46%);
  width: var(--dw); height: calc(var(--dw) * 170 / 300); color: var(--drake);
  transition: color .5s ease;
}
.ridge { position: absolute; left: 0; right: 0; bottom: 18px; width: 100%; height: 70px; z-index: 1; }
.ridge path { fill: none; stroke: var(--ridge); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ridge .flag { stroke: var(--accent); }

.enter { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.enter-2 { animation: glide 1.2s .15s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes glide { from { opacity: 0; transform: translate(60px, -46%); } to { opacity: 1; transform: translate(0, -46%); } }
@keyframes glide-sm { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }

/* Sections */
.section { padding-top: 96px; padding-bottom: 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 32px; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 3.4vw, 46px); letter-spacing: -0.025em; line-height: 1.1; margin: 0; }
.section-note { margin: 0; color: var(--ink-3); font-size: 15px; }
.section-link { color: var(--accent-text); text-decoration: none; font-weight: 500; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
.section-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.muted { color: var(--ink-3); }
h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; }

/* Game: Summit */
.game { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.screen {
  position: relative; aspect-ratio: 1280 / 852; border-radius: var(--radius); overflow: hidden;
  background: var(--screen); border: 1px solid var(--line); box-shadow: 0 20px 50px -30px rgba(0,0,0,.6);
}
.screen img, .screen iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; image-rendering: pixelated; transition: transform .5s ease; }
.game:hover .screen img { transform: scale(1.025); }
.game-status { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 4px rgba(62, 207, 142, .18); }
.game h3 { font-size: clamp(28px, 2.6vw, 36px); margin: 10px 0 0; }
.game-text p { margin: 12px 0 0; color: var(--ink-2); }
.game-text p.muted { color: var(--ink-3); font-size: 16px; }

/* Arena */
.arena { margin-top: 72px; padding: 22px; border-radius: calc(var(--radius) + 6px); background: var(--surface); border: 1px solid var(--line); }
.arena-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; margin-bottom: 18px; }
.arena-head h3 { font-size: clamp(26px, 2.4vw, 32px); margin: 0; }
.arena-head p { margin: 8px 0 0; max-width: 60ch; }
.arena-stats { display: flex; gap: 18px; font-size: 14px; color: var(--ink-3); margin: 0 !important; font-variant-numeric: tabular-nums; }
.arena-stats strong { color: var(--ink); font-weight: 600; }
.arena-stats .text-amber-400 { color: var(--accent-text); }
.arena-stats .text-emerald-400 { color: #1c7049; }
[data-theme="night"] .arena-stats .text-emerald-400 { color: #4fd79b; }

.arena-screen { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--screen); }
.arena-screen canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.arena-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(7, 9, 14, .62); color: #efe9dc; text-align: center; padding: 16px;
}
.arena-overlay p { margin: 0; font-size: 14px; color: #c9c3b6; }
.overlay-drake { width: 64px; height: 52px; color: #efe9dc; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.arena-overlay .btn-primary { background: #f2b84b; border-color: #f2b84b; color: #0e1422; }

.arena-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 16px; }
.arena-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  font: 500 14px/1 var(--sans); cursor: pointer; transition: border-color .15s, transform .15s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip:active { transform: translateY(1px); }
#ecs-pet-mode { color: var(--accent-text); font-weight: 600; }
.keys { margin: 0; font-size: 14px; color: var(--ink-3); }
kbd { font: 600 12px/1 var(--sans); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }

/* In progress */
.milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 2px solid var(--line); }
.milestones li { position: relative; padding: 26px 24px 8px 0; }
.milestones li::before {
  content: ""; position: absolute; top: -8px; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
}
.milestones li.done::before { background: var(--ink-3); border-color: var(--ink-3); }
.milestones li.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.ms-state { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.milestones li.now .ms-state { color: var(--accent-text); }
.milestones h3 { font-size: 21px; margin: 6px 0 0; }
.milestones p { margin: 8px 0 0; color: var(--ink-2); font-size: 16px; }

/* Things I built */
.builds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.build { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .2s, border-color .2s; }
.build:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.build h3 { font-size: 22px; margin: 0; }
.build p { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }
.build .stack { margin-top: auto; padding-top: 16px; font-size: 14px; color: var(--ink-3); }
.build .section-link { align-self: flex-start; margin: 4px 0 -12px; }

/* About */
.about { position: relative; display: grid; grid-template-columns: 1fr; padding-bottom: 72px; }
.about-body { max-width: 680px; }
.about-lead { font-family: var(--display); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 18px; }
.about-body p { color: var(--ink-2); margin: 0 0 14px; }
.about-drake { position: absolute; right: var(--gutter); bottom: 60px; width: 160px; height: 130px; color: var(--line); transform: scaleX(-1); }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3); }
.footer-mark { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; color: var(--ink-2); }
.footer-mark svg { width: 24px; height: 20px; color: var(--ink-2); }
.site-footer a { color: var(--ink-2); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: var(--accent-text); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .enter, .enter-2, .tw, .overlay-drake { animation: none !important; }
  .hero-drake { transform: translateY(-46%); }
  *, *::before, *::after { transition-duration: 0s !important; }
}

/* Medium */
@media (max-width: 1000px) {
  /* Not enough room beside the text: the drake sits under it instead */
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero-drake { --dw: min(640px, 80vw); position: relative; top: auto; right: auto; transform: none; display: block; margin: 32px calc(-1 * var(--gutter)) 0 auto; }
  .enter-2 { animation-name: glide-sm; }
  .game { grid-template-columns: 1fr; }
  .milestones { grid-template-columns: repeat(2, 1fr); row-gap: 24px; border-top: 0; }
  .milestones li { border-top: 2px solid var(--line); }
  .builds { grid-template-columns: 1fr 1fr; }
  .about-drake { display: none; }
}

/* Small */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { padding-bottom: 40px; }
  .hero-drake { --dw: 100vw; margin-top: 36px; }
  .ridge { position: relative; bottom: auto; height: 46px; margin-top: -6px; }
  .actions .btn { flex: 1 1 auto; }
  .site-header nav a { padding: 12px 8px; background-position: 8px calc(100% - 9px); }
  .site-header nav a:hover { background-size: calc(100% - 16px) 2px; }
  .milestones, .builds { grid-template-columns: 1fr; }
  .arena { padding: 14px; margin-top: 56px; }
  .section { padding-top: 72px; }
}
@media (max-width: 420px) {
  .logo span { display: none; }
}
