/* borrowmy.tools home page. No scripts, no external requests: fonts are self-hosted (SIL OFL). */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/jost-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Nothing You Could Do";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/nothing-you-could-do-latin-400-normal.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --bg: #f7f6f3;
  --ink: #111318;        /* headings, wordmark */
  --body: #22252c;       /* paragraph text */
  --muted: #474c57;      /* stage descriptions: 7.9:1 on --bg */
  --accent: #1d3ec0;     /* the one blue: 7.3:1 on --bg */
  --accent-hover: #15309a;
  --on-accent: #ffffff;
  --rule: #c5cbdb;       /* hairlines, faintly blue */
  --rule-strong: #8d98b8;
  --pill-bg: #e3e7f4;
  --circle-bg: var(--bg);
  --focus: #1d3ec0;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --script: "Nothing You Could Do", "Segoe Script", cursive;

  --gutter: clamp(1rem, 4.5vw, 4.5rem);
  --max: 100rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015;
    --ink: #f2f1ec;
    --body: #d9d8d2;
    --muted: #a9aebb;
    --accent: #8fa6ff;
    --accent-hover: #b3c2ff;
    --on-accent: #0e1015;
    --rule: #2a3142;
    --rule-strong: #4a5675;
    --pill-bg: #1a2135;
    --focus: #b3c2ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1015;
  --ink: #f2f1ec;
  --body: #d9d8d2;
  --muted: #a9aebb;
  --accent: #8fa6ff;
  --accent-hover: #b3c2ff;
  --on-accent: #0e1015;
  --rule: #2a3142;
  --rule-strong: #4a5675;
  --pill-bg: #1a2135;
  --focus: #b3c2ff;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 2.6vw, 2rem) 0 clamp(1.1rem, 2.4vw, 1.9rem);
  border-bottom: 1px solid var(--rule-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
  padding-left: clamp(0rem, 3vw, 2.75rem);
}

.monogram {
  width: auto;
  height: clamp(2.1rem, 4.4vw, 4rem);
  flex: none;
}
.monogram-b { fill: var(--ink); }
.monogram-dot { fill: var(--accent); }

.brand-rule {
  width: 1px;
  align-self: stretch;
  margin: 0.15rem 0;
  background: var(--rule-strong);
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3vw, 2.75rem);
  font-weight: 460;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark em {
  color: var(--accent);
  font-style: italic;
  font-weight: 460;
}

.invitation-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  flex: none;
  padding: 0.75em 1.5em;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(0.72rem, 1.2vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1;
}
.invitation-pill .pill-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Main ---------- */

.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 8vw, 4rem);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 62rem) {
  .headline { font-size: clamp(4.25rem, 0.4rem + 5.9vw, 7.4rem); }
  .main {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 0;
    align-items: start;
  }
  .intro {
    padding-right: clamp(2rem, 4vw, 4rem);
    padding-left: clamp(0rem, 3vw, 2.75rem);
  }
  .toolbox {
    border-left: 1px solid var(--rule);
    padding-left: clamp(2rem, 3.2vw, 3rem);
    margin-top: 0.75rem;
    padding-top: 0;
  }
}

/* ---------- Intro ---------- */

.headline {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 12.8vw - 0.1rem, 6rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.headline-line { display: block; }
.headline-accent {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-style: italic;
  font-weight: 480;
  letter-spacing: -0.045em;
  padding-bottom: 0.2em;
  margin-left: -0.04em;
  white-space: nowrap;
}
.swoosh {
  position: absolute;
  left: 40%;
  bottom: -0.02em;
  width: 56%;
  height: 0.2em;
  overflow: visible;
}
.swoosh path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.signature {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(1.25rem, 2.6vw, 2rem);
  color: var(--accent);
  font-family: var(--script);
  font-size: clamp(1.35rem, 1rem + 1vw, 1.85rem);
  line-height: 1.2;
}
.signature-tick {
  position: relative;
  width: 2.25rem;
  height: 1px;
  flex: none;
  background: var(--rule-strong);
}
.signature-tick::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: -0.55rem;
  width: 1px;
  height: 1.1rem;
  background: var(--rule-strong);
}

.lede {
  max-width: 31em;
  margin-top: clamp(1.75rem, 3.4vw, 2.75rem);
  color: var(--body);
  font-size: clamp(1.2rem, 0.95rem + 0.9vw, 1.75rem);
  line-height: 1.34;
  font-weight: 400;
  text-wrap: pretty;
}

