/* Minimal editorial design system, shared across bold-lab.ai — one accent
   hue doing all the work (BOLD's own blue, deepened for reading), EB
   Garamond for anything meant to be read, Cabin for nav/UI chrome, no
   border-radius, no filled badges or button blocks, hairline rules.
   Adapted from inherentlabs.ai's visual language (cream ground, single
   muted accent, serif body, sans chrome, underlined links over buttons). */
:root{
  --ink:#1a2b4a;
  --ink-soft:#33445f;
  --muted:#7d8698;
  --paper:#f5f3ee;
  --surface:#ffffff;
  --wash:#ece9e1;
  --line:rgba(26,43,74,0.16);
  --accent:#1a2b4a;
  --radius:2px;
  --content-max:900px;
  --article-max:640px;
  --gutter:clamp(20px, 4vw, 48px);
  --chrome-pad:16px; /* shared inset: masthead left/right padding = sidebar-inner left/right padding */
  --serif:'EB Garamond', Georgia, 'Times New Roman', serif;
  --sans:'Cabin', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink-soft);
  font-family:var(--serif);
  font-size:18px;
  line-height:1.7;
  font-synthesis:none;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{color:var(--accent); text-decoration:underline; text-decoration-color:rgba(26,43,74,.32); text-underline-offset:3px; transition:text-decoration-color .15s;}
a:hover{text-decoration-color:currentColor;}
a:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}

h1,h2,h3{font-family:var(--serif); color:var(--ink); font-weight:800; letter-spacing:-0.005em; margin:0;}

/* ---------- masthead ---------- */
.masthead{
  background:var(--paper);
  border-bottom:1px solid var(--line);
  padding:18px var(--chrome-pad);
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.wordmark{font-family:var(--sans); font-weight:500; font-size:17px; letter-spacing:-0.01em; color:var(--ink); text-decoration:none;}
.wordmark strong{font-weight:700;}
.wordmark span{color:var(--accent); opacity:.55;}
.masthead-sub{font-family:var(--sans); font-size:11px; font-weight:400; letter-spacing:0.16em; text-transform:uppercase; color:var(--muted); opacity:.7;}


footer{
  /* Full-width rule that meets the sidebar edge; the side padding recreates the
     old centred --content-max column so the text doesn't move. */
  margin:72px 0 0; padding:40px max(var(--gutter), calc((100% - var(--content-max)) / 2 + var(--gutter))) 64px;
  border-top:1px solid var(--line); font-size:14px; color:var(--muted); font-family:var(--sans);
}

/* ---------- site nav ---------- */
.shell{display:flex; align-items:stretch;}
.sidebar{
  flex:0 0 200px; width:200px; box-sizing:border-box;
  border-right:1px solid var(--line); background:var(--paper);
  transition:flex-basis .22s ease, width .22s ease;
}
.sidebar-inner{
  position:sticky; top:0; padding:22px var(--chrome-pad);
  max-height:100vh; overflow-y:auto;
  transition:padding .22s ease;
}
.sidebar-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:0 0 16px; margin-bottom:10px; border-bottom:1px solid var(--line);
}
.sidebar-title{font-family:var(--sans); font-size:11px; font-weight:400; text-transform:uppercase; letter-spacing:0.16em; color:var(--muted); opacity:.7;}
.sidebar-collapse{
  font-family:inherit; background:none; border:1px solid var(--line);
  width:22px; height:22px; color:var(--muted); cursor:pointer; font-size:12px; line-height:1; flex:none;
}
.sidebar-collapse:hover{border-color:var(--accent); color:var(--accent);}
.nav-group{margin:18px 0;}
.nav-group:first-child{margin-top:0;}
.nav-group-label{
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  font-family:var(--sans); font-size:13px; font-weight:600;
  color:var(--ink); padding:4px 0; margin-bottom:2px; text-decoration:none;
}
.nav-group-label:hover{color:var(--accent);}
.nav-group-label.active{color:var(--accent);}
/* Chevron hints that a group has hidden sub-links: points right while
   collapsed, rotates to point down on hover/focus, in step with the
   sub-links expanding below it. */
.nav-group-label::after{
  content:'';
  width:8px; height:1.5px; flex:none;
  background:currentColor;
  opacity:.4;
  transition:width .22s ease, opacity .18s ease;
}
.nav-group:hover .nav-group-label::after,
.nav-group:focus-within .nav-group-label::after{
  width:14px; opacity:.75;
}
.nav-link{
  display:block; font-family:var(--sans); font-size:13px; font-weight:400; color:var(--ink-soft);
  text-decoration:none; padding:4px 0; white-space:nowrap;
}
.nav-link:hover{color:var(--accent);}
.nav-link.active{color:var(--accent); font-weight:600;}
/* Sub-links collapse to nothing by default (padding included, so a group's
   gap to the next doesn't depend on how many hidden links it has) and expand on hover/focus
   of their group, except the current page's own link, which stays
   visible so the sidebar always shows where you are without hovering. */
