/* bermana.net shared stylesheet.
   Everything here is identical on every page: design tokens, the frame, the
   top bar and navigation, the section and heading scale, the dark contact
   footer and the reveal-on-scroll states. Anything a single page needs stays
   in that page's own <style> block, which is loaded after this file.
   Edit a token here and it changes on all five pages at once. */

:root{
  --bg:#FBFAF8;
  --ink:#141312;
  --muted:#75726c;
  --line:#1a1917;
  --hair:#dcd9d1;
  --red:#E2231A;         /* the one red, everywhere */
  --red-text:#E2231A;    /* kept as a name so small red text can be tuned later */
  --red-on-dark:#E2231A; /* same, for the dark blocks */
  --dark:#141312;
  --dline:#34302b;
  --dtext:#f4f1ec;
  --text:#2f2d2a;        /* body copy: a touch darker than it was */
  --pad:clamp(20px,4vw,64px);

  /* Type scale. Six steps instead of sixteen ad-hoc sizes. */
  --t-xs:11.5px;         /* small mono: footer line, fine print */
  --t-sm:12.5px;         /* mono labels, navigation, meta */
  --t-md:15px;           /* secondary copy inside cards and grids */
  --t-base:18px;         /* body copy */
  --t-lg:20px;           /* card headings and footer links */
  --h:clamp(24px,2.9vw,33px);  /* section headings and statements */

  /* Spacing scale. Every margin, padding and gap snaps to one of these. */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px;
  --s6:24px; --s7:32px; --s8:40px; --s9:48px; --s10:56px;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;overflow-x:hidden}
body{background:var(--bg);color:var(--ink);font-family:'Archivo',sans-serif;font-size:var(--t-base);line-height:1.65;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
.frame{max-width:1480px;margin:0 auto;border-left:1px solid var(--line);border-right:1px solid var(--line)}
.dot,.r{color:var(--red)}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:var(--s4) var(--pad);border-bottom:1px solid var(--line)}
.wordmark{display:inline-flex;align-items:center;font-family:'IBM Plex Mono',monospace;font-weight:600;font-size:var(--t-sm);letter-spacing:.12em;text-transform:uppercase}
/* The mark that already serves as the site's icon, set beside the wordmark. */
.wordmark img{width:42px;height:42px;display:block;flex:none;margin-right:var(--s3)}
.wordmark .wm{line-height:1.35}
.wordmark .r{color:var(--red-text)}
.nav{display:flex;gap:var(--s5);font-family:'IBM Plex Mono',monospace;font-size:var(--t-sm);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.nav a{position:relative;padding-bottom:5px;white-space:nowrap}
/* The red rule is already the link idiom here; in the nav it draws itself in
   on hover and stays put on the page you are on. */
.nav a::after{content:"";position:absolute;left:0;bottom:0;width:0;height:1.5px;background:var(--red);transition:width .25s ease}
.nav a:hover{color:var(--ink)}
.nav a:hover::after,.nav a:focus-visible::after{width:100%}
.nav a.current::after{width:100%}
.nav a.current,.nav a.current:hover{color:var(--red-text)}
.contact .links a.current,.contact .links a.current:hover{color:var(--red-on-dark)}
.inline-link{color:var(--ink);border-bottom:1.5px solid var(--red);padding-bottom:2px}
/* Four items sit beside the mark down to a narrow window; below that the bar
   stacks into two rows. */
@media(max-width:600px){
  .topbar{flex-direction:column;align-items:flex-start;gap:var(--s3)}
  .nav{flex-wrap:wrap;gap:var(--s3) var(--s4);font-size:var(--t-xs);letter-spacing:.05em}
}
.tagline{font-family:'IBM Plex Mono',monospace;font-size:clamp(13px,1.4vw,15px);letter-spacing:.04em;color:var(--red-text);margin-bottom:var(--s6);text-transform:uppercase}
.stmt{font-weight:700;font-size:var(--h);line-height:1.2;letter-spacing:-.015em}

/* Typesetting. Balance a heading so it never ends on one hanging word, and
   keep a paragraph from finishing on an orphan. Browsers that do not know
   these values simply wrap the way they did before. */
h1,h2,h3,.stmt,.contact .open{text-wrap:balance}
p,.body,.lede{text-wrap:pretty}
.sec{padding:var(--pad);border-bottom:1px solid var(--line)}
.label{display:flex;align-items:center;gap:var(--s3);font-family:'IBM Plex Mono',monospace;font-size:var(--t-sm);letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:var(--s7)}
/* The number sits in a ring of its own: a quiet badge, not a headline. */
.label .num{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;flex:none;border:1.5px solid var(--red-text);border-radius:50%;color:var(--red-text);font-size:11.5px;letter-spacing:0;font-weight:600;margin-right:0}
.body{color:var(--text);max-width:62ch}
.body p + p{margin-top:var(--s4)}
.body.tight{margin-top:var(--s5)}

/* Paragraph blocks follow exactly the breakpoints the card grids use, so a
   section never shows its text in one rhythm and its cards in another:
   three columns above 860, two down to 769, one column below that. Below 769
   everything stacks, as it always did. */
@media(min-width:769px){
  .cols,.cols-g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 var(--s9);max-width:none}
  .cols > *,.cols-g > *{max-width:none}
  .cols p + p,.cols-g p + p{margin-top:0}
  .flow{column-count:2;column-gap:var(--s9);max-width:none}
  .flow p{break-inside:avoid}
  .flow p + p{margin-top:var(--s4)}
}
@media(min-width:861px){
  .cols-g{grid-template-columns:repeat(3,minmax(0,1fr))}
  .flow{column-count:3}
}

