/* ==========================================================================
   rebeccabenton.com - main.css
   Mobile-first. Breakpoints: 480px, 768px, 1024px.
   Light theme only: every colour is set explicitly, no dark-mode rules.
   ========================================================================== */

:root {
  color-scheme: only light;

  --paper: #ffffff;
  --tint: #f6f2ec;
  --ink: #141414;
  --ink-soft: #262626;
  --muted: #595959;
  --rule: #dadada;
  --rule-soft: #e9e6e1;

  --label-bg: #fbe6d3;
  --label-ink: #8a4b17;
  --marker: #fbdcbc;

  --green: #1b6b2f;
  --green-dark: #124d21;

  --cta: #b3122e;
  --cta-hover: #8f0e24;
  --cta-edge: #7d0b20;

  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --col: 48rem;
  --gutter: 1rem;
  --radius: 4px;
  --section-gap: 2.75rem;
}

@media (min-width: 480px) {
  :root { --gutter: 1.25rem; }
}
@media (min-width: 768px) {
  :root { --gutter: 1.5rem; --section-gap: 3.25rem; }
}
@media (min-width: 1024px) {
  :root { --section-gap: 3.75rem; }
}

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

html {
  background-color: #ffffff;
  color: #141414;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "masthead"
    "main"
    "footer";
  background-color: #ffffff;
  color: #141414;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img,
video { max-width: 100%; height: auto; }

a {
  color: var(--green);
  text-underline-offset: 0.18em;
  transition: color 0.15s ease, background-color 0.15s ease;
}
a:hover { color: var(--green-dark); }

:focus-visible {
  outline: 3px solid #141414;
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background-color: #141414;
  color: #ffffff;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; color: #ffffff; }

/* --- Reading progress strip (the grey bar at the very top) --------------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 4px;
  background-color: #d9d9d9;
}
.progress__bar {
  height: 100%;
  width: 100%;
  background-color: #141414;
  transform: scaleX(0);
  transform-origin: left center;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  grid-area: masthead;
  background-color: #ffffff;
  color: #141414;
  padding: 1.25rem 0 0.95rem;
  border-bottom: 4px double #141414;
}

.masthead__inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "date label"
    "brand brand"
    "tagline tagline";
  align-items: center;
  row-gap: 0.25rem;
}

.masthead__date {
  grid-area: date;
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #595959;
}

.masthead__label {
  grid-area: label;
  margin: 0;
  padding: 0.4rem 0.7rem;
  background-color: var(--label-bg);
  color: var(--label-ink);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  border-radius: var(--radius);
}

.masthead__back {
  grid-area: label;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #141414;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.masthead__back:hover { color: var(--green); border-bottom-color: var(--green); }

.masthead__brand {
  grid-area: brand;
  justify-self: center;
  margin: 0.55rem 0 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.625rem, 1rem + 3.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
  color: #141414;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.masthead__brand:hover { color: #141414; opacity: 0.8; }

.masthead__tagline {
  grid-area: tagline;
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #595959;
}

@media (min-width: 768px) {
  .masthead { padding-top: 1.5rem; padding-bottom: 1.1rem; }
  .masthead__date { font-size: 0.75rem; }
  .masthead__tagline { font-size: 0.9375rem; }
}

/* --- Story layout --------------------------------------------------------- */

.story {
  grid-area: main;
  min-width: 0;
  background-color: #ffffff;
  color: #141414;
}

.story__column {
  max-width: var(--col);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 1rem;
}

@media (min-width: 768px) {
  .story__column { padding-top: 2.25rem; }
}

.story__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "kicker"
    "title"
    "dek"
    "byline";
}

.story__kicker {
  grid-area: kicker;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #595959;
}

.story__title {
  grid-area: title;
  margin: 0.6rem 0 0.9rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: #141414;
}

.story__dek {
  grid-area: dek;
  margin: 0 0 1.15rem;
  font-style: italic;
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.25rem);
  line-height: 1.5;
  color: #404040;
}

