:root {
  --bg: #0a1929;
  --panel: #142540;
  --sub-panel: #1f3553;
  --text: #f5e9d0;
  --text-dim: #c9b896;
  --accent: #ff7a59;
  --accent-strong: #ff8d72;
  --accent-glow: rgba(255, 122, 89, 0.32);
  --success: #4ade80;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 48px clamp(20px, 5vw, 64px);
  max-width: 1320px;
  margin: 0 auto;
}

@media (min-width: 880px) {
  .page {
    grid-template-columns: minmax(280px, 0.85fr) 1.15fr;
    gap: clamp(40px, 5vw, 72px);
    padding: 64px clamp(40px, 6vw, 80px);
    align-items: stretch;
    min-height: 100vh;
  }
}

/* Bio --------------------------------------------------------------- */

.bio {
  display: flex;
  align-items: center;
}

.bio-inner {
  width: 100%;
}

.name {
  font-size: clamp(48px, 9vw, 88px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.96;
  margin-bottom: 28px;
  display: block;
  font-variation-settings: "opsz" 96;
}

.period {
  display: inline-block;
  color: var(--accent);
  transform-origin: center 78%;
  animation: period-wink 3.6s ease-in-out infinite;
}

@keyframes period-wink {
  0%,
  82%,
  100% {
    transform: scaleY(1);
  }
  86% {
    transform: scaleY(0.08);
  }
  92% {
    transform: scaleY(1);
  }
}

.tagline {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
  color: var(--text);
  max-width: 30ch;
  margin-bottom: 36px;
  font-variation-settings: "opsz" 24;
}

.contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

/* Say hello (typewriter rotator) ----------------------------------- */

.say-hello {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  padding: 6px 0;
  position: relative;
  transition: transform 200ms ease;
}

.say-hello:hover,
.say-hello:focus-visible {
  outline: none;
  transform: translateX(2px);
}

.say-hello-prefix {
  color: var(--text);
}

.rotator {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  min-width: 4ch;
}

.rotator::before {
  content: "";
  position: absolute;
  inset: -8px -14px;
  background: radial-gradient(
    ellipse at center,
    var(--accent-glow) 0%,
    transparent 65%
  );
  z-index: -1;
  opacity: 0.7;
  pointer-events: none;
  filter: blur(2px);
}

.rotator-word {
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 122, 89, 0.35);
  white-space: nowrap;
}

.rotator-cursor {
  color: var(--accent);
  font-weight: 400;
  margin-left: 1px;
  animation: cursor-blink 1s steps(2, jump-none) infinite;
}

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

.email-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: clamp(17px, 1.7vw, 21px);
  letter-spacing: 0.01em;
  border-bottom: 1px solid transparent;
  transition:
    color 160ms ease,
    border-color 160ms ease;
  position: relative;
  padding-left: 26px;
}

.email-link::before {
  content: "↳";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 1em;
}

.email-link:hover,
.email-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* Game -------------------------------------------------------------- */

.game-wrap {
  display: flex;
}

.game {
  position: relative;
  width: 100%;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.game-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}

.game-status {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
  flex: 1;
}

.column {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.column-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding: 0 2px;
}

.cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  line-height: 1.3;
  color: var(--text);
  background: var(--sub-panel);
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    opacity 200ms ease;
  width: 100%;
  display: block;
}

.card:hover,
.card:focus-visible {
  background: #2a4670;
  outline: none;
  transform: translateY(-1px);
}

.card.is-doing {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.card.is-doing:hover,
.card.is-doing:focus-visible {
  background: var(--accent);
  transform: none;
}

.card.is-doing::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: rgba(10, 25, 41, 0.4);
  transform-origin: left;
  animation: progress var(--doing-duration, 2000ms) linear forwards;
}

@keyframes progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.card.is-done {
  background: var(--success);
  color: var(--bg);
  font-weight: 600;
  cursor: default;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.92;
}

.card.is-done:hover,
.card.is-done:focus-visible {
  background: var(--success);
  transform: none;
}

.card.spawn {
  animation: spawn 240ms ease-out;
}

@keyframes spawn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.column.shake {
  animation: shake 280ms ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

.game-foot {
  margin-top: 14px;
  text-align: right;
  min-height: 14px;
}

.hint {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.hint.is-hidden {
  visibility: hidden;
}

/* Overlay (start / win / lose) ------------------------------------- */

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 41, 0.94);
  backdrop-filter: blur(2px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 280ms ease;
  text-align: center;
  padding: 32px;
}

.overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-inner {
  max-width: 340px;
}

.overlay-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}

.overlay.is-won .overlay-title {
  color: var(--accent);
}

.overlay-message {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}

.overlay-button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 220ms ease;
  box-shadow: 0 4px 14px rgba(255, 122, 89, 0.18);
}

.overlay-button:hover,
.overlay-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  background: var(--accent-strong);
  box-shadow: 0 8px 22px rgba(255, 122, 89, 0.32);
}

/* Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
