/*
  Before You Renovate — product theme and page styles.

  File layout:
    1. Fonts          self-hosted, see /assets/fonts/
    2. Tokens         the only place a colour, font or size value is declared
    3. Base           element defaults for these pages
    4. Structure      reusable classes; another "Before You…" product can reuse
                      this block by swapping block 2
    5. Product parts  pieces specific to Before You Renovate
    6. Placeholders   the byr-todo marker; none may reach main

  These pages do not load the studio's /styles.css.
*/

/* ---------- 1. Fonts ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-500.woff2") format("woff2");
}

/* ---------- 2. Tokens ---------- */

:root {
  /* Colour (spec 2.1) */
  --byr-ground: #F5F7F6;
  --byr-surface: #FFFFFF;
  --byr-ink: #12211C;
  --byr-text: #33443D;
  --byr-muted: #3F5049;
  --byr-line: #D5DDD9;
  --byr-accent: #1D4ED8;
  --byr-accent-hover: #1E3A8A;
  --byr-accent-tint: #E4ECFB;
  --byr-caution-bg: #FFF7ED;
  --byr-caution-line: #FDBA74;
  --byr-caution-ink: #7C2D12;
  --byr-on-dark: #E6ECE9;
  --byr-on-dark-muted: #C9D4CF;
  --byr-on-dark-faint: #A9B8B1;
  --byr-line-dark: #3A4B45;
  --byr-on-accent-muted: #E0E9FF;

  /* Placeholder highlight. Not a brand colour; leaves with the last byr-todo. */
  --byr-todo-bg: #FFEDD5;

  /* Type (spec 2.2) */
  --byr-font-heading: "Space Grotesk", sans-serif;
  --byr-font-body: "Inter", system-ui, sans-serif;
  --byr-font-mono: "JetBrains Mono", monospace;

  /* Shape and spacing (spec 2.3) */
  --byr-width: 1120px;
  --byr-width-narrow: 800px;
  --byr-width-prose: 760px;
  --byr-width-intro: 720px;
  --byr-gutter: 24px;
  --byr-section-pad: 80px;
  --byr-radius-card: 14px;
  --byr-radius-hero: 16px;
  --byr-radius-button: 8px;
}

/* ---------- 3. Base ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--byr-font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--byr-ink);
  background: var(--byr-ground);
}

p {
  margin: 0;
}

a {
  color: var(--byr-accent);
}

a:hover {
  color: var(--byr-accent-hover);
}

/* Long addresses wrap inside narrow cards instead of spilling out */
a[href^="mailto:"] {
  overflow-wrap: anywhere;
}

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

/* ---------- 4. Structure ---------- */

/* Page */

.byr-page--longform {
  line-height: 1.6;
}

.byr-main {
  padding: 64px var(--byr-gutter) 88px;
}

.byr-container {
  max-width: var(--byr-width);
  margin: 0 auto;
}

.byr-container--narrow {
  max-width: var(--byr-width-narrow);
}

.byr-container--prose {
  max-width: var(--byr-width-prose);
}

.byr-intro {
  max-width: var(--byr-width-intro);
}

/* Vertical stack: children in a column with a fixed gap */

.byr-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.byr-stack--6 { gap: 6px; }
.byr-stack--8 { gap: 8px; }
.byr-stack--10 { gap: 10px; }
.byr-stack--12 { gap: 12px; }
.byr-stack--14 { gap: 14px; }
.byr-stack--20 { gap: 20px; }
.byr-stack--24 { gap: 24px; }
.byr-stack--32 { gap: 32px; }
.byr-stack--40 { gap: 40px; }
.byr-stack--48 { gap: 48px; }

.byr-stack--start {
  align-items: flex-start;
}

/* Wrapping grid: equal children that stack when they no longer fit */

.byr-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.byr-grid > * {
  flex: 1 1 var(--byr-grid-min, 280px);
  min-width: 0;
}

