/* SpilledBeans site. Tokens from the guide PDF (guide-source/guide.html). */

@font-face {
  font-family: "Red Hat Display";
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/red-hat-display.woff2") format("woff2");
}
@font-face {
  font-family: "Red Hat Mono";
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/red-hat-mono.woff2") format("woff2");
}

:root {
  --page: #F0EEFF;
  --ink: #1E1B3A;
  --accent: #5B4FCF;
  --violet: #7C6AF2;
  --lilac: #E9E6FB;
  --edge: #DAD7F3;
  --key-edge: #C3BFE8;
  --term-edge: #B8B2E7;
  --teal: #19B8A6;
  --teal-dark: #0F8F81;
  --prompt: #8CEBDD;
  --coral: #FF6B5E;
  --sun: #FFC53D;
  --muted: #6E6896;
  --white: #fff;

  --gutter: 20px;
  --max: 1040px;
}

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

html {
  background: var(--page);
  color: var(--ink);
  font-family: "Red Hat Display", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--page);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
b, strong { font-weight: 700; }
code, .mono { font-family: "Red Hat Mono", ui-monospace, monospace; font-weight: 500; }

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
h1 {
  font-weight: 800;
  font-size: clamp(38px, 10.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
h2 {
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.022em;
}
h3 {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.sub {
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  color: var(--accent);
  letter-spacing: -0.008em;
  margin-top: 12px;
}
.lead { font-size: 19px; line-height: 1.5; margin-top: 16px; }
.small { font-size: 15px; line-height: 1.5; color: var(--muted); }

/* Placeholder text in mock-ups: replaced with Tom's own words */
.ph { background: rgba(255, 197, 61, .35); border-radius: 6px; padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Header and footer */
.top { padding: 18px 0 8px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 18px; }
.nav a { font-weight: 700; font-size: 16px; color: var(--accent); text-decoration: none; padding: 10px 0; }
.nav a:hover { text-decoration: underline; }

.foot { margin-top: 64px; padding: 28px 0 36px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; justify-content: space-between; }
.foot .brand { font-size: 18px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 600; font-size: 15px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Panels: white, rounded, standing on a solid lilac edge */
.panel {
  background: var(--white);
  color: var(--ink);
  border-radius: 24px;
  box-shadow: 0 8px 0 var(--edge);
  padding: 22px 20px 24px;
}
.panel.big { border-radius: 28px; box-shadow: 0 12px 0 var(--edge); }

.violet {
  background: var(--violet);
  color: var(--white);
  border-radius: 24px;
  box-shadow: 0 8px 0 var(--term-edge);
  padding: 24px 20px 22px;
}
.violet h2 { color: var(--white); }
.violet .big-line { font-weight: 700; font-size: 19px; line-height: 1.4; margin-top: 8px; }
.violet .panel { margin-top: 20px; box-shadow: 0 6px 0 var(--accent); }

/* Numbered squares */
.num {
  width: 48px; height: 48px; flex: none;
  border-radius: 12px;
  background: var(--violet);
  color: var(--white);
  font-weight: 800; font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.g-inside .lead { margin-top: 22px; }
.steps { list-style: none; display: grid; gap: 14px; margin-top: 18px; }
.steps li {
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--edge);
  padding: 12px 16px 12px 12px;
}
.steps .name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; line-height: 1.1; }
.steps .what { font-weight: 600; font-size: 15.5px; color: var(--accent); margin-top: 2px; line-height: 1.3; }

/* Ink terminal with a teal prompt */
.term {
  background: var(--ink);
  color: var(--white);
  border-radius: 20px;
  box-shadow: 0 8px 0 var(--term-edge);
  font-family: "Red Hat Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 20px;
  padding: 18px 20px;
  white-space: pre;
  overflow: hidden;
}
.term .pr { color: var(--prompt); }
.cursor {
  display: inline-block; width: .6em; height: 1.1em; vertical-align: -0.18em;
  background: var(--prompt); margin-left: 2px;
  animation: blink 1.06s steps(1) infinite;
}
@keyframes blink { 0%, 58% { opacity: 1; } 59%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* Code window with a lilac title bar */
.win { background: var(--white); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 0 var(--edge); }
.win .bar { background: var(--lilac); font-family: "Red Hat Mono", monospace; font-weight: 500; font-size: 15px; padding: 9px 16px; }
.win .code { font-family: "Red Hat Mono", monospace; font-weight: 500; font-size: 16px; line-height: 1.55; padding: 14px 16px 16px; white-space: pre; overflow-x: auto; }

/* Chips and key-cap links */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px; line-height: 1;
  padding: 8px 14px;
  white-space: nowrap;
}
.chip.sun { background: var(--sun); color: var(--ink); }
.chip.teal { background: var(--teal); color: var(--ink); }
.chip.ink { background: var(--ink); color: var(--white); }

.keys { display: flex; flex-wrap: wrap; gap: 12px; }
.key {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--key-edge);
  font-weight: 700; font-size: 16px;
  color: var(--ink);
  padding: 0 16px;
  text-decoration: none;
  transition: transform .06s ease-out, box-shadow .06s ease-out;
}
.key .mono { font-size: 15px; color: var(--accent); }
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--key-edge); }

/* Forms */
.field { display: grid; gap: 8px; margin-top: 16px; }
.field label { font-weight: 700; font-size: 16px; }
.input {
  width: 100%;
  height: 56px;
  font: inherit; font-size: 18px; font-weight: 600; color: var(--ink);
  background: var(--page);
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 -3px 0 var(--edge);
  padding: 0 16px;
}
.input::placeholder { color: var(--muted); font-weight: 500; }
.input:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; cursor: pointer; }
.check input {
  appearance: none; -webkit-appearance: none;
  flex: none;
  width: 28px; height: 28px; margin-top: 1px;
  border-radius: 8px;
  background: var(--page);
  box-shadow: inset 0 -3px 0 var(--edge), inset 0 0 0 2px var(--key-edge);
  cursor: pointer;
  display: grid; place-content: center;
}
.check input::after {
  content: ""; width: 16px; height: 16px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7' fill='none' stroke='%23fff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  opacity: 0;
}
.check input:checked { background: var(--violet); box-shadow: none; }
.check input:checked::after { opacity: 1; }
.check span { font-size: 16px; line-height: 1.45; font-weight: 500; }
.check b { font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 20px;
  font: inherit; font-weight: 800; font-size: 19px; letter-spacing: -0.01em;
  color: var(--white);
  background: var(--violet);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: transform .06s ease-out, box-shadow .06s ease-out;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--accent); }
