/* ------------------------------------------------------------------
   Roofing guides, en-CA. Editorial publication, not a sales page.

   Palette: charcoal fields, warm low-chroma stone ground, one burnt
   accent. Serif for everything that is read, system sans for the
   interface furniture (navigation, metadata, tables).

   Surfaces are separated by a step in tone, never by a line. The only
   rules on the site are inside real tables.
   ------------------------------------------------------------------ */

:root {
  /* fields */
  --ink:        #1b1f24;   /* dark field: header, hero, footer */
  --ink-2:      #262c33;   /* running text */
  --paper:      #ecebe8;   /* page ground, warm stone */
  --surface:    #ffffff;   /* raised editorial surface */
  --field:      #e4e6e8;   /* recessed band */
  --art:        #eef1f3;   /* ground the drawn diagrams are built on */

  /* text */
  --slate:      #46525f;   /* secondary prose        7.0:1 on paper */
  --slate-2:    #586673;   /* metadata               5.2:1 on paper */
  --slate-3:    #8a99a8;   /* on dark fields only    5.7:1 on ink   */
  --on-dark:    #c3ccd4;   /* running text on dark  10.2:1 on ink   */

  /* accent */
  --accent:     #a44a17;   /* links and marks on light  5.2:1 */
  --accent-2:   #e39a4a;   /* accents on dark fields    7.1:1 */
  --accent-ink: #8d4218;   /* category marks on light   6.3:1 */

  --line:       #d9d5cf;   /* real tables only */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  /* five type steps and nothing in between */
  --t-display: clamp(2.1rem, 5.3vw, 4.3rem);
  --t-title:   clamp(1.62rem, 3.2vw, 2.5rem);
  --t-head:    1.56rem;
  --t-sub:     1.19rem;
  --t-small:   .875rem;

  /* one spacing rhythm */
  --gutter:  24px;
  --gap-sec: 104px;   /* between sections, always larger than anything inside one */
  --gap-blk: 44px;    /* between blocks inside a section */

  --wrap: 1120px;
  --measure: 70ch;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.66;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
  accent-color: var(--accent);
  scrollbar-color: var(--slate-2) var(--field);
}

::selection { background: #f6dcc3; color: var(--ink); }

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  text-decoration-color: rgba(164, 74, 23, .4);
  transition: color .16s ease, text-decoration-color .16s ease;
}
a:hover, a:focus { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------------- header ---------------- */

.site-head { background: var(--ink); }

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 92px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--paper);
  text-decoration: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.22; }
.brand-name {
  font-family: var(--serif);
  font-size: var(--t-head);
  color: #fff;
  letter-spacing: -.005em;
}
.brand-tag {
  font-family: var(--sans);
  font-size: var(--t-small);
  color: var(--slate-3);
  margin-top: 4px;
}
.logo-mark { flex: 0 0 auto; }