.byr-grid--230 { --byr-grid-min: 230px; }
.byr-grid--320 { --byr-grid-min: 320px; }
.byr-grid--360 { --byr-grid-min: 360px; }

/* Two-part split: a heading column and a wider content column */

.byr-split {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.byr-split__aside {
  flex: 1 1 320px;
  min-width: 0;
}

.byr-split__main {
  flex: 2 1 480px;
  min-width: 0;
}

.byr-split--even > .byr-split__aside {
  flex: 1 1 380px;
}

.byr-split--even > .byr-split__main {
  flex: 1 1 420px;
}

/* Header */

.byr-header {
  background: var(--byr-ground);
  border-bottom: 1px solid var(--byr-line);
}

.byr-header__inner {
  max-width: var(--byr-width);
  margin: 0 auto;
  padding: 16px var(--byr-gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.byr-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  color: var(--byr-ink);
}

.byr-wordmark:hover {
  color: var(--byr-ink);
}

.byr-wordmark__glyph {
  flex: none;
}

.byr-wordmark__tile {
  fill: var(--byr-ink);
}

.byr-wordmark__room {
  fill: none;
  stroke: var(--byr-ground);
  stroke-width: 2;
  stroke-linejoin: round;
}

.byr-wordmark__name {
  font-family: var(--byr-font-heading);
  font-weight: 700;
  font-size: 19px;
}

.byr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.byr-nav__link {
  padding: 12px;
  text-decoration: none;
  color: var(--byr-ink);
  font-weight: 500;
  font-size: 16px;
}

.byr-nav__link:hover {
  color: var(--byr-accent-hover);
}

.byr-nav__link[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* Buttons */

.byr-button {
  display: inline-block;
  padding: 14px 24px;
  border-radius: var(--byr-radius-button);
  font-weight: 600;
  text-decoration: none;
}

.byr-button--primary {
  color: var(--byr-surface);
  background: var(--byr-accent);
}

.byr-button--primary:hover {
  color: var(--byr-surface);
  background: var(--byr-accent-hover);
}

.byr-button--outline {
  color: var(--byr-ink);
  border: 1.5px solid var(--byr-ink);
}

.byr-button--outline:hover {
  color: var(--byr-accent-hover);
  border-color: var(--byr-accent-hover);
}

.byr-button--compact {
  padding: 12px 20px;
  font-size: 16px;
}

/* On the accent band. Also used on a <span> for a not-yet-active control. */
.byr-button--on-accent {
  padding: 16px 28px;
  color: var(--byr-ink);
  background: var(--byr-surface);
}

.byr-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Sections */

.byr-section {
  padding: var(--byr-section-pad) var(--byr-gutter);
}

.byr-section--hero {
  padding: 72px var(--byr-gutter) 64px;
}

.byr-section--band {
  padding: 28px var(--byr-gutter);
}

.byr-section--surface {
  background: var(--byr-surface);
  border-top: 1px solid var(--byr-line);
}

.byr-section--ruled-bottom {
  border-bottom: 1px solid var(--byr-line);
}

.byr-section--ink {
  --byr-focus: var(--byr-surface);
  background: var(--byr-ink);
  color: var(--byr-on-dark);
}

.byr-section--caution {
  background: var(--byr-caution-bg);
  border-top: 1px solid var(--byr-caution-line);
  border-bottom: 1px solid var(--byr-caution-line);
}

.byr-section--accent {
  --byr-focus: var(--byr-surface);
  padding: 88px var(--byr-gutter);
  background: var(--byr-accent);
  color: var(--byr-surface);
}

/* Type */

.byr-eyebrow {
  font-family: var(--byr-font-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--byr-muted);
}

.byr-eyebrow--caution {
  color: var(--byr-caution-ink);
}

.byr-eyebrow--on-dark {
  color: var(--byr-on-dark-faint);
}

.byr-h1 {
  margin: 0;
  font-family: var(--byr-font-heading);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.byr-h1--display {
  font-size: clamp(38px, 5.2vw, 60px);
  line-height: 1.05;
}

.byr-h2 {
  margin: 0;
  font-family: var(--byr-font-heading);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.byr-h2--display {
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.1;
}

/* Smaller H2s for long-form pages and cards */
.byr-h2--sub,
.byr-h2--prose,
.byr-h2--card,
.byr-h2--card-sm {
  line-height: inherit;
  letter-spacing: normal;
}

.byr-h2--sub { font-size: 30px; }
.byr-h2--prose { font-size: 26px; }
.byr-h2--card { font-size: 24px; }
.byr-h2--card-sm { font-size: 22px; }

.byr-h3 {
  margin: 0;
  font-family: var(--byr-font-heading);
  font-weight: 700;
  font-size: 21px;
}

.byr-h3--lg {
  font-size: 24px;
}

.byr-lead {
  font-size: 20px;
  line-height: 1.5;
  color: var(--byr-text);
}

.byr-lead--sm {
  font-size: 19px;
  line-height: inherit;
}

.byr-lead--on-accent {
  color: var(--byr-on-accent-muted);
}

.byr-text {
  color: var(--byr-text);
}

.byr-text--on-dark {
  color: var(--byr-on-dark-muted);
}

.byr-note {
  font-size: 15px;
  color: var(--byr-muted);
}

.byr-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--byr-muted);
}

.byr-strong-heading {
  font-family: var(--byr-font-heading);
  font-size: 19px;
}

.byr-on-dark-strong {
  color: var(--byr-surface);
}

.byr-link--strong {
  padding: 10px 0;
  font-weight: 600;
}

/* A link that stands alone on its line: 44px tap target, layout unchanged */
.byr-link--target {
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

.byr-link--on-dark,
.byr-link--on-dark:hover {
  color: var(--byr-surface);
}

/* Lists */

.byr-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--byr-text);
}

.byr-plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Cards: flat, 1px border, no shadow */

.byr-card {
  --byr-focus: var(--byr-accent);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  background: var(--byr-surface);
  color: var(--byr-ink);
  border: 1px solid var(--byr-line);
  border-radius: var(--byr-radius-card);
}

.byr-card--12 { gap: 12px; }
.byr-card--14 { gap: 14px; }

.byr-card--roomy {
  padding: 32px;
  gap: 14px;
}

.byr-card--borderless {
  border: 0;
}

.byr-card--ink {
  --byr-focus: var(--byr-surface);
  background: var(--byr-ink);
  color: var(--byr-on-dark);
  border: 0;
}

/* Numbered steps */

.byr-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 3px solid var(--byr-ink);
}

.byr-step__number {
  font-family: var(--byr-font-mono);
  font-size: 15px;
  color: var(--byr-accent);
}

/* Label and value rows (definition lists, fact rows) */

.byr-rows {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.byr-rows__item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--byr-line);
}

