/* Hidden Ducks: open, lightly structured layout, designed phone-first. */

:root {
  --yellow: #ffd23f;
  --yellow-deep: #e59f00;
  --ink: #1f2a37;
  --muted: #5b6776;
  --bg: #fff8e6;
  --line: #eadcae;
  --pond: #137a70;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

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

/* ---------- header / footer ---------- */
.site-header { background: var(--yellow); }
.site-header .inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.4rem 1.25rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav { display: flex; gap: 1.1rem; white-space: nowrap; }
.nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 0.55rem 0;
  border-bottom: 3px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.site-footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- home ---------- */
.hero { padding: 2rem 0 0.5rem; }
.hero h1 {
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 900;
  margin: 0 0 1rem;
}
.lead {
  max-width: 34rem;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.12rem;
}
.progress { max-width: 26rem; margin: 0 0 1.6rem; }
.bar {
  height: 12px;
  background: #f1e6bd;
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow-deep);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.progress p { margin: 0.5rem 0 0; font-weight: 800; }

.button {
  display: inline-block;
  min-height: 3rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-align: center;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.button:hover { background: #000; }
.button:disabled { opacity: 0.6; cursor: wait; }

.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.steps li {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.step-num {
  flex: none;
  min-width: 1.6rem;
  color: var(--yellow-deep);
  font-size: 1.25em;
  font-weight: 900;
}

/* ---------- all ducks ---------- */
.page-title {
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
  margin: 1rem 0 0.6rem;
}
.toolbar { margin: 1.2rem 0 0.4rem; }
.chips { display: flex; gap: 1.4rem; }
.chip {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  padding: 0.6rem 0;
  cursor: pointer;
}
.chip[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  column-gap: 2rem;
  align-items: start;
}
.duck {
  min-height: 3.6rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.duck--hidden {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  color: var(--muted);
}
.duck--hidden .duck-num { color: var(--muted); }
.duck summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.1rem 0.9rem;
  align-items: baseline;
}
.duck summary::-webkit-details-marker { display: none; }
.duck summary::after {
  content: "\25BE";
  grid-column: 3;
  grid-row: 1;
  color: var(--muted);
  transition: transform 0.2s;
}
.duck[open] summary::after { transform: rotate(180deg); }
.duck-num { font-weight: 900; font-size: 1.2rem; min-width: 3.4rem; }
.duck--found .duck-num { background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.duck-status { font-weight: 700; overflow-wrap: anywhere; }
.duck--hidden .duck-status { font-weight: 600; }
.duck-date { grid-column: 2; color: var(--muted); font-size: 0.9rem; }
.duck-body { margin: 0.7rem 0 0.2rem 4.3rem; }
.duck-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.duck-body .muted { color: var(--muted); font-style: italic; }

/* ---------- finder page / form ---------- */
.form-card { max-width: 34rem; margin: 0 auto; padding-top: 0.5rem; }
.form-card h1 {
  margin: 0.4rem 0 0.6rem;
  font-size: clamp(2rem, 9vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 900;
}
.form-card .lead { font-size: 1.05rem; }
label { display: block; font-weight: 800; margin: 1.3rem 0 0.4rem; }
input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.06rem; /* 16px or more stops iPhones zooming in on focus */
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 8rem; resize: vertical; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0 0; }
.hint + .hint,
.hp + .hint { margin-top: 0.8rem; }
.error { color: #b42318; font-weight: 700; margin: 0.8rem 0 0; }
.actions { margin-top: 1.6rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- focus + motion ---------- */
.button:focus-visible,
.chip:focus-visible,
.duck summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible { outline: 3px solid var(--pond); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bar > span, .duck summary::after { transition: none; }
}

/* ---------- phones ---------- */
@media (max-width: 540px) {
  .hero .button,
  .actions .button { display: block; width: 100%; }
}
@media (max-width: 380px) {
  .site-header .inner { padding: 0.4rem 1rem; }
  .brand { font-size: 1.05rem; }
  .nav { gap: 0.9rem; }
  main { padding-left: 1rem; padding-right: 1rem; }
}
