/* ievgen-gartman.com base stylesheet
 *
 * Tokens are fixed in docs/00-context.md. Do not invent values here.
 *
 * NOTE ON NAMING: bd-site's site.css calls white "--black" and navy "--white"
 * (a light theme retrofitted onto dark-theme names). Their own docs list it as
 * trap #1. These names are honest and must stay that way.
 */

:root {
  /* Colour */
  --ink: #102c39;         /* primary text, headings, dark fills */
  --ink-muted: #6d8e9e;   /* secondary text, borders, supporting elements */
  --accent: #f69220;      /* CTAs and emphasis ONLY, never a large fill */
  --surface: #ffffff;     /* page background */
  --surface-alt: #f3f6f8; /* alternating section background */
  --border: #e5e7eb;      /* hairlines, dividers */

  /* Type */
  --font-sans: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --container: 1200px;
  --reading: 64ch;   /* Target measure. NOTE: 1ch is the width of the "0" glyph,
                        which is wider than an average letter, so 64ch renders
                        at roughly 68-70 real characters. That lands mid-range
                        of the 45-75 readable band. Expressed in ch, not px, so
                        it self-corrects if the body size ever changes. */

  /* Rhythm */
  --section-y: 96px;
  --section-x: 6vw;
}

@media (max-width: 720px) {
  :root {
    --section-y: 64px;
    --section-x: 5vw;
  }
}

/* --- reset ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img,
svg { max-width: 100%; height: auto; display: block; }

/* --- type ----------------------------------------------------------------- */

h1, h2, h3 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Deliberately quieter than bd-site's clamp(60px, 9.5vw, 110px).
 * An agency shouts. A person does not. */
h1 { font-size: clamp(40px, 5.5vw, 64px); }
h2 { font-size: clamp(30px, 4vw, 42px); }
h3 { font-size: clamp(21px, 2.2vw, 26px); }

p { margin: 0 0 1.2em; }

a {
  color: var(--ink);
  text-decoration-color: var(--ink-muted);
  text-underline-offset: 3px;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 12px;
}

.lede { font-size: clamp(19px, 2vw, 22px); color: var(--ink); }

.muted { color: var(--ink-muted); }

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

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

.reading { max-width: var(--reading); }

section { padding: var(--section-y) var(--section-x); }

section.alt { background: var(--surface-alt); }

/* --- hero with portrait ---------------------------------------------------- */

/* The portrait lives INSIDE .hero-body, before the paragraphs. That single
 * decision drives both layouts:
 *   mobile  - normal block flow, so the order is title, photo, text
 *   desktop - float:right, so the copy wraps around the photo and then
 *             continues full width underneath it
 * No `order` property is used, so DOM order and reading order stay identical
 * for screen readers and keyboard users.
 */

.hero-grid {
  max-width: var(--reading);   /* same column width as every other section */
  margin: 0 auto;
}

.hero-head { max-width: var(--reading); }
.hero-head h1 { margin-bottom: 0.4em; }

.hero-portrait {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 28px;      /* img is display:block from the reset, so this centres it */
  border-radius: 8px;
  border: 1px solid var(--border);
}

@media (min-width: 861px) {
  /* The hero sits in the same 720px column as every other section, so the page
   * has one consistent measure. The photo is sized down to match: at 260px it
   * leaves roughly 420px of wrapped text beside it, which still reads well. */
  .hero-head { max-width: none; }

  .hero-portrait {
    float: right;
    width: 260px;
    max-width: 38%;
    margin: 6px 0 20px 36px;
  }

  /* Contain the float so the next section cannot ride up beside the photo. */
  .hero-body::after {
    content: "";
    display: block;
    clear: both;
  }
}

/* --- nav ------------------------------------------------------------------ */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--section-x);
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 16px;
  color: var(--ink-muted);
}

.nav-links a:hover { color: var(--ink); }

.nav-cta {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--surface);
  white-space: nowrap;
}

.nav-cta:hover { filter: brightness(0.94); }

/* Checkbox-hack mobile menu. No JS, same approach as bd-site. */
.nav-toggle,
.nav-toggle-label { display: none; }

@media (max-width: 720px) {
  .nav-toggle-label {
    display: block;
    cursor: pointer;
    width: 26px;
  }
  .nav-toggle-label span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--ink);
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px var(--section-x) 16px;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links li { padding: 10px 0; }
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 48px var(--section-x);
  color: var(--ink-muted);
  font-size: 15px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: baseline;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

.footer-links a { text-decoration: none; color: var(--ink-muted); }
.footer-links a:hover { color: var(--ink); }

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--surface);
}

.btn:hover { filter: brightness(0.94); }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-quiet:hover { border-color: var(--ink-muted); filter: none; }

/* --- accessibility -------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  z-index: 100;
}

.skip-link:focus { left: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
