/* Code Corral website. Colors from the app's Soft Toy style; Moon Ranch-ish at night. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sky: #bfe3fc;
  --sky-deep: #8cc7f7;
  --cream: #fff7e6;
  --grass: #8fd47a;
  --grass-dark: #549e52;
  --sun: #ffd65c;
  --barn: #f2786b;
  --blush: #ffcccc;
  --lilac: #ccc2f7;
  --ink: #3d354d;
  --muted: #6f6a7a;
  --paper: #ffffff;
  --line: #ece4d3;
  --link: #2f74c0;
  --shadow: rgba(61, 53, 77, 0.14);
  --radius: 22px;
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", "Hiragino Maru Gothic ProN", "PingFang SC", "Noto Sans", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky: #2b3366;
    --sky-deep: #1d2140;
    --cream: #1d2140;
    --grass: #3f7a4a;
    --grass-dark: #2b5a36;
    --sun: #f4ecc4;
    --barn: #e46b62;
    --blush: #5a3a52;
    --lilac: #4a4380;
    --ink: #f3effa;
    --muted: #b8b2c8;
    --paper: #2a2f55;
    --line: #3a4070;
    --link: #9cc8ff;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 400;
}

img { max-width: 100%; }

a { color: var(--link); text-underline-offset: 3px; }

h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  background: var(--paper);
  padding: 8px 14px;
  border-radius: 12px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.home .top { position: absolute; inset-inline: 0; z-index: 3; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
}
.brand img { border-radius: 8px; }

.top-nav { display: flex; align-items: center; gap: 4px; }

.top-nav > a,
.languages summary {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 16px;
}
.top-nav > a:hover,
.languages summary:hover { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.top-nav > a[aria-current="page"] { background: var(--paper); }

.languages { position: relative; }
.languages summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.languages summary::-webkit-details-marker { display: none; }
.languages ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 10px 30px var(--shadow);
  min-width: 180px;
  max-height: 60vh;
  overflow: auto;
  z-index: 5;
}
.languages li a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.languages li a:hover { background: var(--cream); }
.languages li a[aria-current="true"] { font-weight: 600; }

@media (max-width: 520px) {
  .languages summary span { display: none; }
  .brand span { font-size: 18px; }
  .top-nav > a { padding: 6px 8px; }
}

/* ------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 70%);
  padding: 96px 16px 0;
  text-align: center;
}

.sky { position: absolute; inset: 0; pointer-events: none; }
.sun {
  position: absolute;
  top: 70px;
  inset-inline-end: 9%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--sun) 30%, transparent);
}
.cloud {
  position: absolute;
  width: 140px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}
.cloud::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: inherit;
  top: -30px;
  inset-inline-start: 28px;
}
.cloud.c1 { top: 150px; inset-inline-start: 6%; }
.cloud.c2 { top: 260px; inset-inline-end: 4%; transform: scale(0.7); }

@media (prefers-color-scheme: dark) {
  .cloud { background: rgba(255, 255, 255, 0.12); }
  .sun { box-shadow: 0 0 40px 10px color-mix(in srgb, var(--sun) 35%, transparent); }
}

.hero-text { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }

.app-icon {
  border-radius: 22.5%;
  box-shadow: 0 12px 30px var(--shadow);
}

.hero h1 { font-size: clamp(40px, 8vw, 68px); margin: 22px 0 10px; }

.lead { font-size: 20px; color: var(--ink); margin: 0 auto 22px; max-width: 34em; }

.small { font-size: 15px; color: var(--muted); }
.hero .small { color: color-mix(in srgb, var(--ink) 75%, transparent); }

.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--ink) 70%, black);
  margin: 4px 0 6px;
}
.store.soon {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--line);
}

.meadow {
  position: relative;
  height: 190px;
  margin: 26px -16px 0;
  background:
    radial-gradient(120% 90px at 25% 100%, var(--grass) 98%, transparent 100%) bottom / 100% 160px no-repeat,
    radial-gradient(90% 120px at 85% 100%, var(--grass-dark) 98%, transparent 100%) bottom / 100% 150px no-repeat;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 3vw, 28px);
  padding-bottom: 18px;
}
.meadow::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 60px;
  background: var(--grass);
}
.critter { position: relative; z-index: 1; width: clamp(56px, 13vw, 104px); height: auto; }
.critter-cow { transform: translateY(-14px); }
.critter-fox { transform: translateY(-6px) scaleX(-1); }
.critter-owl { transform: translateY(-20px); }

/* ------------------------------------------------------------ sections */

section { padding: 64px 16px; }
section > h2 { font-size: clamp(30px, 5vw, 42px); text-align: center; margin: 0 0 10px; }
section > .lead { text-align: center; }

.how { background: var(--grass); background: linear-gradient(180deg, var(--grass) 0, var(--cream) 140px); }
@media (prefers-color-scheme: dark) { .how { background: linear-gradient(180deg, var(--grass) 0, var(--cream) 140px); } }