.nav-link.nav-sub{
  font-weight:400; font-size:12.5px; padding:0 0 0 12px; color:var(--muted);
  max-height:0; opacity:0; overflow:hidden; pointer-events:none;
  transition:max-height .22s ease, opacity .18s ease, padding .22s ease;
}
.nav-group:hover .nav-link.nav-sub,
.nav-group:focus-within .nav-link.nav-sub,
.nav-group:has(.active) .nav-link.nav-sub,
.nav-link.nav-sub.active{
  max-height:32px; opacity:1; pointer-events:auto; padding-top:4px; padding-bottom:4px;
}
.nav-link.nav-sub:hover, .nav-link.nav-sub.active{color:var(--accent);}
.nav-toggle:focus-visible, .sidebar-collapse:focus-visible, .nav-link:focus-visible, .nav-group-label:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px;
}

.shell-main{flex:1 1 auto; min-width:0;}

.masthead-left{display:flex; align-items:center; gap:10px;}
.masthead-brand{display:flex; align-items:baseline; gap:10px;}
.nav-toggle{
  display:none; font-family:inherit; background:none; border:1px solid var(--line);
  width:32px; height:32px; align-items:center; justify-content:center; cursor:pointer; color:var(--ink);
  position:relative; flex:none;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after{
  position:absolute; left:9px; width:16px; height:1.5px; background:currentColor; content:'';
}
.nav-toggle span::before{top:-5px;}
.nav-toggle span::after{top:5px;}

.sidebar-backdrop{display:none;}

.shell.is-collapsed .sidebar{flex-basis:40px; width:40px;}
.shell.is-collapsed .sidebar-inner{padding:22px 8px;}
.shell.is-collapsed .sidebar-title, .shell.is-collapsed .nav-groups{display:none;}
.shell.is-collapsed .sidebar-head{justify-content:center; border-bottom:none; padding-bottom:0;}

@media (max-width:820px){
  .nav-toggle{display:inline-flex;}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; z-index:200;
    height:100%; width:240px; flex-basis:240px;
    transform:translateX(-100%); transition:transform 0.2s ease;
    box-shadow:0 14px 44px rgba(26,43,74,.18);
  }
  .sidebar-inner{height:100%; max-height:none; overflow-y:auto;}
  .shell.is-nav-open .sidebar{transform:translateX(0);}
  .shell.is-collapsed .sidebar{width:240px; flex-basis:240px;}
  .shell.is-collapsed .sidebar-inner{padding:22px var(--chrome-pad);}
  .shell.is-collapsed .sidebar-title, .shell.is-collapsed .nav-groups{display:block;}
  .shell.is-collapsed .sidebar-head{justify-content:space-between; border-bottom:1px solid var(--line); padding-bottom:16px;}
  .sidebar-collapse{display:none;}
  .sidebar-backdrop{
    display:none; position:fixed; inset:0; background:rgba(26,43,74,.35); z-index:190;
    border:none; padding:0; margin:0;
  }
  .shell.is-nav-open .sidebar-backdrop{display:block;}
}

/* ---------- sign-in gate ---------- */
#pageGate{
  min-height:60vh; display:flex; align-items:center; justify-content:center; padding:40px var(--gutter);
}
#pageGate[hidden]{display:none;}
.gate-box{max-width:360px; text-align:center;}
.gate-box h1{font-size:24px; margin:0 0 12px; font-weight:500;}
.gate-box p{font-size:17px; color:var(--ink-soft); margin:0 0 22px; line-height:1.6;}
.gate-box .gate-alt{
  font-family:var(--sans); font-size:13px; font-weight:400; color:var(--muted);
  margin:26px 0 0; padding-top:20px; border-top:1px solid var(--line);
}
.gate-signup-btn{
  display:inline-block; font-family:var(--sans); font-weight:500; font-size:14px;
  color:var(--ink-soft); text-decoration:underline; text-decoration-color:rgba(26,43,74,.32); text-underline-offset:3px;
  padding:0; margin-top:8px; border:none;
}
.gate-signup-btn:hover{text-decoration-color:currentColor;}
.auth-signin{
  display:inline-flex; align-items:center; gap:7px;
  font-family:var(--sans); font-weight:500; font-size:15px;
  color:var(--ink); background:none; border:1px solid var(--ink);
  padding:10px 22px; cursor:pointer;
}
.auth-signin:hover{background:var(--ink); color:var(--paper);}

/* ---------- masthead auth marker ---------- */
.masthead-right{display:flex; align-items:center; gap:16px; flex-wrap:wrap;}
.mast-auth{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-soft); font-family:var(--sans);}
.mast-auth-name{font-weight:500; color:var(--ink);}
a.mast-auth-name{text-decoration:none;}
a.mast-auth-name:hover{text-decoration:underline;}
.mast-auth-email{font-weight:400; color:var(--muted);}
.btn-text{
  font-family:var(--sans); font-weight:400; font-size:12.5px;
  color:var(--accent); background:none; border:none; padding:0; cursor:pointer;
  text-decoration:underline; text-decoration-color:rgba(26,43,74,.32); text-underline-offset:2px;
}
.btn-text:hover{text-decoration-color:currentColor;}

/* .shell's display beats the UA [hidden] rule, so restate it. */
.shell[hidden]{display:none;}
