:root {
  --paper: #f6f6ee;
  --paper-bright: #fffef7;
  --ink: #152d4f;
  --ink-soft: #617177;
  --rule: rgba(21, 45, 79, 0.16);
  --mint: #70ceb0;
  --coral: #ef7e7a;
  --ochre: #e6a137;
  --sky: #73a8de;
  --shadow: rgba(44, 63, 67, 0.12);
  --page: min(1180px, calc(100vw - 48px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(112, 206, 176, 0.08), transparent 23rem),
    radial-gradient(circle at 88% 42%, rgba(239, 126, 122, 0.06), transparent 28rem),
    var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
  z-index: 20;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 30;
  padding: .65rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  width: var(--page);
  margin: 0 auto;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  box-shadow: 0 0 0 100vmax var(--ink);
  clip-path: inset(0 -100vmax);
}

.brand {
  color: var(--paper-bright);
  text-decoration: none;
  font-family: Baskerville, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 2.8rem); }

.nav a, .footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .9rem;
  letter-spacing: .025em;
  transition: color 160ms ease;
}

.nav a { position: relative; }

.site-header .nav a { color: rgba(255, 254, 247, .72); }
.site-header .nav a:hover,
.site-header .nav a:focus-visible,
.site-header .nav a[aria-current] { color: var(--paper-bright); }

.nav a::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: 50%;
  bottom: -.55rem;
  border-radius: 50%;
  background: var(--coral);
  opacity: 0;
  transform: translateX(-50%) scale(.4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav a:nth-child(1)::after { background: var(--coral); }
.nav a:nth-child(2)::after { background: var(--mint); }
.nav a:nth-child(3)::after { background: var(--ochre); }

.nav a:hover, .nav a:focus-visible, .footer-nav a:hover, .footer-nav a:focus-visible { color: var(--ink); }
.nav a:hover::after, .nav a:focus-visible::after, .nav a[aria-current]::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

main { overflow: hidden; }

.hero {
  width: var(--page);
  min-height: calc(100svh - 92px);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 9rem) 0 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin-bottom: 2rem;
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(3.35rem, 8.6vw, 8rem);
  font-weight: 400;
  line-height: .9;
  letter-spacing: -.055em;
}

h1 span { display: block; margin-left: .42em; font-style: italic; }

.lede {
  max-width: 660px;
  margin-bottom: 2.2rem;
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2.5vw, 2.05rem);
  line-height: 1.42;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.text-link::after { content: "\2193"; color: var(--coral); font-size: 1.15rem; transition: transform 160ms ease; }
.text-link:hover::after, .text-link:focus-visible::after { transform: translateY(.2rem); }
.text-link-right::after { content: "\2192"; }
.text-link-right:hover::after, .text-link-right:focus-visible::after { transform: translateX(.25rem); }

.kept-object {
  position: relative;
  min-height: 450px;
  display: grid;
  place-items: center;
}

.box-image {
  width: min(100%, 430px);
  filter: drop-shadow(0 28px 24px rgba(38, 28, 20, .16));
}

.kept-object::before, .kept-object::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}

.kept-object::before { width: 92px; height: 92px; top: 8%; right: 2%; background: var(--mint); }
.kept-object::after { width: 44px; height: 44px; bottom: 14%; left: 2%; background: var(--coral); }

.game-section { padding: clamp(5.5rem, 12vw, 11rem) 0; background: var(--paper-bright); }

.section-grid {
  width: var(--page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .38fr) minmax(0, 1fr);
  gap: clamp(3rem, 8vw, 8rem);
}

.section-number { color: var(--coral); font-size: .78rem; font-weight: 700; letter-spacing: .12em; }