.btn.ink { background: var(--ink); box-shadow: 0 6px 0 var(--term-edge); }
.btn.ink:active { box-shadow: 0 1px 0 var(--term-edge); }
.btn.auto { width: auto; padding: 0 24px; }
.fine { font-size: 15px; line-height: 1.5; color: var(--muted); margin-top: 16px; }
.fine a { color: var(--accent); }

/* Sections */
.section { margin-top: 56px; }
.section > h2 + * { margin-top: 18px; }

/* Home */
.hero { padding-top: 28px; display: grid; gap: 32px; }
.hero .art { width: 100%; height: auto; max-width: 280px; margin: 0 auto; }
.follow { margin-top: 40px; display: grid; gap: 12px; }
.follow h2 { font-size: 20px; }

.guide-card {
  position: relative;
  display: grid; gap: 16px; align-content: start;
  color: var(--ink); text-decoration: none;
}
.guide-card .thumb { width: 100%; border-radius: 14px; background: var(--page); }
.guide-card h3 { margin-top: 2px; }
.guide-card p { font-size: 16px; line-height: 1.4; margin-top: 6px; }
.guide-card .row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.guide-card .go { font-weight: 800; color: var(--accent); font-size: 16px; }
.guide-card:hover .go { text-decoration: underline; }
.guides { display: grid; gap: 22px; }

/* The two newest guides carry a flag on the card's top edge */
.guide-card .flag {
  position: absolute; top: -12px; left: 18px;
  background: var(--coral); color: var(--ink);
  font-weight: 800; font-size: 13px; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 11px 6px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px var(--page);
}
.section > h2 + .guides { margin-top: 30px; }
.all-guides { margin-top: 28px; font-weight: 800; font-size: 17px; }

/* Guides page: every guide, newest first */
.library { padding-top: 28px; }
.library .sub { max-width: 640px; }
.library .guides { margin-top: 40px; }
.library .g-more { margin-top: 56px; }

.contact .email { font-weight: 700; overflow-wrap: anywhere; }

/* Guide page */
.guide {
  padding-top: 24px;
  display: grid;
  gap: 32px;
  grid-template-areas: "head" "form" "inside" "note" "more";
}
.guide > .g-head { grid-area: head; }
.guide > .g-form { grid-area: form; }
.guide > .g-inside { grid-area: inside; }
.guide > .g-note { grid-area: note; }
.guide > .g-more { grid-area: more; }
.g-head .meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.more { display: grid; gap: 4px; }

/* Privacy page: one readable column */
.legal { max-width: 760px; padding-top: 28px; }
.legal .updated { margin-top: 10px; }
.legal section { margin-top: 44px; }
.legal .short { margin-top: 32px; }
.legal h3 { font-size: 20px; margin-top: 26px; }
.legal p { margin-top: 12px; }
.legal ul { margin-top: 12px; padding-left: 1.2em; display: grid; gap: 8px; }
.legal li::marker { color: var(--violet); }
.legal .short ul { margin-top: 16px; }
.more .btn { margin-top: 16px; }

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  body { font-size: 18px; }
  h2 { font-size: 32px; }
  .top { padding-top: 26px; }
  .panel { padding: 28px 28px 30px; }
  .violet { padding: 30px 30px 28px; }
  .hero { grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding-top: 56px; }
  .hero .art { max-width: 400px; margin: 0 auto; }
  .follow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
  .guides { grid-template-columns: 1fr 1fr; }
  .library { padding-top: 56px; }
  .news { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
  .news .panel { margin-top: 0; }
  .btn.auto-md { width: auto; padding: 0 28px; justify-self: start; }
}

@media (min-width: 900px) {
  .guide {
    padding-top: 48px;
    grid-template-columns: 1fr 400px;
    column-gap: 48px;
    row-gap: 40px;
    grid-template-areas:
      "head form"
      "inside form"
      "note form"
      "more more";
  }
  .g-form > .panel { position: sticky; top: 24px; }
}

/* Sign-up sent: replaces the form in place */
.sent h2 { font-size: 24px; }
.sent p { margin-top: 10px; }
.form-error { font-weight: 700; font-size: 15px; margin-top: 14px; padding-left: 10px; border-left: 4px solid var(--coral); }