.cta-row { margin-top: clamp(2rem, 3.6vw, 2.75rem); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  min-height: 44px;
  padding: 0.62em 1.6em 0.68em;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.85rem);
  font-weight: 450;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color 160ms ease;
}
.cta:hover { background: var(--accent-hover); }
.cta-arrow {
  width: 0.85em;
  height: 0.85em;
  flex: none;
}
.cta-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aside {
  margin-top: 1.25rem;
  color: var(--body);
  font-style: italic;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.4rem);
  padding-left: 0.15em;
}

/* ---------- Toolbox ---------- */

.toolbox {
  --num: 3.1rem;              /* circle diameter */
  --num-gap: clamp(1rem, 2vw, 1.75rem);
  --rail: 0.55rem;            /* inset of the numbers from the bracket */
  position: relative;
  max-width: 46rem;
}

.toolbox-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.55rem 0 0 calc(var(--rail) + var(--num) / 2 + 0.1rem);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(0.85rem, 0.7rem + 0.4vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  line-height: 1;
}
/* corner bracket, top left */
.toolbox-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.6rem;
  width: 1.1rem;
  height: 1.1rem;
  border-left: 1.5px solid var(--rule-strong);
  border-top: 1.5px solid var(--rule-strong);
}
/* rule running right, then a bracket hanging below its end */
.toolbox-title::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-right: 1.9rem;
  background: var(--rule-strong);
}
.toolbox::after {
  content: "";
  position: absolute;
  top: 0.95rem;
  right: 0;
  width: 1.1rem;
  height: 1rem;
  border-right: 1.5px solid var(--rule-strong);
  border-bottom: 1.5px solid var(--rule-strong);
}

.stages {
  position: relative;
  margin-top: 1.4rem;
  padding-left: var(--rail);
}
/* the line that threads the numbers */
.stages::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) + var(--num) / 2 - 0.5px);
  top: -1.1rem;
  bottom: -2.3rem;
  width: 1px;
  background: var(--rule-strong);
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: var(--num) minmax(0, 1fr);
  grid-template-areas:
    "num name"
    ".   text";
  column-gap: var(--num-gap);
  row-gap: 0.35rem;
  align-items: center;
  padding: 1.35rem 0;
}
.stage + .stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--num) + var(--num-gap));
  right: 0;
  height: 1px;
  background: var(--rule);
}

.stage-number {
  grid-area: num;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--num);
  height: var(--num);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.stage-name {
  grid-area: name;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 520;
  font-size: clamp(1.9rem, 1.3rem + 1.5vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stage-text {
  grid-area: text;
  max-width: 17em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.4;
}

@media (min-width: 36rem) {
  .stage {
    grid-template-columns: var(--num) minmax(max-content, 1fr) minmax(0, 14rem);
    grid-template-areas: "num name text";
  }
}

.iterate {
  margin-top: 0.4rem;
  padding-left: 0.1rem;
}
.iterate-art {
  display: block;
  width: min(19rem, 70%);
  height: auto;
  overflow: visible;
}
.iterate-corner,
.iterate-arc,
.iterate-head {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.iterate-corner { stroke: var(--rule-strong); stroke-width: 1.5; }
.iterate-arc,
.iterate-head { stroke: var(--accent); stroke-width: 1.6; }
.iterate-guide { fill: none; stroke: none; }
.iterate-text {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.6em;
}

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

.footer {
  padding: 1.4rem 0 1.75rem;
  border-top: 1px solid var(--rule-strong);
  color: var(--body);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.15rem);
}
.footer a {
  display: inline-block;
  padding: 0.6rem 0;
  font-weight: 600;
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.footer-sep { margin: 0 0.6em; color: var(--accent); }

/* ---------- Small screens ---------- */

@media (max-width: 30rem) {
  .brand-rule { display: none; }
  .invitation-pill { padding: 0.7em 1em; letter-spacing: 0.2em; }
  .invitation-pill .pill-dot { display: none; }
}
@media (max-width: 22rem) {
  .wordmark { font-size: 1.15rem; }
  .invitation-pill { font-size: 0.62rem; padding: 0.65em 0.8em; letter-spacing: 0.14em; }
  .brand { gap: 0.5rem; }
  .footer-sep { display: none; }
  .footer p { display: flex; flex-direction: column; align-items: flex-start; }
  .monogram { height: 1.8rem; }
}

/* ---------- Motion: one gentle fade, only when welcome ---------- */

@media (prefers-reduced-motion: no-preference) {
  .main { animation: fade-in 700ms ease-out both; }
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}
