/* ------------------------------------------------------------------
   www.household.co.nz - the public site.

   The app's noticeboard, brought out onto the fridge door: paper, ink,
   pencil, a hairline rule, one highlighter stroke that marks exactly one
   thing, and red pen for the clash. The nine colours are the app's own
   (src/index.css, mobile/src/design/tokens.ts) - keep them in step.

   Static on purpose: no build, no script, nothing third-party.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/BricolageGrotesque_800ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #fbfaf7;
  --raised: #ffffff;
  --ink: #1a1a17;
  --pencil: #6b6a62;
  --rule: #e4e2da;
  --highlighter: #d8ff3e;
  --on-highlighter: #1a1a17;
  --red-pen: #c1272d;
  --red-pen-soft: #f7e4e3;
  --tint: #f2f0ea;
  /* Masking tape: a translucent strip of the rule colour. */
  --tape: rgb(214 208 190 / 0.72);

  --cat-sport: #2e7d74;
  --cat-school: #3f5f91;
  --cat-health: #7a4e9c;
  --cat-family: #7a5b33;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131410;
    --raised: #1c1e17;
    --ink: #f2f1e9;
    --pencil: #9a9a8e;
    --rule: #2c2e25;
    --highlighter: #a8c62a;
    --on-highlighter: #131410;
    --red-pen: #ff6b5e;
    --red-pen-soft: #33201e;
    --tint: #21231c;
    --tape: rgb(120 118 100 / 0.5);

    --cat-sport: #5fbfb2;
    --cat-school: #7fa3d9;
    --cat-health: #b08fd0;
    --cat-family: #b8946a;
  }
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--highlighter);
  color: var(--on-highlighter);
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--pencil);
}
a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 3px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  z-index: 10;
}
.skip:focus {
  left: 0.5rem;
}

/* ---------- the top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  border-bottom: 1px solid var(--rule);
}
.bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 800 1.3rem/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img {
  width: 2rem;
  height: 2rem;
  flex: none;
  /* The launcher's own rounding, so it reads as the icon on a phone. */
  border-radius: 22%;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 3vw, 1.75rem);
  font-size: 0.95rem;
}
.nav a {
  text-decoration: none;
  color: var(--pencil);
  padding-block: 0.4rem;
  position: relative;
}
.nav a:hover {
  color: var(--ink);
}
/* Where you are: the highlighter under the word, as in the app's nav. */
.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto -0.15em 0;
  height: 4px;
  background: var(--highlighter);
  border-radius: 3px;
  z-index: -1;
}
.nav .signin {
  white-space: nowrap;
  color: var(--ink);
  font-weight: 600;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
}
.nav .signin:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  /* The app's own primary action (Continue with Google) is citron. */
  background: var(--highlighter);
  color: var(--on-highlighter);
  border: 1px solid color-mix(in srgb, var(--on-highlighter) 18%, var(--highlighter));
  font: 600 1rem/1 var(--ui);
  text-decoration: none;
  transition: transform 180ms var(--ease-out);
}
.button:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--on-highlighter) 7%, var(--highlighter));
}
.button:active {
  transform: translateY(0);
}
.button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.quiet-link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 2px;
}
.quiet-link:hover {
  text-decoration-color: var(--ink);
}

/* ---------- the highlighter ---------- */

/* The app's Stroke (src/design/surfaces.tsx): a bar of citron under the one
   word in a heading that carries it. It marks; the text stays ink. */
.mark {
  position: relative;
  z-index: 0;
  white-space: nowrap;
}
.mark::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.04em;
  right: -0.04em;
  bottom: 0.02em;
  height: 0.2em;
  border-radius: 3px;
  background: var(--highlighter);
}

/* ---------- the door (the first screen) ---------- */

.hero {
  padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}
.hero h1 {
  font-size: clamp(2.6rem, 5.6vw, 4.75rem);
}
@media (max-width: 900px) {
  .hero-top {
    grid-template-columns: 1fr;
  }
}