.byline {
  grid-area: byline;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4a4a4a;
}
.byline__publisher { font-weight: 700; color: #141414; }
.byline__meta { color: #595959; }

@media (min-width: 768px) {
  .byline { flex-direction: row; flex-wrap: wrap; column-gap: 0.55rem; }
  .byline__publisher::after { content: "\00B7"; margin-left: 0.55rem; font-weight: 400; color: #595959; }
}

/* --- Prose ---------------------------------------------------------------- */

:where(.story) :where(p, ul, ol) { margin: 0 0 1.15em; color: #222222; }

.story__lead { font-size: 1.1875rem; line-height: 1.6; color: #141414; }

.keyphrase {
  font-weight: 700;
  color: #141414;
  background-image: linear-gradient(transparent 58%, var(--marker) 58%);
  padding: 0 0.1em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.story h2 {
  margin: var(--section-gap) 0 1rem;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(1.0625rem, 0.98rem + 0.5vw, 1.3125rem);
  line-height: 1.28;
  letter-spacing: 0.012em;
  text-transform: uppercase;
  color: #141414;
  text-wrap: balance;
}

/* --- Figures -------------------------------------------------------------- */

.figure { margin: 1.75rem 0; }

.figure__frame {
  overflow: hidden;
  border-radius: var(--radius);
  background-color: #e6e3de;
}
.figure__frame img { display: block; width: 100%; height: auto; }

.figure__frame--video { aspect-ratio: 1200 / 630; }
.figure__frame--video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure__frame--crop { aspect-ratio: 4 / 3; }
.figure__frame--crop img {
  height: 100%;
  object-fit: cover;
}
.figure__frame--phone img { object-position: 30% 50%; }
.figure__frame--hand img { object-position: 72% 40%; }

.figure__caption {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #595959;
}

.figure--hero { margin: 1.5rem 0 2rem; }
@media (min-width: 768px) {
  .figure--hero { margin: 1.75rem 0 2.25rem; }
}

/* --- Pull line ------------------------------------------------------------ */

.pullquote {
  margin: 2.25rem 0;
  padding: 1.25rem 0 1.1rem;
  border-top: 2px solid #141414;
  border-bottom: 1px solid var(--rule);
  background-color: #ffffff;
}
.story .pullquote p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.625rem);
  line-height: 1.32;
  color: #141414;
  text-wrap: balance;
}

/* --- How it works: steps + figure ----------------------------------------- */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "steps"
    "media";
  gap: 0.5rem 0;
}
.how__steps { grid-area: steps; }
.how__media { grid-area: media; margin: 0.5rem 0 1.5rem; align-self: start; }

@media (min-width: 768px) {
  .how {
    grid-template-columns: minmax(0, 1fr) 15rem;
    grid-template-areas: "steps media";
    column-gap: 2rem;
  }
  .how__media { margin-top: 0.4rem; position: sticky; top: 1.5rem; }
  .how__media .figure__frame--crop { aspect-ratio: 3 / 4; }
}

.steps {
  list-style: none;
  margin: 0.5rem 0 1.25rem;
  padding: 0;
  counter-reset: step;
}
.steps__item {
  position: relative;
  counter-increment: step;
  margin: 0;
  padding: 0.95rem 0 0.95rem 3.1rem;
  border-top: 1px solid var(--rule-soft);
  color: #222222;
}
.steps__item:last-child { border-bottom: 1px solid var(--rule-soft); }
.steps__item::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 2.4rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--label-ink);
}
.steps__item strong { color: #141414; }

/* --- Mistakes ------------------------------------------------------------- */

.mistake {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "title"
    "body"
    "media";
  margin: 2.5rem 0;
}

.mistake--wide {
  grid-template-areas:
    "title"
    "body"
    "media";
}

.mistake__title {
  grid-area: title;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: #141414;
}

.mistake__num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: -0.05rem;
  border-radius: 50%;
  background-color: #141414;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.mistake__body { grid-area: body; min-width: 0; }
.mistake__body p:last-child { margin-bottom: 0; }

.mistake__fix {
  padding-left: 0.95rem;
  border-left: 3px solid var(--green);
  color: #222222;
}
.story .mistake__fix { margin-top: 1rem; }
.mistake__fix-label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.mistake__media { grid-area: media; margin: 1.5rem 0 0; }

@media (min-width: 768px) {
  .mistake--aside-end {
    grid-template-columns: minmax(0, 1fr) 15rem;
    grid-template-areas:
      "title title"
      "body media";
    column-gap: 2rem;
    align-items: start;
  }
  .mistake--aside-start {
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-areas:
      "title title"
      "media body";
    column-gap: 2rem;
    align-items: start;
  }
  .mistake--aside-end .mistake__media,
  .mistake--aside-start .mistake__media { margin-top: 0.25rem; }
  .mistake--aside-end .figure__frame--crop,
  .mistake--aside-start .figure__frame--crop { aspect-ratio: 4 / 5; }
}

/* --- Calls to action ------------------------------------------------------ */

.cta {
  margin: 2.5rem 0;
  text-align: center;
  background-color: transparent;
  color: #141414;
}

.cta__kicker {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--label-ink);
}
.story .cta__kicker { color: var(--label-ink); }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1.25rem;
  background-color: var(--cta);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--cta-edge), 0 10px 22px rgba(179, 18, 46, 0.22);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover {
  background-color: var(--cta-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--cta-edge), 0 14px 26px rgba(179, 18, 46, 0.28);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cta-edge), 0 4px 10px rgba(179, 18, 46, 0.2);
}
.btn:focus-visible { outline: 3px solid #141414; outline-offset: 4px; }

.btn__arrow {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 0.18s ease;
}
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn-note {
  max-width: 28rem;
  margin: 0.85rem auto 0;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  color: #595959;
}
.story .cta .btn-note { margin: 0.85rem auto 0; color: #595959; }

@media (min-width: 480px) {
  .btn {
    display: inline-flex;
    width: auto;
    min-width: 21rem;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
    font-size: 1rem;
  }
}

/* --- Closing band (tinted section) ---------------------------------------- */

.band {
  background-color: var(--tint);
  color: #141414;
  padding: 0.5rem 0 1.5rem;
  margin-top: 1.5rem;
}
.band__column {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
:where(.band) :where(p, ul) { margin: 0 0 1.15em; color: #222222; }
.band h2 { margin-top: var(--section-gap); }
.band .cta { margin-bottom: 1.5rem; }
.band .btn-note { color: #595959; }

.band .cta__kicker { color: var(--label-ink); }

.checklist {
  list-style: none;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
}
.checklist__item {
  position: relative;
  margin: 0;
  padding: 0.7rem 0 0.7rem 2.1rem;
  border-top: 1px solid #ddd6cb;
  color: #222222;
}
.checklist__item:last-child { border-bottom: 1px solid #ddd6cb; }
.checklist__item::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.05rem;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(-45deg);
}

@media (min-width: 1024px) {
  .band { padding-bottom: 2.5rem; margin-top: 2.5rem; }
}

/* --- Legal / about pages --------------------------------------------------- */

.legal {
  grid-area: main;
  min-width: 0;
  background-color: #ffffff;
  color: #141414;
}
.legal__column {
  max-width: var(--col);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2rem;
}
@media (min-width: 768px) {
  .legal__column { padding-top: 3rem; padding-bottom: 3rem; }
}

.legal h1 {
  margin: 0 0 0.9rem;
  font-weight: 700;
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.375rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: #141414;
  text-wrap: balance;
}

.dateline {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  font-style: italic;
  line-height: 1.5;
  color: #595959;
}

.legal__intro {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: #262626;
}

.legal h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4375rem);
  font-weight: 700;
  line-height: 1.25;
  color: #141414;
}
:where(.legal) :where(p, ul, ol) { margin: 0 0 1em; color: #222222; }
:where(.legal) :where(ul, ol) { padding-left: 1.4rem; }
.legal li { margin-bottom: 0.4rem; }

.legal__address {
  margin: 0 0 1em;
  padding-left: 0.95rem;
  border-left: 3px solid var(--rule);
  font-style: normal;
  color: #222222;
}

/* --- Footer ---------------------------------------------------------------- */

.footer {
  grid-area: footer;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "address"
    "nav"
    "note";
  row-gap: 1.25rem;
  padding: 2.5rem max(var(--gutter), calc((100% - var(--col)) / 2 + var(--gutter))) 3rem;
  background-color: #ffffff;
  color: #595959;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.footer__address {
  grid-area: address;
  margin: 0;
  color: #404040;
  font-style: normal;
}
.footer__address p { margin: 0; color: #404040; }
.footer__address strong { color: #141414; }

.footer__nav-legal { grid-area: nav; }
.footer__nav-legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__nav-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #262626;
  text-decoration: underline;
  text-decoration-color: #9a9a9a;
}
.footer__nav-legal a:hover { color: var(--green-dark); text-decoration-color: currentColor; }

.publisher-note {
  grid-area: note;
  margin: 0;
  color: #595959;
  font-size: 0.8125rem;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .footer {
    row-gap: 1.5rem;
    padding-top: 3.5rem;
    padding-bottom: 4rem;
  }
  .footer__nav-legal ul { gap: 0 1.6rem; }
}

/* --- Motion preferences ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition: none !important; scroll-behavior: auto !important; }
}