.site-nav ul {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 1rem;
  color: #dfe5ea;
  padding: 0 14px;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
.site-nav a:hover { background: #2d343d; color: #fff; }
.site-nav a[aria-current="page"] { color: var(--accent-2); font-weight: 650; }

/* ---------------- home hero ---------------- */

.hero {
  background: var(--ink);
  color: var(--on-dark);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  grid-template-areas:
    "title title"
    "text  art";
  column-gap: 56px;
  row-gap: 34px;
  align-items: start;
  padding-top: 68px;
  padding-bottom: 76px;
}
.hero-title {
  grid-area: title;
  font-family: var(--serif);
  font-size: var(--t-display);
  line-height: 1.02;
  letter-spacing: -.028em;
  margin: 0;
  color: #fff;
  text-wrap: balance;
}
.hero-text { grid-area: text; align-self: center; }
.hero-text p { margin: 0 0 16px; max-width: 46ch; }
.hero-text p:last-child { margin-bottom: 0; }
.hero-text .lead {
  font-size: var(--t-sub);
  line-height: 1.5;
  color: #e7ebee;
}
.hero-art { grid-area: art; align-self: center; margin: 0; }
.art-hero { display: block; width: 100%; height: auto; }

/* ---------------- section heads ---------------- */

.section {
  padding-top: var(--gap-sec);
  padding-bottom: 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: var(--t-head);
  line-height: 1.2;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0;
}
.section-head .count {
  font-family: var(--sans);
  font-size: var(--t-small);
  color: var(--slate-2);
  margin: 0;
}

/* ---------------- metadata line ---------------- */

.meta {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: var(--t-small);
  color: var(--slate-2);
  margin: 0;
}
.meta .cat {
  color: var(--accent-ink);
  font-weight: 650;
}

/* ---------------- the lead guide ---------------- */

.feature {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  grid-template-areas: "body art";
  align-items: center;
  gap: 0;
  background: var(--surface);
  margin-bottom: var(--gap-blk);
}
.feature-art {
  grid-area: art;
  align-self: stretch;
  display: flex;
  align-items: center;
  background: var(--art);
}
.feature-art svg { width: 100%; height: auto; display: block; }
.feature-body { grid-area: body; padding: 40px 44px 42px; }
.feature-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.22rem, 2.05vw, 1.72rem);
  line-height: 1.17;
  letter-spacing: -.016em;
  margin: 0 0 14px;
}
.feature-body h3 a { color: var(--ink); text-decoration: none; }
.feature-body h3 a:hover { color: var(--accent); }
.feature-body .meta { margin-bottom: 20px; }
.feature-body p { margin: 0 0 18px; color: var(--slate); }
.feature-body .more { margin-bottom: 0; }

/* ---------------- the index of guides ---------------- */

.index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 40px;
}
.index > li {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 36px;
  align-items: start;
}
.index .item-art { display: block; }
.index .item-art svg { display: block; width: 100%; height: auto; }
.index h3 {
  font-family: var(--serif);
  font-size: var(--t-sub);
  line-height: 1.26;
  letter-spacing: -.008em;
  margin: 0 0 10px;
}
.index h3 a { color: var(--ink); text-decoration: none; }
.index h3 a:hover { color: var(--accent); }
.index p { margin: 0 0 14px; color: var(--slate); }
.index .meta { margin-top: 0; }

.more {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  color: var(--accent);
}

/* ---------------- how to use this site ---------------- */

.strip {
  background: var(--field);
  margin-top: var(--gap-sec);
  padding: 72px 0 76px;
}
.strip h2 {
  font-family: var(--serif);
  font-size: var(--t-head);
  line-height: 1.2;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 36px;
}
.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.strip h3 {
  font-family: var(--serif);
  font-size: var(--t-sub);
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--ink);
}
.strip p { margin: 0; color: var(--ink-2); }

/* ---------------- article page ---------------- */

.article-head {
  background: var(--surface);
  padding: 56px 0 48px;
}
.article-head .inner { max-width: var(--measure); margin: 0 auto; }
h1 {
  font-family: var(--serif);
  font-size: var(--t-title);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 20px;
  text-wrap: balance;
}
.standfirst {
  font-size: var(--t-sub);
  line-height: 1.5;
  color: var(--slate);
  margin: 0 0 26px;
  max-width: 58ch;
}

.article-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 52px var(--gutter) 16px;
}
.article-figure {
  max-width: 760px;
  margin: 44px auto 0;
  padding: 0 var(--gutter);
}
.article-figure svg { display: block; width: 100%; height: auto; }
.article-figure figcaption {
  font-family: var(--sans);
  font-size: var(--t-small);
  color: var(--slate-2);
  margin-top: 12px;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: var(--t-head);
  line-height: 1.24;
  margin: 2.2em 0 .55em;
  color: var(--ink);
  letter-spacing: -.012em;
}
.article-body h3 {
  font-family: var(--serif);
  font-size: var(--t-sub);
  font-weight: 650;
  margin: 1.9em 0 .45em;
  color: var(--ink);
}
.article-body p { margin: 0 0 1.15em; }
.article-body ul, .article-body ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.article-body li { margin-bottom: .55em; }
.article-body li::marker { color: var(--accent); }
.article-body strong { color: var(--ink); font-weight: 650; }

