:root {
  --paper: #f5f2ec;
  --ink: #17191d;
  --muted: #64676e;
  --line: #d7d2c9;
  --panel: #fcfaf6;
  --setback: #9e3d49;
  --pinochle: #285b78;
  --euchre: #855813;
  --bid-whist: #674184;
  --spades: #2e6158;
  --sheepshead: #8a3f67;
  --kicker: #9e3d49;
  --focus: #285b78;
  --green: #2f7b55;
  --shadow: 0 26px 70px rgba(28, 28, 25, 0.1);
  --motion-speed: 1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 82% 4%, rgba(49, 95, 122, 0.09), transparent 25rem),
    radial-gradient(circle at 8% 22%, rgba(181, 72, 81, 0.08), transparent 29rem),
    radial-gradient(circle at 92% 54%, rgba(103, 65, 132, 0.06), transparent 26rem),
    var(--paper);
  font-family: "Avenir Next", Avenir, "SF Pro Display", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.portfolio-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

.brand-bar {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 68px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  min-height: 44px;
  align-items: center;
}

.brand-lockup strong {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.quiet-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  transition: border-color 160ms ease;
}

.quiet-link:hover,
.quiet-link:focus-visible {
  border-color: var(--ink);
}

.quiet-link:focus-visible,
.primary-link:focus-visible,
.game-link:focus-visible,
.tile-learn-link:focus-visible,
.brand-lockup:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.hero {
  min-height: min(670px, 76vh);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 74px 0 84px;
}

.kicker {
  margin: 0 0 19px;
  color: var(--kicker);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 980px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 8.2vw, 7.1rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.91;
}

.hero-copy {
  max-width: 680px;
  margin: 32px 0 36px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 34px;
  min-height: 52px;
  padding: 0 21px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.games-section {
  padding: 80px 0 110px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}

.section-heading .kicker {
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.section-heading > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.game-tile {
  --game-accent: var(--setback);
  position: relative;
  min-height: 455px;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 2.7vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.game-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--game-accent);
}

.game-tile::after {
  content: "";
  position: absolute;
  top: -86px;
  right: -82px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--game-accent);
  opacity: 0.075;
  pointer-events: none;
}

.game-tile:hover {
  border-color: var(--game-accent);
  box-shadow: 0 30px 76px rgba(28, 28, 25, 0.14);
  transform: translateY(-3px);
}

.game-tile > * {
  position: relative;
  z-index: 1;
}

.game-tile.setback,
.game-mark.setback {
  --game-accent: var(--setback);
}

.game-tile.pinochle,
.game-mark.pinochle {
  --game-accent: var(--pinochle);
}

.game-tile.euchre,
.game-mark.euchre {
  --game-accent: var(--euchre);
}

.game-tile.bid-whist,
.game-mark.bid-whist {
  --game-accent: var(--bid-whist);
}

.game-tile.spades,
.game-mark.spades {
  --game-accent: var(--spades);
}

.game-tile.sheepshead,
.game-mark.sheepshead {
  --game-accent: var(--sheepshead);
}

.tile-topline,
.tile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  color: white;
  background: var(--game-accent);
  box-shadow: 0 12px 24px rgba(23, 25, 29, 0.13);
  font: 2.35rem Georgia, serif;
}

.game-mark.setback {
  transform: rotate(-3deg);
}

.game-mark.pinochle {
  transform: rotate(3deg);
}

.game-mark.euchre {
  transform: rotate(-2deg);
}

.game-mark.bid-whist {
  transform: rotate(2deg);
}

.game-mark.spades {
  transform: rotate(-4deg);
}

.game-mark.sheepshead {
  transform: rotate(3deg);
}

.game-mark.sheepshead span {
  font-size: 1.75rem;
  letter-spacing: -0.14em;
  transform: translateX(-0.07em);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(58, 139, 98, 0.12);
}

.game-copy {
  margin: auto 0;
}