.board {
  max-width: 520px;
  margin: 10px auto 26px;
  background: var(--paper);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 6px 0 var(--line), 0 16px 40px var(--shadow);
}
.secret, .guess {
  display: grid;
  grid-template-columns: 78px auto 1fr;
  align-items: center;
  gap: 12px;
}
.secret { padding-bottom: 14px; border-bottom: 2px dashed var(--line); margin-bottom: 8px; }
.guesses { list-style: none; margin: 0; padding: 0; }
.guess { padding: 8px 0; }
.guess-label { font-size: 14px; color: var(--muted); }
.tiles { display: inline-flex; gap: 6px; }
.tile {
  width: 44px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  font-size: 26px;
  font-weight: 600;
  border-radius: 14px;
  background: var(--cream);
  box-shadow: inset 0 -4px 0 var(--line);
  font-variant-numeric: tabular-nums;
}
.tile.hidden { background: var(--lilac); color: var(--paper); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--lilac) 70%, black); }
.tile.bull { background: var(--grass); color: #1f3d1f; box-shadow: inset 0 -4px 0 var(--grass-dark); }
.score { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.marks { display: inline-flex; gap: 2px; min-height: 22px; }
.score-text { font-size: 14px; color: var(--muted); }
.cracked { text-align: center; font-weight: 600; margin: 14px 0 0; color: var(--grass-dark); font-size: 20px; }
@media (prefers-color-scheme: dark) { .cracked { color: var(--grass); filter: brightness(1.5); } }

@media (max-width: 460px) {
  .secret, .guess { grid-template-columns: auto 1fr; }
  .guess-label { grid-column: 1 / -1; }
  .tile { width: 38px; height: 44px; font-size: 22px; }
  .board { padding: 16px; }
}

.legend {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 620px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 26px auto 0;
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.feature {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 5px 0 var(--line);
}
.feature h3 { margin: 10px 0 6px; font-size: 21px; }
.feature p { margin: 0; color: var(--muted); font-size: 17px; }

.no-ads {
  background: var(--barn);
  color: #fff;
  text-align: center;
  border-radius: 36px;
  max-width: 1080px;
  margin: 0 16px;
}
@media (min-width: 1112px) { .no-ads { margin: 0 auto; } }
.no-ads p { max-width: 34em; margin: 0 auto; font-size: 20px; }

.closing { text-align: center; }
.closing h2 { margin: 18px 0 18px; }

/* ------------------------------------------------------------ documents */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}
.doc h1 { font-size: clamp(34px, 6vw, 48px); margin: 16px 0 4px; }
.doc .updated { color: var(--muted); margin: 0 0 22px; font-size: 16px; }
.doc .lead { margin: 0 0 8px; }
.doc section {
  padding: 22px 24px;
  margin: 16px 0;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line);
}
.doc section h2 { font-size: 24px; margin: 0 0 10px; text-align: start; }
.doc section p:last-child, .doc section ul:last-child { margin-bottom: 0; }
.doc ul { padding-inline-start: 22px; }
.doc li { margin: 6px 0; }

.faq { border-top: 2px solid var(--line); padding: 4px 0; }
.faq:first-of-type { border-top: 0; }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  padding: 10px 0;
  list-style-position: inside;
}
.faq p { margin: 0 0 12px; color: var(--ink); }

/* ------------------------------------------------------------ 404 */

.not-found { text-align: center; padding: 80px 16px; }
.button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 5px 0 var(--line);
}

/* ------------------------------------------------------------ footer */

.bottom {
  text-align: center;
  padding: 36px 16px 48px;
  color: var(--muted);
  font-size: 16px;
}
.bottom p { margin: 6px 0; }
.bottom-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 14px; }
.bottom-nav a { color: var(--ink); font-weight: 500; }
.bottom-languages ul {
  list-style: none;
  padding: 0;
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  max-width: 720px;
}
.bottom-languages a { color: var(--muted); text-decoration: none; }
.bottom-languages a[aria-current="true"] { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .critter { animation: bob 3.2s ease-in-out infinite; }
  .critter:nth-child(2) { animation-delay: -0.8s; }
  .critter:nth-child(3) { animation-delay: -1.6s; }
  .critter:nth-child(4) { animation-delay: -2.4s; }
  @keyframes bob { 50% { translate: 0 -6px; } }
}

@media (prefers-color-scheme: dark) {
  .tile.hidden { color: var(--ink); box-shadow: inset 0 -4px 0 #332d63; }
}

.brand span { white-space: nowrap; }

@media (max-width: 600px) {
  .hero { padding-top: 80px; }
  .cloud.c2 { display: none; }
  .cloud.c1 { top: 110px; inset-inline-start: -30px; transform: scale(0.8); }
  .sun { width: 60px; height: 60px; top: 64px; inset-inline-end: 6%; box-shadow: 0 0 0 10px color-mix(in srgb, var(--sun) 30%, transparent); }
  .meadow { height: 130px; margin-top: 10px; }
  .hero h1 { margin-top: 16px; }
}