blockquote.pull {
  margin: 2em 0;
  padding: 0;
  font-size: 1.32rem;
  line-height: 1.42;
  color: var(--ink);
  font-style: normal;
  letter-spacing: -.008em;
  max-width: 24ch;
}
blockquote.pull p:last-child { margin-bottom: 0; }

.callout {
  background: var(--field);
  padding: 26px 30px;
  margin: 2em 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 650;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 10px;
}

.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-family: var(--sans);
  font-size: .95rem;
  font-variant-numeric: tabular-nums;
}
.spec caption {
  text-align: left;
  font-size: 1rem;
  color: var(--slate);
  padding-bottom: 12px;
}
.spec th, .spec td {
  border: 1px solid var(--line); /* taste-skill-ignore: real data table */
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
}
.spec thead th { background: var(--field); color: var(--ink); font-weight: 650; }
.spec tbody th { background: #f3f4f5; font-weight: 650; width: 28%; }

.checklist { list-style: none; padding-left: 0; }
.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: .7em;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .55em;
  width: 14px;
  height: 7px;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}

.article-foot {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 16px var(--gutter) 88px;
}
.article-foot .note {
  background: var(--field);
  padding: 24px 28px;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--slate);
  margin: 28px 0 0;
}

.next-up { margin-top: var(--gap-blk); }
.next-up h2 {
  font-family: var(--serif);
  font-size: var(--t-head);
  line-height: 1.2;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 0 0 22px;
}
.next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.next-list a {
  display: block;
  padding: 7px 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-sub);
  line-height: 1.3;
  text-decoration: none;
  max-width: 48ch;
}
.next-list a:hover { color: var(--accent); }

/* ---------------- plain pages ---------------- */

.doc {
  max-width: 68ch;
  margin: 0 auto;
  padding: 64px var(--gutter) 88px;
}
.doc h1 { margin-bottom: 12px; }
.doc .updated {
  font-family: var(--sans);
  font-size: var(--t-small);
  color: var(--slate-2);
  margin: 0 0 38px;
}
.doc h2 {
  font-family: var(--serif);
  font-size: var(--t-head);
  line-height: 1.24;
  letter-spacing: -.012em;
  margin: 2.1em 0 .5em;
  color: var(--ink);
}
.doc p { margin: 0 0 1.1em; }
.doc ul { padding-left: 1.3em; margin: 0 0 1.3em; }
.doc li { margin-bottom: .5em; }
.doc li::marker { color: var(--accent); }

.kv {
  list-style: none;
  padding: 26px 30px;
  margin: 0 0 1.8em;
  background: var(--surface);
  display: grid;
  gap: 18px;
}
.kv li {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 0;
}
.kv .k {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--slate-2);
  flex: 0 0 180px;
}
.kv .v { flex: 1 1 240px; }

/* ---------------- 404 ---------------- */

.err {
  max-width: 62ch;
  margin: 0 auto;
  padding: 88px var(--gutter) 96px;
}
.err .code {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--slate-2);
  margin: 0 0 14px;
}
.err > p { color: var(--slate); max-width: 52ch; }
.err ul {
  list-style: none;
  padding: 0;
  margin: 34px 0 0;
  display: grid;
  gap: 6px;
}
.err ul a {
  display: block;
  padding: 7px 0;
  font-family: var(--serif);
  font-size: var(--t-sub);
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}
.err ul a:hover { color: var(--accent); }

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

