:root {
  --ink: #12161c;
  --muted: #5a6573;
  --paper: #e8edf2;
  --line: rgba(24, 33, 44, 0.12);
  --line-strong: rgba(24, 33, 44, 0.28);
  --line-soft: rgba(24, 33, 44, 0.07);
  --accent: #0f8f7b;
  --accent-deep: #0b6b5c;
  --warm: #d9923a;
  --ink-black: #0a0c10;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Figtree", sans-serif;
  --brand-size: clamp(2.8rem, 8vw, 4.6rem);
  --ink-depth: 35vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--paper);
  line-height: 1.55;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.ink-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ink-depth);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ink-fill {
  position: absolute;
  inset: 0 0 70px 0;
  z-index: 0;
  background: #0b0d11;
}

.ink-stars {
  position: absolute;
  inset: 0 0 4.5rem 0;
  z-index: 1;
  overflow: hidden;
}

.ink-stars span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #f4f6f8;
  box-shadow: 0 0 6px rgba(244, 246, 248, 0.45);
  opacity: 0.35;
  animation: star-twinkle var(--t) ease-in-out var(--d) infinite;
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.85) translateY(0);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.25) translateY(-3px);
  }
}

.ink-svg {
  position: absolute;
  left: 0;
  bottom: -2px;
  z-index: 2;
  display: block;
  width: 200%;
  height: 110px;
  will-change: transform;
  animation: ink-drift 7s linear infinite;
}

.ink-wave {
  fill: #0b0d11;
}

.ink-buoy {
  position: absolute;
  top: 0;
  right: clamp(1.4rem, 8vw, 5.5rem);
  z-index: 3;
  width: clamp(52px, 7vw, 78px);
  pointer-events: none;
  mix-blend-mode: difference;
  will-change: transform;
}

.ink-buoy-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: #fff;
  fill: #fff;
}

.ink-buoy-rock {
  transform-box: fill-box;
  transform-origin: 50% 78%;
  animation: buoy-tilt 3.4s ease-in-out infinite;
}

.ink-buoy-flag {
  transform-box: fill-box;
  transform-origin: left center;
  animation: buoy-flag 1.7s ease-in-out infinite;
}

@keyframes buoy-tilt {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

@keyframes buoy-flag {
  0%,
  100% {
    transform: skewY(0deg) scaleX(1);
  }
  50% {
    transform: skewY(-10deg) scaleX(0.92);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(100%, 1100px);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 1.25rem 0 0;
  color: #f4f6f8;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo-mark {
  display: block;
  height: 1.4rem;
  width: auto;
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(244, 246, 248, 0.78);
}

.nav a:hover {
  color: #fff;
}

.hero {
  position: relative;
  min-height: 50vh;
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-plane {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(15, 143, 123, 0.16), transparent 36%),
    radial-gradient(circle at 82% 18%, rgba(217, 146, 58, 0.12), transparent 34%),
    var(--paper);
}

.hero-end {
  position: relative;
  /* No z-index — keeps mix-blend working against the ink layer. */
  padding-top: 3.25rem;
  padding-bottom: 10vh;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
}

.brand {
  position: relative;
  z-index: 2;
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: var(--brand-size);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.07em;
  color: #fff;
  mix-blend-mode: difference;
}

.hero h1,
.lede,
.cta-row {
  position: relative;
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.3vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0.7rem 0 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.86rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.cta.primary {
  background: #0b0d11;
  color: #f4f6f8;
}

.cta.primary:hover {
  background: #171a20;
  transform: translateY(-1px);
}

.cta.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.cta.ghost:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

main > .games,
main > .contact {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-head {
  margin: 0 0 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.04em;
}

.section-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head-rule {
  margin: 2.4rem 0 1.75rem;
}

.section-head-rule h2 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--ink);
}

.section-head-rule h2 span {
  flex: 0 0 auto;
}

.section-head-rule h2::after {
  content: "";
  flex: 1 1 auto;
  height: 2px;
  background: var(--ink);
  opacity: 0.88;
}

.section-head-rule p {
  margin-top: 0.55rem;
  font-size: 0.88rem;
}

.games {
  padding-top: 0.25rem;
  padding-bottom: 1.5rem;
}

.project {
  margin: 0;
  padding-left: 1.1rem;
}

.project-head {
  margin: 0 0 0.85rem;
}

.project-label {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.7vw, 1.12rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.project-desc {
  margin: 0.45rem 0 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-item {
  display: grid;
  gap: 0.85rem;
  padding: 0.55rem 0 1.15rem;
}

.game-rule-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}

.game-no {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.game-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--ink);
  opacity: 0.16;
}

.game-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
}

.game-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
}

.game-copy {
  display: grid;
  gap: 0.18rem;
}

.game-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
}

.game-actions {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
  align-self: center;
}