.hero .lede {
  max-width: 36rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--pencil);
}
.hero .lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero .actions {
  margin-top: 1.6rem;
}

.door {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 17.5rem));
  justify-content: center;
  align-items: start;
  column-gap: clamp(0.75rem, 3vw, 2.75rem);
}

.door-caption {
  grid-column: 1 / -1;
  margin-top: 1.75rem;
  font-size: 0.85rem;
  color: var(--pencil);
}

/* A real screen from the app, printed and taped up: flat, hairline edge,
   no shadow. The tilt is the only thing that says it is on a door. */
.screen {
  margin: 0;
  position: relative;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
}
.screen::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1rem;
  left: 50%;
  width: 5.5rem;
  height: 1.4rem;
  translate: -50% 0;
  rotate: -3deg;
  background: var(--tape);
}
.screen img {
  width: 100%;
  height: auto;
  border-radius: 11px;
}
.screen figcaption {
  padding: 0.7rem 0.9rem 0.8rem;
  border-top: 1px solid var(--rule);
  font: 700 1.05rem/1.2 var(--display);
}

.door .week { rotate: -1.6deg; }
.door .shop { rotate: 1.8deg; margin-top: 2.25rem; }
.door .todo { rotate: -0.8deg; margin-top: 0.75rem; }

/* ---------- sections below the door ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 7.5rem);
  border-top: 1px solid var(--rule);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.split.flip > :first-child {
  order: 2;
}

.copy h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  max-width: 14ch;
}
.copy > p {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--pencil);
}
.copy > p strong {
  color: var(--ink);
  font-weight: 600;
}

.points {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  max-width: 34rem;
}
.points li {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.points li:last-child {
  border-bottom: 1px solid var(--rule);
}
.points b {
  display: block;
  font: 700 1.15rem/1.25 var(--display);
  letter-spacing: -0.01em;
}
.points span {
  display: block;
  margin-top: 0.25rem;
  color: var(--pencil);
}

/* The sheet straightens as it comes to you: the door's tilt at the edge
   of the screen, square by the time it's read. Straight by default, so a
   browser without scroll timelines - or a reader who asked for less
   motion - simply sees it square. */
.feature-sheet {
  position: relative;
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .feature-sheet {
      animation: straighten linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 42%;
    }
  }
}
@keyframes straighten {
  from {
    rotate: var(--from-tilt, -2deg);
    translate: 0 1.5rem;
  }
  to {
    rotate: 0deg;
    translate: 0 0;
  }
}

.tilt-a { --from-tilt: -2.4deg; }
.tilt-b { --from-tilt: 2.2deg; }
.tilt-c { --from-tilt: -1.8deg; }

/* The screens in the sections: phone-sized, never stretched to the column. */
.split > .screen {
  width: min(100%, 22rem);
  justify-self: center;
}

/* ---------- two phones, one day (children) ---------- */

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1.25rem;
  align-items: start;
  padding-top: 0.75rem;
}
.pair .screen:nth-child(1) {
  --from-tilt: -2.2deg;
}
.pair .screen:nth-child(2) {
  --from-tilt: 2deg;
  margin-top: 1.75rem;
}
.pair-note {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  font: 700 1.1rem/1.3 var(--display);
}

/* ---------- privacy, as a ruled list ---------- */

.promises {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4.5rem);
}
.promises li {
  padding: 1.35rem 0 1.5rem;
  border-top: 1px solid var(--rule);
}
.promises b {
  display: block;
  font: 800 1.45rem/1.15 var(--display);
  letter-spacing: -0.015em;
}
.promises span {
  display: block;
  margin-top: 0.4rem;
  color: var(--pencil);
  max-width: 30rem;
}
.privacy-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.privacy-head h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  max-width: 15ch;
}

/* ---------- the close ---------- */

.close {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  border-top: 1px solid var(--rule);
}
.close h2 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  max-width: 14ch;
}
.close p {
  margin-top: 1.25rem;
  max-width: 34rem;
  color: var(--pencil);
  font-size: 1.15rem;
}
.close .actions {
  margin-top: 2rem;
}

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

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.25rem 3rem;
  font-size: 0.92rem;
  color: var(--pencil);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.foot a {
  color: var(--ink);
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
}

