/* Shared by every page: toolbar and footer. Every rule is class-scoped so it
   sits beside Asciidoctor's stylesheet on the book pages without touching it. */
.sf-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(0.9rem, 3vw, 1.6rem);
  box-sizing: border-box;
  background: rgba(251, 250, 246, 0.94);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid #e3ddcf;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}
.sf-toolbar * { box-sizing: border-box; }
.sf-brand {
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #A01E28;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-links {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1.25rem);
  font-size: 0.9rem;
}
.sf-links a { color: #1c2b31; text-decoration: none; white-space: nowrap; }
.sf-links a:hover { color: #A01E28; }
.sf-links a.sf-dl { color: #556368; font-variant: small-caps; letter-spacing: 0.03em; }
.sf-links a.sf-dl:hover { color: #1B5464; }

/* "By chapter / One page" on reader pages. */
.sf-view {
  display: inline-flex;
  border: 1px solid #d9d2c1;
  border-radius: 5px;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: nowrap;
}
.sf-view a, .sf-view span { padding: 0.25rem 0.6rem; }
.sf-view span { background: #ece6d8; color: #1c2b31; font-weight: 600; }
.sf-view a:hover { background: #f3eee2; }

.sf-footer {
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1.5rem clamp(1.1rem, 5vw, 2.5rem) 3rem;
  color: #556368;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  border-top: 1px solid #e3ddcf;
}
.sf-footer p { margin: 0 0 0.4rem; font: inherit; color: inherit; }
.sf-footer a { color: #1B5464; }
.sf-footer-links a { text-decoration: none; }
.sf-footer-links a:hover { text-decoration: underline; }
.sf-footer-links { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; }

@media (max-width: 720px) {
  .sf-brand { font-size: 0.82rem; }
  .sf-links { font-size: 0.82rem; }
}
@media (max-width: 600px) {
  .sf-links a.sf-dl { display: none; }
}

/* A link to an anchor stops below the fixed toolbar. */
[id] { scroll-margin-top: 68px; }

/* scalafoundations.com: the landing page, the contents page and the small
   pages. The toolbar and footer are in chrome.css; chapters use book.css. */

:root {
  --crimson: #A01E28;
  --navy: #12333F;
  --teal: #1B5464;
  --ink: #1c2b31;
  --paper: #fbfaf6;
  --muted: #556368;
  --line: #e3ddcf;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--crimson); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

.sf-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(52px + 3rem) clamp(1.1rem, 5vw, 2.5rem) 4rem;
}

.sf-footer { max-width: var(--maxw); }

.sf-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sf-eyebrow a { color: inherit; text-decoration: none; }
.sf-eyebrow a:hover { color: var(--crimson); }

/* --- Landing hero ---------------------------------------------------- */

.sf-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: start;
}

.sf-cover {
  display: block;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(18, 51, 63, 0.22), 0 2px 6px rgba(18, 51, 63, 0.12);
}
.sf-cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; }

.sf-pitch h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.7rem, 4.4vw, 2.55rem);
  line-height: 1.12;
}

.sf-byline { margin: 0 0 1.4rem; color: var(--muted); font-size: 1rem; }
.sf-byline a { color: inherit; }

.sf-lede { font-size: 1.12rem; color: #2a3a40; margin: 0 0 1.8rem; }

.sf-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  margin-bottom: 1.4rem;
}

.sf-start {
  display: inline-block;
  background: var(--crimson);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
}
.sf-start:hover { background: #8a1922; }

.sf-formats { font-size: 0.95rem; color: var(--muted); }
.sf-formats a { color: var(--teal); }

.sf-meta {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.sf-meta p { margin: 0 0 0.7rem; }

/* --- Landing sections ------------------------------------------------ */

.sf-section {
  margin-top: 3.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}
.sf-section > h2 { margin: 0 0 1.4rem; font-size: clamp(1.35rem, 3vw, 1.7rem); }

.sf-parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.8rem 2.5rem;
}
.sf-part h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.sf-part p { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.95rem; }
.sf-part ol, .sf-part ul { margin: 0; padding: 0; list-style: none; }
.sf-part li { margin: 0.2rem 0; }
.sf-part li a { color: var(--ink); text-decoration: none; }
.sf-part li a:hover { color: var(--crimson); text-decoration: underline; }
.sf-more { margin: 1.6rem 0 0; }

.sf-faq {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem 2.5rem;
}
.sf-faq h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.sf-faq p { margin: 0; color: #2a3a40; }

.sf-author { display: flex; gap: 1.4rem; align-items: center; }
.sf-author img { width: 96px; height: 96px; border-radius: 50%; flex: none; }
.sf-author p { margin: 0; }

/* --- Contents page --------------------------------------------------- */

.sf-contents { max-width: 50rem; }
.sf-contents h1 { margin: 0 0 1rem; font-size: clamp(1.7rem, 4.4vw, 2.4rem); }
.sf-contents .sf-intro { font-size: 1.08rem; margin: 0 0 1.4rem; }
.sf-contents section { margin-top: 2.6rem; }
.sf-contents section > h2 {
  margin: 0 0 0.3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
}
.sf-contents .sf-blurb { margin: 0 0 1.2rem; color: var(--muted); }
.sf-chapters { list-style: none; margin: 0; padding: 0; }
.sf-chapters > li { margin: 0 0 1.5rem; }
.sf-chapters h2, .sf-chapters h3 { margin: 0 0 0.2rem; font-size: 1.12rem; }
.sf-chapters h2 a, .sf-chapters h3 a { text-decoration: none; }
.sf-chapters h2 a:hover, .sf-chapters h3 a:hover { text-decoration: underline; }
.sf-sections { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.9rem; }
.sf-sections li { display: inline; }
.sf-sections li:not(:last-child)::after { content: "\00b7"; margin: 0 0.45em; }
.sf-sections a { display: inline-block; padding: 0.3rem 0; color: var(--muted); text-decoration: none; }
.sf-sections a:hover { color: var(--crimson); text-decoration: underline; }
.sf-sections code { font-size: 0.95em; }

/* --- Prose pages (about, not found) ---------------------------------- */

.sf-prose { max-width: 42rem; }
.sf-prose h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 1rem; }
.sf-prose p { margin: 0 0 1.1rem; }

.sf-author-photo {
  float: right;
  width: 220px;
  max-width: 40%;
  height: auto;
  margin: 0.3rem 0 1rem 1.6rem;
  border-radius: 6px;
}

@media (max-width: 720px) {
  .sf-hero { grid-template-columns: 1fr; }
  .sf-cover { max-width: 320px; margin: 0 auto; }
  .sf-author { align-items: flex-start; }
}