.game-panel-toggle {
  width: fit-content;
  margin: 0;
  padding: 0.42rem 0.78rem;
  border: 1.5px solid rgba(24, 33, 44, 0.28);
  border-radius: 8px;
  background: rgba(24, 33, 44, 0.04);
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.game-panel-toggle:hover,
.game-panel-toggle:focus-visible {
  background: rgba(24, 33, 44, 0.08);
  border-color: rgba(24, 33, 44, 0.5);
  outline: none;
}

.game-panel-toggle[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #f4f6f8;
}

.game-panel-toggle::before {
  content: "▸ ";
  font-size: 0.78em;
}

.game-panel-toggle[aria-expanded="true"]::before {
  content: "▾ ";
}

.game-fold {
  display: grid;
}

.game-fold-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s ease;
}

.game-fold-panel.is-open {
  grid-template-rows: 1fr;
}

.game-fold-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transform: translateY(-0.35rem);
  transition:
    opacity 0.28s ease,
    transform 0.38s ease;
}

.game-fold-panel.is-open .game-fold-inner {
  opacity: 1;
  transform: translateY(0);
}

.game-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  align-items: start;
}

.game-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #10141a;
}

.game-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-template-columns: none;
  min-height: 11.5rem;
  border-radius: 10px;
  background: rgba(24, 33, 44, 0.05);
  border: 1px dashed rgba(24, 33, 44, 0.14);
}

.game-media-placeholder p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--muted);
}

.game-item h3,
.game-item h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.game-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.22rem 0.32rem;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.meta-icon {
  width: 0.86rem;
  height: 0.86rem;
  flex: 0 0 auto;
  fill: currentColor;
  opacity: 0.78;
}

.meta-sep {
  color: var(--muted);
  font-weight: 600;
}

.plat-icon {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 auto;
  fill: currentColor;
  opacity: 0.88;
}

.store-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.2rem;
  display: grid;
  gap: 0.45rem;
}

.store-list li {
  margin: 0;
}

.store-link,
.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.store-link {
  color: var(--ink);
  border-bottom: 1px solid rgba(24, 33, 44, 0.18);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.store-link:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
}

.store-soon {
  color: var(--muted);
}

.status {
  width: fit-content;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.status.live {
  color: var(--accent-deep);
}

.status.soon {
  color: #8f5d16;
}

.contact {
  padding-top: 0.5rem;
  padding-bottom: 1.75rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0;
}

.contact-list li {
  display: grid;
  gap: 0.12rem;
}

.contact-sep {
  width: 1px;
  align-self: stretch;
  margin: 0.35rem 0.9rem 0.1rem;
  background: rgba(24, 33, 44, 0.16);
}

.contact-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-link {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  border-bottom: 1px solid rgba(24, 33, 44, 0.18);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-handle {
  font-family: "IBM Plex Sans", var(--font-body), sans-serif;
  font-weight: 400;
  font-feature-settings: "ss01" 0;
}

.contact-link:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
}

.site-footer {
  position: relative;
  margin-top: 2rem;
  padding: 0 0 1.2rem;
  color: rgba(244, 246, 248, 0.55);
  font-size: 0.84rem;
  overflow: hidden;
}

.footer-ink {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7.25rem;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.footer-ink-svg {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  width: 200%;
  height: 64px;
  will-change: transform;
  animation: ink-drift-rev 6s linear infinite;
}

.footer-ink-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  bottom: 0;
  z-index: 0;
  background: #0b0d11;
}

.footer-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 3.85rem;
}

.footer-bar p {
  margin: 0;
}

.site-footer .logo-mark {
  height: 1.15rem;
  opacity: 0.92;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.8s ease forwards;
}

.brand.reveal {
  opacity: 1;
  animation: brand-rise 0.8s ease both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.32s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes brand-rise {
  from {
    transform: translateY(14px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes ink-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes ink-drift-rev {
  from {
    transform: translate3d(-50%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 720px) {
  :root {
    --brand-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  .site-header {
    padding-top: 1rem;
  }

  .nav {
    gap: 0.9rem;
    font-size: 0.9rem;
  }

  .ink-svg {
    height: 72px;
  }

  .ink-fill {
    inset: 0 0 48px 0;
  }

  .shell {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .project,
  .contact-list {
    padding-left: 0.85rem;
  }

  .hero-end {
    padding-top: 3.5rem;
    padding-bottom: max(3.5rem, 8vh);
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.15rem, 5vw, 1.45rem);
  }

  .lede {
    max-width: none;
    font-size: 0.88rem;
  }

  .lede br {
    display: none;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 1.35rem;
  }

  .cta {
    width: 100%;
    min-height: 3rem;
  }

  .game-main {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 0.7rem;
  }

  .game-actions {
    align-self: start;
  }

  .game-panel-toggle {
    padding: 0.36rem 0.62rem;
    font-size: 0.78rem;
  }

  .game-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .game-media {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .game-media img {
    border-radius: 8px;
  }

  .game-media-placeholder {
    min-height: 7.5rem;
    border-radius: 8px;
  }

  .game-media-placeholder p {
    font-size: 1rem;
  }

  main > .games,
  main > .contact {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .games {
    padding-top: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .brand.reveal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  /* Keep the wave edge moving; only kill entrance motion. */
}