/* ---------- reading pages: privacy, help ---------- */

.doc {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 8vw, 6rem);
}
.doc-head {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.doc-head h1 {
  font-size: clamp(2.5rem, 6.5vw, 4.6rem);
}
.doc-head p {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--pencil);
}
.doc-head .updated {
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.doc-body {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: 2.5rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 5.5rem;
  font-size: 0.92rem;
}
.toc p {
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.toc a {
  display: block;
  padding: 0.3rem 0;
  color: var(--pencil);
  text-decoration: none;
  line-height: 1.3;
}
.toc a:hover {
  color: var(--ink);
}

.prose {
  max-width: 42rem;
}
.prose section {
  padding-top: 0.25rem;
}
.prose section + section {
  margin-top: 3rem;
}
.prose h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.prose h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.5rem;
}
.prose p + p,
.prose p + ul,
.prose ul + p,
.prose p + ol,
.prose ol + p,
.prose dl + p,
.prose p + dl {
  margin-top: 0.9rem;
}
.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.2rem;
}
.prose li + li {
  margin-top: 0.45rem;
}
.prose li::marker {
  color: var(--pencil);
}
.prose dl {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.prose dt {
  font-weight: 600;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}
.prose dd {
  margin: 0.2rem 0 0;
  padding-bottom: 0.9rem;
  color: var(--pencil);
}
.prose .callout {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--ink);
}
.prose .callout h3 {
  margin-top: 0.9rem;
}
.prose code {
  font-size: 0.92em;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0 !important;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  margin: 0 !important;
}
.steps li:last-child {
  border-bottom: 1px solid var(--rule);
}
.steps li::before {
  content: counter(step);
  font: 800 1.3rem/1.2 var(--display);
}

.mailto {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  font: 700 1.25rem/1.2 var(--display);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.1rem;
}

/* The note from the person who makes it: the one place on the site that
   speaks as "I", so it is set apart by a rule and a signature, not a box. */
.prose .mine {
  border-top: 2px solid var(--ink);
  padding-top: 1.25rem;
}
.prose .mine p {
  font-size: 1.1rem;
}
.prose .sig {
  margin-top: 1.1rem;
  font: 700 1.05rem/1.2 var(--display);
}

/* The Why page's sources: there to be checked, not read first. */
.prose .sources {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--pencil);
}
.prose .sources h2 {
  font-size: 1.15rem;
  color: var(--ink);
}

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .split,
  .split.flip {
    grid-template-columns: 1fr;
  }
  .split.flip > :first-child {
    order: 0;
  }
  .promises {
    grid-template-columns: 1fr;
  }
  .doc-body {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    border-bottom: 1px solid var(--rule);
    padding-block: 0 1rem;
  }
}

@media (max-width: 760px) {
  /* Three screens side by side still, overlapping, so the door reads as a
     door at phone width instead of a column three screens long. */
  .door {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 0;
    padding-inline: 0.75rem;
  }
  .door .shop {
    z-index: 1;
    margin-inline: -1.25rem;
    margin-top: 1.5rem;
  }
  .door .todo {
    margin-top: 0.5rem;
  }
  .screen::before {
    width: 3.5rem;
    height: 1rem;
  }
}

@media (max-width: 520px) {
  .bar .wrap {
    min-height: 3.4rem;
  }
  .brand {
    font-size: 1.15rem;
  }
  .brand img {
    width: 1.75rem;
    height: 1.75rem;
  }
  .nav {
    gap: 0.9rem;
  }
  .nav .signin {
    padding: 0.35rem 0.8rem;
  }
}

/* Four links and a button do not fit beside the name on a small phone.
   Privacy and Help step back to the footer unless they are where you are. */
@media (max-width: 440px) {
  .nav a[href="/privacy"]:not([aria-current]),
  .nav a[href="/help"]:not([aria-current]) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}