/* contact */
.contact{background:var(--dark);color:var(--dtext);padding:clamp(var(--s10),8vw,var(--s10)) var(--pad)}
.contact .open{font-weight:700;font-size:var(--h);line-height:1.25;letter-spacing:-.015em;max-width:30ch}
.contact .open .r{color:var(--red)}
.contact .loc{margin-top:var(--s6);font-family:'IBM Plex Mono',monospace;font-size:var(--t-sm);letter-spacing:.1em;text-transform:uppercase;color:#9b9790}
.contact .links{margin-top:var(--s8);display:flex;flex-wrap:wrap;gap:var(--s4) var(--s8);font-size:var(--t-lg)}
.contact .links a{border-bottom:1.5px solid var(--red);padding-bottom:4px}
.contact .foot{margin-top:var(--s10);font-family:'IBM Plex Mono',monospace;font-size:var(--t-xs);letter-spacing:.1em;text-transform:uppercase;color:#8a867f}
/* Reveal on scroll is an enhancement, never a precondition for reading.
   The <head> script marks the page as scripted; without it .rv never hides,
   so a failed or blocked script leaves the content plainly visible. */
.js .rv{opacity:0;transform:translateY(20px);transition:opacity .7s ease,transform .7s ease}
.js .rv.in{opacity:1;transform:none}

/* A red rule across the top that fills as you read. Only ever drawn where the
   browser can drive an animation from the scroll position; everywhere else the
   element stays empty and nothing depends on it. */
@supports (animation-timeline: scroll()){
  .progress{position:fixed;top:0;left:0;right:0;height:2px;background:var(--red);transform:scaleX(0);transform-origin:0 50%;z-index:9;pointer-events:none;
    animation:progress linear;animation-timeline:scroll(root)}
  @keyframes progress{to{transform:scaleX(1)}}
}

/* Moving between pages is a crossfade rather than a blink, where supported. */
@view-transition{navigation:auto}

/* Keyboard users need to see where they are. */
:focus-visible{outline:2px solid var(--red);outline-offset:3px}
.contact :focus-visible{outline-color:var(--dtext)}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .js .rv,.js .rv.in{opacity:1;transform:none;transition:none}
  .nav a::after,.skill::before{transition:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important}
  .progress{display:none}
}