h2 {
  margin-bottom: 1.5rem;
  font-family: Iowan Old Style, Baskerville, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.section-intro { max-width: 620px; color: var(--ink-soft); font-size: 1.08rem; }

.media-stage {
  position: relative;
  margin-top: 4rem;
  padding: clamp(1rem, 2vw, 1.6rem);
  background: #d8f1ed;
  box-shadow: 0 22px 60px var(--shadow);
}

.media-stage > img { width: 100%; max-height: 720px; object-fit: cover; object-position: center; }

.media-label {
  position: absolute;
  top: 2rem;
  left: 2rem;
  padding: .55rem .8rem;
  background: rgba(255, 254, 247, .92);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.image-pair {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr .72fr;
  gap: 1.5rem;
  align-items: start;
}

.image-pair figure { margin: 0; }
.image-pair figure:last-child { padding-top: 5rem; }
.image-pair img { width: 100%; background: var(--paper); }

figcaption {
  padding-top: .8rem;
  color: var(--ink-soft);
  font-size: .76rem;
  letter-spacing: .055em;
}

.studio-section { width: var(--page); margin: 0 auto; padding: clamp(7rem, 15vw, 13rem) 0; }

.studio-copy { max-width: 850px; }
.studio-copy h2 { font-size: clamp(2.5rem, 6.5vw, 6.2rem); }
.studio-copy p { max-width: 620px; color: var(--ink-soft); font-size: 1.1rem; }

.support-strip { border-top: 1px solid var(--rule); }

.support-inner {
  width: var(--page);
  margin: 0 auto;
  padding: 4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.support-inner h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.support-links { display: flex; flex-wrap: wrap; gap: .8rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .65rem 1rem;
  border: 1px solid var(--rule);
  background: rgba(255,255,255,.3);
  color: var(--ink);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover, .button:focus-visible { background: white; border-color: var(--sky); transform: translateY(-2px); }

.site-footer {
  width: var(--page);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: var(--ink-soft);
  font-size: .78rem;
}

.footer-info { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem; }
.footer-brand { display: block; flex-shrink: 0; width: min(468px, 44%); }
.footer-brand img { width: 100%; height: auto; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.social-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: background 160ms ease;
}
.social-links a:hover, .social-links a:focus-visible { background: rgba(21, 45, 79, .06); }
.social-links img { width: 24px; height: 24px; object-fit: contain; }

.utility-page { width: min(760px, calc(100vw - 48px)); margin: 0 auto; padding: clamp(5rem, 12vw, 9rem) 0 8rem; }
.utility-page h1 { font-size: clamp(3.2rem, 8vw, 6.5rem); }
.utility-page h2 { margin-top: 3rem; font-size: 1.7rem; }
.utility-page h3 { margin: 2rem 0 .65rem; font-size: 1rem; }
.utility-page p, .utility-page li { color: var(--ink-soft); }
.utility-page .back { margin-bottom: 4rem; display: inline-block; }

.license-notice { margin: 1.5rem 0; border: 1px solid var(--rule); background: rgba(255, 255, 255, .28); }
.license-notice summary { padding: 1rem 1.2rem; cursor: pointer; color: var(--ink); font-weight: 650; }
.license-notice pre { max-height: 34rem; margin: 0; padding: 1.2rem; overflow: auto; border-top: 1px solid var(--rule); color: var(--ink-soft); background: var(--paper-bright); font: .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.credit-list { padding-left: 1.25rem; }
.credit-list li + li { margin-top: .7rem; }
.credits-note { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: .85rem; }

.page-shell { width: var(--page); min-height: calc(100svh - 92px); margin: 0 auto; }

.page-intro { max-width: 900px; padding: clamp(5rem, 11vw, 9rem) 0 clamp(5rem, 10vw, 8rem); }
.page-intro .lede { max-width: 720px; }

.game-page {
  --kept-teal: #103f4b;
  --kept-brass: #ae8954;
}

.kept-hero {
  --notebook-margin: clamp(.65rem, 2vw, 1.5rem);
  --notebook-rule: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  margin-block: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 4.5vw, 4rem);
  border: 1px solid #d9cbb2;
  border-radius: 4px;
  background:
    linear-gradient(#b4706255, #b4706255) var(--notebook-margin) 0 / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--notebook-rule) - 1px), #63868b30 calc(var(--notebook-rule) - 1px) var(--notebook-rule)),
    linear-gradient(110deg, #faf2e1, #eee1c9);
}

.kept-postcard { margin: 0; }
.kept-postcard img { width: 100%; height: auto; }
.kept-hero .lede { margin-bottom: 1rem; line-height: 1.22; }
.kept-checklist {
  margin: 0 0 1.65rem;
  padding: 0;
  list-style: none;
  color: var(--kept-teal);
  font-family: "Bradley Hand", "Segoe Print", Georgia, serif;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  font-style: italic;
  line-height: var(--notebook-rule);
}

.kept-checklist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4em; }
.kept-checklist img { width: max(17px, 1em); height: auto; margin-top: 4px; }
.game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.app-store-badge img { display: block; width: auto; height: 44px; }
.kept-watch { gap: .5rem; }
.kept-watch span { color: var(--kept-teal); font-size: .68rem; }

.kept-gameplay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 6vw, 4.5rem);
  border: 1px solid #2a6170;
  border-radius: 4px;
  background: radial-gradient(ellipse at 85% 35%, #1a5864, transparent 65%), var(--kept-teal);
  color: var(--paper-bright);
  scroll-margin-top: 1rem;
}

.kept-gameplay .eyebrow { margin-bottom: 1rem; color: #efcd8b; }
.kept-gameplay h2 { max-width: 13ch; margin-bottom: 1.2rem; text-wrap: balance; }
.kept-gameplay-copy p:last-child { max-width: 38ch; margin-bottom: 0; color: #dfebeb; }
.kept-video {
  position: relative;
  justify-self: center;
  width: min(100%, 13rem);
  border: 1px solid var(--kept-brass);
  border-radius: 6px;
  background: #0d2933;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.kept-video video {
  display: block;
  width: 100%;
  aspect-ratio: 416 / 900;
  border-radius: 5px;
  object-fit: contain;
}

.kept-video-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  padding: 0 0 0 3px;
  border: 1px solid #efcd8b;
  border-radius: 50%;
  background: var(--kept-teal);
  color: var(--paper-bright);
  font: inherit;
  cursor: pointer;
}

.kept-video-play:hover { background: var(--ink); }
.kept-features { padding: clamp(1.75rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 6rem); border-top: 1px solid var(--kept-brass); }
.kept-features-intro { max-width: 41rem; margin-bottom: 1.75rem; }
.kept-features-intro h2, .kept-community h2 { margin-bottom: .7rem; color: var(--kept-teal); }
.kept-features-intro p, .kept-community p { margin-bottom: 0; color: var(--ink-soft); }
.kept-gallery-controls { display: none; }
.kept-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.85rem, 2.2vw, 1.65rem); }
.kept-screenshot { display: block; border-radius: 5px; box-shadow: 0 8px 20px var(--shadow); }
.kept-screenshot img { width: 100%; height: auto; border-radius: inherit; }
.kept-community {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  margin-block: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--kept-brass);
  background: #f0e9d8;
}

.kept-community h2 { font-size: clamp(2rem, 4vw, 3rem); }
.kept-community p { max-width: 52ch; }
.kept-community p + p { margin-top: .75rem; }

.screenshot-dialog { max-width: calc(100vw - 24px); max-height: calc(100svh - 24px); padding: 1rem; border: 1px solid var(--rule); background: var(--paper); }
.screenshot-dialog::backdrop { background: rgba(10, 23, 40, .8); }
.screenshot-dialog img { margin: .75rem auto 0; width: auto; height: auto; max-height: calc(100svh - 110px); object-fit: contain; }
.dialog-close { display: flex; margin-left: auto; cursor: pointer; }
body:has(.screenshot-dialog[open]) { overflow: hidden; }
.notebook-figure img { box-shadow: 0 22px 60px var(--shadow); }

.studio-page { padding: clamp(3rem, 7vw, 6rem) 0; }
.studio-intro { padding: 1.5rem 0 clamp(1.5rem, 4vw, 3rem); }
.studio-feature {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 6vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.studio-feature .eyebrow, .studio-feature h2 { margin-bottom: .7rem; }
.studio-feature p { color: var(--ink-soft); }
.studio-postcard-link { border-radius: 4px; }
.studio-postcard-link:hover { box-shadow: 0 4px 14px var(--shadow); }
.studio-postcard-link img { width: 100%; height: auto; border-radius: inherit; }
.studio-page .studio-copy h1 { max-width: 980px; font-size: clamp(3.5rem, 7.5vw, 7.5rem); }
.studio-page .studio-copy p { max-width: 620px; color: var(--ink-soft); font-size: 1.1rem; }

.support-page { padding-bottom: clamp(6rem, 12vw, 10rem); }
.kept-support { padding-block: clamp(2.5rem, 6vw, 5rem); }
.kept-support .back { margin-bottom: 1.75rem; }
.kept-support h1 { margin-bottom: 1rem; }
.kept-support h2[id] { scroll-margin-top: 1.5rem; }
.kept-support li + li { margin-top: .6rem; }
.support-setting { white-space: nowrap; }
.support-control-icon { display: inline-block; margin-right: .25em; vertical-align: -.23em; }
.kept-support-contact { margin-top: 3rem; padding: 1.25rem; border: 1px solid var(--rule); background: #edf1e7; }
.kept-support-contact h2 { margin: 0 0 .75rem; }
.kept-support-contact p { margin-bottom: 0; overflow-wrap: anywhere; }
.support-page .compact-intro { padding: clamp(2.5rem, 6vw, 5rem) 0 1.5rem; }
.compact-intro h1 { margin-bottom: .65rem; font-size: clamp(3.2rem, 6vw, 5.5rem); }
.compact-intro p { margin-bottom: 0; color: var(--ink-soft); }
.support-directory { border-top: 1px solid var(--rule); }
.support-directory a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(1.4rem, 3vw, 2.3rem) clamp(.75rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.support-directory .support-featured { background: #edf1e7; }
.support-directory a:hover, .support-directory a:focus-visible { background: var(--paper-bright); }
.support-directory strong { display: block; font-family: Iowan Old Style, Baskerville, "Times New Roman", serif; font-size: clamp(1.45rem, 3vw, 2.4rem); font-weight: 400; }
.support-directory small { display: block; color: var(--ink-soft); font-size: .9rem; }
.support-directory b { font-size: 1.3rem; font-weight: 400; transition: transform 160ms ease; }
.support-directory a:hover b, .support-directory a:focus-visible b { transform: translateX(.2rem); }
.support-dot { display: block; width: clamp(3rem, 6vw, 5.5rem); aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(21,45,79,.08); }
.support-dot.coral { background: var(--coral); }
.support-dot.mint { background: var(--mint); }
.support-dot.ochre { background: var(--ochre); }

:focus-visible { outline: 2px solid var(--ochre); outline-offset: 4px; }

@media (max-width: 760px) {
  :root { --page: min(100% - 32px, 1180px); }
  .site-header { min-height: 76px; gap: .75rem; }
  .brand { font-size: clamp(.95rem, 4.5vw, 1.25rem); }
  .nav { gap: clamp(.55rem, 3vw, 1rem); }
  .nav a { font-size: .8rem; }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 5rem; }
  .kept-object { min-height: 300px; }
  .box-image { width: min(88%, 350px); }
  .section-grid { grid-template-columns: 1fr; gap: 1rem; }
  .media-stage { margin-top: 2.5rem; }
  .image-pair { grid-template-columns: 1fr; }
  .image-pair figure:last-child { padding-top: 0; }
  .support-inner, .site-footer { align-items: flex-start; flex-direction: column; }
  .site-footer { gap: .75rem; }
  .footer-info { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .footer-brand { width: min(320px, 100%); }
  .page-shell { min-height: calc(100svh - 76px); }
  .page-intro { padding-top: 5rem; }
  .kept-hero, .kept-gameplay, .studio-feature { grid-template-columns: 1fr; }
  .kept-hero { padding: 1.15rem 1.1rem 1.5rem 1.4rem; gap: 1.25rem; }
  .kept-postcard { width: min(100%, 34rem); justify-self: center; }
  .kept-gameplay { gap: 1.4rem; }
  .kept-video { width: min(100%, 11rem); }
  .kept-gallery-controls:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 17rem);
    margin: 0 auto .75rem;
    color: var(--ink-soft);
    font-size: .85rem;
  }
  .kept-gallery-controls button { min-width: 44px; padding: 0; font-size: 1rem; cursor: pointer; }
  .kept-gallery-controls button[aria-disabled="true"] { opacity: .45; cursor: default; }
  .kept-feature-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 0;
    width: min(100%, 17rem);
    margin-inline: auto;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }
  .kept-screenshot { box-shadow: none; scroll-snap-align: start; scroll-snap-stop: always; }
  .kept-screenshot:focus-visible { outline-offset: -4px; }
  .studio-feature { max-width: 36rem; }
}

@media (max-width: 460px) {
  .kept-checklist { font-size: clamp(.9rem, 4.1vw, 1rem); }
}

@media (max-width: 360px) {
  .site-header { gap: .5rem; }
  .brand { font-size: .9rem; }
  .nav { gap: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html, .kept-feature-grid { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
