/* Nestoku & RetroVault developer site.
   Layout direction: content max 1200px; gutters 16px below 768px
   and 24px from 768px; app cards stack below 768px.
   Type: shared headings 25px / 30px (inside 23–26 and 26–30);
   body 16px / line-height 1.5. Local fonts and assets only. */

:root {
  color-scheme: light;
  --ink: #1c2618;
  --muted: #3d4a36;
  --paper: #f6f1e7;
  --card: #fffdf8;
  --nest-bg: #f3f8ef;
  --retro-bg: #fff6f2;
  --line: #e4d8c4;
  --nest: #14532d;
  --nest-hover: #0f3d22;
  --retro: #9a3412;
  --retro-hover: #7c2a0e;
  --on-accent: #ffffff;
  --contact: #1c2618;
  --contact-hover: #0e140c;
  --contact-text: #fffdf8;
  --focus: #084e9b;
  --banner: #fff4d8;
  --banner-line: #8a5a10;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #e7f3d8 0%, transparent 60%),
    radial-gradient(700px 380px at 100% 0%, #fde7d6 0%, transparent 55%),
    var(--paper);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
.site-name {
  font-family: Palatino, "Palatino Linotype", Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

h1,
h2 {
  font-size: 25px;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--nest);
}

a:hover {
  color: var(--nest-hover);
}

:focus {
  outline: none;
}

:focus-visible,
h2[id]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  transform: translateY(-150%);
  background: var(--contact);
  color: var(--contact-text);
  padding: 12px 16px;
  z-index: 40;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  transform: none;
}

.shell {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-inline: 16px;
}

.accent {
  height: 6px;
  background: linear-gradient(90deg, #f0b48a 0 25%, #8fbf78 0 50%, #f0b7c8 0 75%, #c5b3e6 0 100%);
}

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
}

.bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  padding-block: 8px;
}

.site-name {
  order: 1;
  flex: 1 1 0;
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  text-decoration: none;
}

.site-name:hover {
  color: var(--ink);
}

.contact-button {
  order: 2;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--contact);
  color: var(--contact-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.contact-button:hover {
  background: var(--contact-hover);
  color: var(--contact-text);
}

.site-nav {
  display: flex;
  order: 3;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 16px;
  max-width: 100%;
}

.site-nav a,
.card-links a,
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-underline-offset: 3px;
}

.site-nav a {
  font-weight: 700;
}

main {
  padding-bottom: 32px;
}

.intro {
  padding-block: 20px 4px;
}

.intro p,
.app-copy,
.prose p,
.prose li {
  max-width: 65ch;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--nest);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.lede {
  margin-top: 8px;
  font-size: 16px;
}

.intro p + p,
.prose p + p,
.prose h2,
.prose ul {
  margin-top: 12px;
}

.prose .contact-button {
  width: 100%;
  margin-top: 16px;
}

.apps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding-block: 12px 8px;
  scroll-margin-top: 132px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.app-card.nestoku {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--nest-bg);
}

.app-card.retrovault {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  background: var(--retro-bg);
}

.app-body {
  display: contents;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.app-card.retrovault .retro-mark {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.app-card.retrovault h2 {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.app-card.retrovault .app-copy,
.app-card.retrovault .card-actions {
  grid-column: 1 / -1;
}

.app-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-heading > div {
  min-width: 0;
}

.nest-mark {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: contain;
}

.retro-mark {
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  border-radius: 22px;
  object-fit: contain;
}

.package {
  margin-top: 2px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.hero {
  margin: 0;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 729;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
  background: #e5f2d4;
}

.hero figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.play-button.nestoku {
  background: var(--nest);
}

.play-button.nestoku:hover {
  background: var(--nest-hover);
  color: var(--on-accent);
}

.play-button.retrovault {
  background: var(--retro);
}

.play-button.retrovault:hover {
  background: var(--retro-hover);
  color: var(--on-accent);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.banner {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--banner-line);
  border-radius: 12px;
  background: var(--banner);
  font-weight: 650;
}

.prose h2 {
  scroll-margin-top: 88px;
}

.prose ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fffdf8;
  padding-block: 20px 32px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-note {
  margin-top: 8px;
  max-width: 65ch;
  color: var(--muted);
  font-size: 15px;
}

@media (min-width: 768px) {
  .shell {
    padding-inline: 24px;
  }

  h1,
  h2 {
    font-size: 30px;
  }

  .bar-row {
    flex-wrap: nowrap;
    gap: 8px 24px;
  }

  .site-name {
    flex: 0 1 auto;
    margin-right: auto;
  }

  .site-nav {
    order: 2;
    flex: 0 1 auto;
  }

  .contact-button {
    order: 3;
  }

  .intro {
    padding-block: 28px 8px;
  }

  .prose .contact-button {
    width: auto;
  }

  .apps {
    gap: 24px;
  }

  .app-card {
    padding: 24px;
  }

  .app-heading {
    gap: 16px;
  }

  .nest-mark {
    width: 72px;
    height: 72px;
  }

  .retro-mark {
    width: 144px;
    height: 144px;
  }

  .app-card.nestoku,
  .app-card.retrovault {
    column-gap: 28px;
  }

  .app-card.nestoku {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-areas:
      "head hero"
      "stack hero";
    align-items: stretch;
  }

  .app-card.nestoku .app-heading {
    grid-area: head;
    align-self: end;
  }

  .app-card.nestoku .stack {
    grid-area: stack;
    align-self: start;
  }

  .app-card.nestoku .hero {
    grid-area: hero;
    align-self: center;
  }

  .app-card.retrovault {
    grid-template-columns: 144px minmax(0, 1fr);
    align-items: center;
  }

  .app-card.retrovault .app-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-column: 2;
    grid-row: 1;
  }

  .app-card.retrovault .retro-mark {
    grid-column: 1;
    grid-row: 1;
  }

  .app-card.retrovault .app-body h2 {
    align-self: stretch;
    text-align: start;
  }

  .play-button {
    width: fit-content;
    min-width: 16rem;
    max-width: 100%;
  }
}

@media (forced-colors: active) {
  .contact-button,
  .play-button {
    border: 1px solid ButtonText;
  }
}