.byr-rows__item:last-child {
  border-bottom: 1px solid var(--byr-line);
}

.byr-rows__term {
  flex: 0 0 180px;
  font-weight: 600;
}

.byr-rows__desc {
  flex: 1 1 240px;
  margin: 0;
  color: var(--byr-text);
}

.byr-rows--on-dark .byr-rows__item {
  gap: 8px 24px;
  padding: 20px 0;
  border-color: var(--byr-line-dark);
}

.byr-rows--on-dark .byr-rows__term {
  flex-basis: 200px;
  font-weight: 700;
  color: var(--byr-surface);
}

.byr-rows--on-dark .byr-rows__desc {
  flex-basis: 260px;
  color: var(--byr-on-dark-muted);
}

/* FAQ: native details and summary, no script */

.byr-faq {
  display: flex;
  flex-direction: column;
}

.byr-faq__item {
  border-top: 1px solid var(--byr-line);
}

.byr-faq__item:last-child {
  border-bottom: 1px solid var(--byr-line);
}

/* Padding sits on the summary so the whole row is the tap target */
.byr-faq__question {
  padding: 18px 0;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
}

.byr-faq__item[open] > .byr-faq__question {
  padding-bottom: 12px;
}

.byr-faq__answer {
  padding-bottom: 18px;
  color: var(--byr-text);
}

