:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17201f;
  background: #eef4f2;
  --ink: #17201f;
  --muted: #5d6762;
  --page-bg: #f7f2e8;
  --panel: #fffaf0;
  --primary: #176b6b;
  --primary-strong: #0e4d4c;
  --label: #8a3f32;
  --accent: #ffbd59;
  --tile-a: #1f8f87;
  --tile-b: #e86f51;
  --line: rgba(23, 32, 31, 0.12);
  --shadow: rgba(23, 32, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
  background: linear-gradient(150deg, #f0b7aa 0%, var(--page-bg) 42%, #cceee5 100%);
}

.page-header,
.story {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.page-header {
  min-height: 32vh;
  display: grid;
  align-content: center;
}

.page-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 5.2rem;
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.page-header p,
.story-copy p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.55;
}

.back-link {
  display: inline-grid;
  place-items: center;
  width: fit-content;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border: 1px solid rgba(23, 107, 107, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.story {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 28px 0 44px;
}

.story h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

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

.phone,
.desktop {
  color: var(--ink);
  min-height: 360px;
  border-radius: 20px;
  background: var(--panel);
  border: 10px solid var(--ink);
  padding: 18px;
  box-shadow: 0 18px 34px var(--shadow);
  overflow: hidden;
}

.desktop {
  min-height: 280px;
  border-radius: 12px;
  border-width: 8px;
  background: #ffffff;
}

.phone-top {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: rgba(23, 32, 31, 0.22);
  margin: 0 auto 18px;
}

h3 {
  margin: 0 0 16px;
  font-size: 0.78rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  overflow-wrap: break-word;
}

.large-title {
  color: var(--ink);
  font-size: 1.72rem;
  line-height: 1.05;
  font-weight: 900;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}

.pill-row,
.score-row,
.split {
  display: grid;
  gap: 10px;
}

.pill-row span,
.score-row span,
.split div {
  min-height: 42px;
  border-radius: 8px;
  background: rgba(23, 107, 107, 0.1);
  color: var(--ink);
  display: grid;
  align-content: center;
  padding: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.split strong,
.split span {
  display: block;
  min-width: 0;
}

.split span {
  margin-top: 4px;
  color: var(--muted);
}

button {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  padding: 0 12px;
  overflow-wrap: break-word;
}

.feedback {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 189, 89, 0.28);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.tile-board,
.tile-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tile-board span,
.tile-strip span {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--tile-a);
}

.tile-board span:nth-child(even),
.tile-strip span:nth-child(even) {
  background: var(--tile-b);
}

.story-marc {
  background: rgba(238, 243, 238, 0.78);
  width: 100%;
  max-width: none;
  padding-inline: max(32px, calc((100vw - 1120px) / 2));
}

.story-marc .split div {
  background: rgba(23, 107, 107, 0.1);
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  margin-bottom: 18px;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 62%;
  height: 100%;
  background: var(--accent);
}

.tile-strip {
  grid-template-columns: repeat(4, 1fr);
}

.tile-strip span {
  background: var(--tile-a);
}

.tile-strip span:nth-child(even) {
  background: var(--tile-b);
}

.result {
  color: var(--ink);
  font-size: 1.95rem;
  line-height: 1.05;
  font-weight: 900;
  margin: 28px 0;
  overflow-wrap: anywhere;
}

.compact {
  grid-template-columns: repeat(2, 1fr);
}

.site-footer {
  width: min(1120px, 100%);
  margin: 4px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  background: var(--primary-strong);
}

@media (max-width: 860px) {
  main {
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .page-header {
    min-height: auto;
    padding: 8px 0 22px;
  }

  .page-header h1 {
    font-size: 3.25rem;
  }

  .back-link {
    width: 100%;
  }

  .story,
  .mockup-grid {
    grid-template-columns: 1fr;
  }

  .story {
    gap: 16px;
    padding: 24px 0 34px;
  }

  .story-marc {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .phone,
  .desktop {
    min-height: 0;
    border-width: 7px;
    padding: 14px;
  }

  .large-title {
    font-size: 1.9rem;
  }

  .tile-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .result {
    font-size: 1.8rem;
  }

  .site-footer {
    display: grid;
    justify-items: center;
  }
}