.game-copy > p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-copy h3 {
  margin: 0 0 17px;
  font-family: Georgia, serif;
  font-size: clamp(2.75rem, 4.2vw, 4.35rem);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.game-tile.sheepshead .game-copy h3 {
  font-size: clamp(2.45rem, 3.55vw, 3.75rem);
}

.game-copy > span {
  max-width: 400px;
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.tile-actions {
  align-items: flex-start;
  flex-direction: column;
}

.game-link {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  padding: 0 18px;
  border-radius: 15px;
  color: white;
  background: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  transition: transform 160ms ease;
}

.game-link:hover,
.game-link:focus-visible {
  transform: translateY(-2px);
}

.tile-actions small {
  color: var(--muted);
  font-size: 0.72rem;
}

.tile-learn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--game-accent);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.tile-learn-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.promise-section {
  padding: 100px 0;
  border-top: 1px solid var(--line);
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 38px;
}

.promise-grid article {
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}

.promise-grid strong {
  font: 1.55rem Georgia, serif;
}

.promise-grid p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.site-footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

.game-frame-page {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0c1015;
}

.game-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.global-menu-trigger {
  position: fixed;
  z-index: 100;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: calc(env(safe-area-inset-left, 0px) + 18px);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 10px 26px rgba(17, 19, 23, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
}

.global-menu-trigger svg,
.global-menu-close svg,
.global-menu-home svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-menu-trigger:focus-visible,
.global-menu-close:focus-visible,
.global-menu-home:focus-visible,
.global-menu-panel button:focus-visible,
.global-menu-panel input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.global-menu-backdrop {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  background: rgba(8, 10, 13, 0.46);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: global-backdrop-in calc(180ms / var(--motion-speed)) ease both;
}

.global-menu-panel {
  width: min(390px, calc(100vw - 22px));
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px 28px;
  border-right: 1px solid var(--line);
  border-radius: 0 24px 24px 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 28px 0 70px rgba(5, 6, 8, 0.2);
  animation: global-panel-in calc(260ms / var(--motion-speed))
    cubic-bezier(0.2, 0.88, 0.24, 1) both;
}

.global-menu-panel > header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.global-menu-panel > header p {
  margin: 0 0 3px;
  color: var(--kicker);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.global-menu-panel > header h2 {
  margin: 0;
  font: 400 2rem/1 Georgia, serif;
  letter-spacing: -0.04em;
}

.global-menu-close {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
}

.global-menu-home {
  min-height: 72px;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
}

.global-menu-home span {
  display: grid;
  gap: 3px;
}

.global-menu-home strong {
  font-size: 0.9rem;
}

.global-menu-home small,
.global-menu-home b {
  color: var(--muted);
  font-size: 0.7rem;
}

.global-menu-home b {
  font-weight: 700;
}

.global-menu-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.global-menu-section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 17px;
}

.global-menu-section-heading strong {
  font: 400 1.35rem Georgia, serif;
}

.global-menu-section-heading small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.global-theme-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 19px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.global-theme-choice button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.global-theme-choice button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 3px 10px rgba(17, 19, 23, 0.09);
}

.global-menu-range {
  display: grid;
  gap: 10px;
  margin: 19px 0;
}

.global-menu-range > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.8rem;
}

.global-menu-range output {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.global-menu-range input {
  width: 100%;
  accent-color: var(--focus);
}

.global-menu-toggle {
  position: relative;
  min-height: 49px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.global-menu-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.global-menu-toggle i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
  transition:
    border-color calc(160ms / var(--motion-speed)) ease,
    background calc(160ms / var(--motion-speed)) ease;
}

.global-menu-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(17, 19, 23, 0.18);
  transition: transform calc(180ms / var(--motion-speed))
    cubic-bezier(0.2, 0.9, 0.25, 1.2);
}

.global-menu-toggle input:checked + i {
  border-color: var(--green);
  background: var(--green);
}

.global-menu-toggle input:checked + i::after {
  transform: translateX(18px);
}

@keyframes global-backdrop-in {
  from { opacity: 0; }
}

@keyframes global-panel-in {
  from { transform: translateX(-102%); }
}

@media (max-width: 1020px) {
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-copy h3,
  .game-tile.sheepshead .game-copy h3 {
    font-size: clamp(3rem, 7vw, 5rem);
  }
}

@media (max-width: 760px) {
  .portfolio-shell {
    padding: 0 18px;
  }

  .brand-bar {
    min-height: 78px;
    padding-left: 62px;
  }

  .hero {
    min-height: 620px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 15vw, 5.3rem);
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 14px;
  }

  .game-grid,
  .promise-grid {
    grid-template-columns: 1fr;
  }

  .game-tile {
    min-height: 430px;
  }

  .promise-grid {
    gap: 32px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #0d1014;
    --ink: #f5f2eb;
    --muted: #aeb2bb;
    --line: #333942;
    --panel: #171b21;
    --kicker: #ee808c;
    --focus: #78bfe8;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  }

  :root:not([data-theme]) body {
    background:
      radial-gradient(circle at 82% 4%, rgba(49, 95, 122, 0.24), transparent 25rem),
      radial-gradient(circle at 8% 22%, rgba(181, 72, 81, 0.2), transparent 29rem),
      radial-gradient(circle at 92% 54%, rgba(103, 65, 132, 0.16), transparent 26rem),
      var(--paper);
  }

  :root:not([data-theme]) .primary-link,
  :root:not([data-theme]) .game-link {
    color: #17191d;
    background: #f5f2eb;
  }

  :root:not([data-theme]) .game-tile:hover {
    box-shadow: var(--shadow);
  }
}

:root[data-theme="dark"] {
  --paper: #0d1014;
  --ink: #f5f2eb;
  --muted: #aeb2bb;
  --line: #333942;
  --panel: #171b21;
  --kicker: #ee808c;
  --focus: #78bfe8;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 4%, rgba(49, 95, 122, 0.24), transparent 25rem),
    radial-gradient(circle at 8% 22%, rgba(181, 72, 81, 0.2), transparent 29rem),
    radial-gradient(circle at 92% 54%, rgba(103, 65, 132, 0.16), transparent 26rem),
    var(--paper);
}

:root[data-theme="dark"] .primary-link,
:root[data-theme="dark"] .game-link {
  color: #17191d;
  background: #f5f2eb;
}

:root[data-theme="dark"] .game-tile:hover {
  box-shadow: var(--shadow);
}