.site-foot {
  background: var(--ink);
  color: var(--on-dark);
  font-family: var(--sans);
  font-size: 1rem;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 44px;
  padding-top: 64px;
  padding-bottom: 52px;
}
.foot-col h2 {
  font-size: 1rem;
  font-weight: 650;
  color: var(--accent-2);
  margin: 0 0 16px;
}
.foot-brand {
  font-family: var(--serif);
  font-size: var(--t-head);
  color: #fff;
  margin: 0 0 14px;
}
.foot-col p { margin: 0 0 14px; line-height: 1.6; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 11px; line-height: 1.45; }
.foot-col a { color: var(--on-dark); text-decoration-color: rgba(195, 204, 212, .35); }
.foot-col a:hover { color: var(--accent-2); }
.foot-base {
  background: #15191e;
  padding-top: 26px;
  padding-bottom: 40px;
}
.foot-base p { margin: 0; font-size: var(--t-small); color: var(--slate-3); max-width: 70ch; }

/* ---------------- motion ---------------- */

@media (prefers-reduced-motion: no-preference) {
  @keyframes arrive {
    from { opacity: 0; transform: translateY(20px); }
  }
  /* content never depends on this finishing: opacity is only touched on the
     hero, whose animation always runs, never on scroll-linked elements. */
  .hero-title, .hero-text, .hero-art {
    animation: arrive .66s cubic-bezier(.16, 1, .3, 1) backwards;
  }
  .hero-title { animation-delay: .04s; }
  .hero-text  { animation-delay: .14s; }
  .hero-art   { animation-delay: .24s; }

  @keyframes settle {
    from { transform: translateY(26px); }
    to   { transform: none; }
  }
  @supports (animation-timeline: view()) {
    .section-head, .feature, .index > li, .strip h2, .strip-grid > *,
    .article-figure, .next-list li, .callout, .err ul li, .foot-col,
    .article-body h2, .article-body .spec, .article-body blockquote.pull,
    .article-foot .note {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }

  .index > li .item-art svg,
  .feature-art svg { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
  .index > li:hover .item-art svg { transform: scale(1.015); }
}

/* ---------------- responsive ---------------- */

@media (max-width: 1000px) {
  :root { --gap-sec: 84px; }
  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "text" "art";
    row-gap: 30px;
    padding-top: 54px;
    padding-bottom: 60px;
  }
  .hero-text p { max-width: 58ch; }
  .feature { grid-template-columns: 1fr; grid-template-areas: "art" "body"; }
  .feature-art svg { height: auto; }
  .index > li { grid-template-columns: 240px 1fr; gap: 28px; }
  .strip-grid { grid-template-columns: 1fr; gap: 34px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --gap-sec: 64px;
    --gap-blk: 36px;
    --t-head: 1.42rem;
    --t-sub: 1.12rem;
  }
  body { font-size: 17px; }

  .head-row { min-height: 0; padding-top: 16px; padding-bottom: 12px; gap: 14px; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 6px; margin-left: -14px; }

  .hero-grid { padding-top: 40px; padding-bottom: 48px; row-gap: 26px; }
  .hero-title { line-height: 1.06; letter-spacing: -.022em; }

  .section-head { margin-bottom: 26px; gap: 8px; }
  .feature-body { padding: 26px 22px 28px; }

  .index { gap: 34px; }
  .index > li { grid-template-columns: 1fr; gap: 16px; }

  .strip { padding: 52px 0 56px; }
  .strip h2 { margin-bottom: 26px; }

  .article-head { padding: 36px 0 32px; }
  .article-body { padding-top: 34px; padding-bottom: 8px; }
  .article-figure { margin-top: 30px; }
  .article-foot { padding-bottom: 64px; }
  .article-foot .note { padding: 20px 22px; }
  .callout { padding: 22px 22px; }
  blockquote.pull { max-width: none; font-size: 1.22rem; }

  .doc { padding-top: 42px; padding-bottom: 60px; }
  .kv { padding: 22px 22px; }
  .kv .k { flex: 1 1 100%; }

  .spec { display: block; overflow-x: auto; font-size: .9rem; }
  .spec th, .spec td { padding: 9px 10px; }
  .spec tbody th { width: auto; }

  .err { padding-top: 56px; padding-bottom: 72px; }

  .foot-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; padding-bottom: 36px; }
  .foot-base { padding-top: 22px; padding-bottom: 32px; }
}