/* Table that scrolls sideways inside its own box */

.byr-table-scroll {
  overflow-x: auto;
  background: var(--byr-surface);
  border: 1px solid var(--byr-line);
  border-radius: 12px;
}

.byr-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 16px;
}

.byr-table th {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--byr-line);
}

.byr-table td {
  padding: 14px 16px;
  vertical-align: top;
  color: var(--byr-text);
}

.byr-table td:first-child {
  font-weight: 600;
  color: var(--byr-ink);
}

/* Footer */

.byr-footer {
  --byr-focus: var(--byr-surface);
  padding: 56px var(--byr-gutter) 40px;
  background: var(--byr-ink);
  color: var(--byr-on-dark-muted);
}

.byr-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  justify-content: space-between;
}

.byr-footer__brand {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.byr-footer__name {
  font-family: var(--byr-font-heading);
  font-size: 19px;
  color: var(--byr-surface);
}

.byr-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  align-items: flex-start;
}

.byr-footer__link,
.byr-footer__link:hover {
  padding: 10px 0;
  color: var(--byr-surface);
}

.byr-footer__legal {
  padding-top: 24px;
  border-top: 1px solid var(--byr-line-dark);
  font-size: 14px;
  color: var(--byr-on-dark-faint);
}

/* ---------- 5. Product parts ---------- */

/* Hero: copy on one side, media on the other. The media column holds the
   illustration card today and can hold app screenshots later. */

.byr-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}

.byr-hero__copy {
  flex: 1 1 440px;
  min-width: 0;
}

.byr-hero__media {
  flex: 1 1 400px;
  min-width: 0;
}

.byr-card--hero {
  gap: 16px;
  padding: 24px;
  border-radius: var(--byr-radius-hero);
}

/* Floor plan illustration */

.byr-plan {
  display: block;
  width: 100%;
  height: auto;
}

.byr-plan__ground {
  fill: var(--byr-ground);
}

.byr-plan__room {
  fill: var(--byr-accent-tint);
  stroke: var(--byr-ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.byr-plan__dim {
  fill: none;
  stroke: var(--byr-accent);
  stroke-width: 1.5;
}

.byr-plan__dim-label {
  font-family: var(--byr-font-mono);
  font-size: 13px;
  fill: var(--byr-accent);
}

.byr-plan__door {
  fill: none;
  stroke: var(--byr-ink);
  stroke-width: 1.5;
}

.byr-plan__door-gap {
  stroke: var(--byr-ground);
  stroke-width: 4;
}

.byr-plan__name {
  font-family: var(--byr-font-heading);
  font-weight: 600;
  font-size: 18px;
  fill: var(--byr-ink);
}

/* Measurement tiles under the floor plan */

.byr-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.byr-tile {
  flex: 1 1 110px;
  padding: 12px 14px;
  background: var(--byr-ground);
  border-radius: 10px;
}

.byr-tile__label {
  font-size: 13px;
  color: var(--byr-muted);
}

.byr-tile__value {
  font-family: var(--byr-font-mono);
  font-weight: 500;
  font-size: 19px;
}

/* At a glance band */

.byr-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  justify-content: space-between;
  font-weight: 500;
  font-size: 16px;
}

/* App Privacy card and its checkmark */

.byr-split--tight {
  gap: 24px;
}

.byr-icon-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.byr-check {
  flex: none;
}

.byr-check__mark {
  fill: none;
  stroke: var(--byr-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 6. Placeholders ---------- */

/* A fact only Anette can supply. Verification step 5 greps for this class. */
.byr-todo {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 400;
  background: var(--byr-todo-bg);
  color: var(--byr-caution-ink);
}
