/* Personal post layout. Mobile-first (390px), text column 680px.
   Scale: base 18px, ratio 1.25 -> 14 / 18 / 22.5 / 28 / 35 / 42 (display clamps). */

:root {
  --bg: #fffefb;
  --ink: #1b1b1a;
  --muted: #5f5b55;
  --line: #e4dfd5;
  --panel: #f5f2ec;
  --accent: #2450b4;
  --accent-ink: #1a3d8c;
  --red: #b3261e;
  --amber: #a35f00;
  --green: #2f7d57;
  --grey: #8a857d;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 1.25rem;
  --col: 42.5rem; /* 680px */
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
@media (min-width: 48rem) {
  body { font-size: 1.1875rem; }
}

.post {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2rem var(--gutter) 5rem;
}

/* Site masthead: personal newsletter, no brand */
.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.masthead-in {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  font-family: var(--sans);
}
.masthead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.masthead-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}
.masthead-tag {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

/* Post header */
.post-head { margin-bottom: 1.5rem; }

.sponsored {
  display: inline-block;
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.875rem, 1.6rem + 1.15vw, 2.625rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.sub {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.byline {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}
.byline-name {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.byline-name strong { font-weight: 600; }
.byline-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.byline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.byline-meta {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.byline-row + .byline-bio { margin-top: 0.75rem; }
.byline-bio {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Hero photo: full-bleed on phones, column width above */
.hero {
  margin: 1.5rem calc(-1 * var(--gutter)) 2rem;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
}
.hero figcaption,
.figure figcaption {
  margin-top: 0.5rem;
  padding-inline: var(--gutter);
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (min-width: 48rem) {
  .hero { margin-inline: 0; }
  .hero img { border-radius: 6px; }
  .hero figcaption { padding-inline: 0; }
}

/* Article body */
.article p { margin: 0 0 1.2em; text-wrap: pretty; }
.article ul { margin: 0 0 1.2em; padding-left: 1.25em; }
.article li { margin-bottom: 0.5em; }
.article li::marker { color: var(--muted); }
.article strong { font-weight: 600; }

h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
@media (min-width: 48rem) {
  h2 { font-size: 1.875rem; }
}

blockquote {
  margin: 0 0 1.2em;
  padding: 0.25rem 0 0.25rem 1.125rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
}
blockquote p { margin: 0; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-ink); text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sep {
  margin: 2.5rem 0;
  text-align: center;
  line-height: 1;
  color: var(--muted);
  letter-spacing: 0.75em;
}
.sep::before { content: "\2022\2022\2022"; }

/* Buttons: screen 1, the form, the hub link in the result */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-ink); color: #fff; }

.cta-block { margin: 1.75rem 0 0; }
.article .cta-note {
  margin: 0.625rem 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}
@media (max-width: 29.99rem) {
  .cta-block .btn { width: 100%; }
  .cta-note { text-align: center; }
}

/* Schema */
.figure { margin: 1.75rem 0 2rem; }
.figure svg {
  display: block;
  width: 100%;
  max-width: 32.5rem;
  height: auto;
  margin: 0 auto;
}
.figure figcaption { padding-inline: 0; text-align: center; }

/* Screenshots and photos inside the article */
.figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
.figure-chat img { max-width: 22.5rem; }
.figure-shot img { border: 1px solid var(--line); border-radius: 0; }
/* Wide screenshots go full-bleed on phones so the text stays readable */
@media (max-width: 47.99rem) {
  .figure-shot,
  .figure-photo { margin-inline: calc(-1 * var(--gutter)); }
  .figure-shot img,
  .figure-photo img { border-radius: 0; border-inline: 0; }
  .figure-shot figcaption,
  .figure-photo figcaption { padding-inline: var(--gutter); }
}

/* Risk check */
.check {
  margin-top: 3rem;
  padding: 1.5rem var(--gutter) 1.75rem;
  margin-inline: calc(-1 * var(--gutter));
  background: var(--panel);
  scroll-margin-top: 1rem;
}
@media (min-width: 48rem) {
  .check { margin-inline: 0; padding: 2rem 2.25rem 2.25rem; border-radius: 12px; }
}
.check h2 { margin-top: 0; }
.check-intro { margin: 0 0 1.5rem; }

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}
.hint {
  margin: 0.125rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
}
.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #b9b2a6;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.hint + input,
.hint + select { margin-top: 0; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f5b55' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}
.field [aria-invalid="true"] { border-color: var(--red); }
.field-error {
  margin: 0.375rem 0 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--red);
}
.check form .btn { width: 100%; margin-top: 0.25rem; }
@media (min-width: 48rem) {
  .check form .btn { width: auto; }
}

.result {
  margin-top: 1.75rem;
  padding: 1.25rem 1.25rem 1.375rem;
  border-left: 4px solid var(--grey);
  border-radius: 0 8px 8px 0;
  background: #fff;
}
.result:focus { outline: none; }
.result[data-zone="red"] { border-left-color: var(--red); }
.result[data-zone="amber_above"],
.result[data-zone="amber_below"] { border-left-color: var(--amber); }
.result[data-zone="green"] { border-left-color: var(--green); }
.result p { margin: 0 0 0.9em; }
.result p:last-of-type { margin-bottom: 0; }
.result .btn { margin-top: 1.25rem; }
@media (max-width: 29.99rem) {
  .result .btn { width: 100%; }
}

[hidden] { display: none !important; }

/* Site footer */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--sans);
}
.site-foot-in {
  max-width: calc(var(--col) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
}
.site-foot-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.site-foot-note,
.site-foot-copy {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
}
.site-foot-copy { margin-top: 0.5rem; }

/* Hub button with a small destination note beside it */
.hub-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
}
.hub-note {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}
