/* ============================================================
   Erik Westmoreland portfolio — styles
   Section 1: site styles | Section 2: Ask Erik notebook widget
   ============================================================ */
:root {
    --ink: #0E2138;        /* deep navy — anchor */
    --ink-soft: #1E3A5C;   /* lighter navy for panels */
    --paper: #FBF9F4;      /* warm document white */
    --paper-dim: #F1EDE3;  /* shaded paper */
    --text: #22324A;       /* body text on paper */
    --text-faint: #5B6B82;
    --brass: #A8852F;      /* seal brass accent */
    --brass-soft: #C5A55C;
    --line: rgba(14, 33, 56, 0.16);
    --line-light: rgba(251, 249, 244, 0.22);
    --display: "Newsreader", Georgia, serif;
    --body: "Public Sans", -apple-system, sans-serif;
    --mono: "IBM Plex Mono", "Courier New", monospace;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }

  body {
    font-family: var(--body);
    background: var(--paper);
    color: var(--text);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

  /* ---------- Dossier label (signature device) ---------- */
  .dossier {
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    line-height: 1.9;
    border-left: 2px solid var(--brass);
    padding-left: 16px;
  }
  .dossier dt {
    display: inline-block;
    min-width: 96px;
    color: var(--brass-soft);
    text-transform: uppercase;
  }
  .dossier dd { display: inline; }
  .dossier div { display: block; }

  .eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
    display: block;
    margin-bottom: 14px;
  }

  /* ---------- Nav ---------- */
  nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(14, 33, 56, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-light);
  }
  .nav-inner {
    max-width: 1080px; margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  }
  .nav-name {
    font-family: var(--display); font-size: 19px; font-weight: 500;
    color: var(--paper); text-decoration: none; white-space: nowrap;
  }
  .nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
  .nav-links a {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
    text-transform: uppercase; color: rgba(251,249,244,0.75); text-decoration: none;
  }
  .nav-links a:hover, .nav-links a:focus-visible { color: var(--brass-soft); }
  a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

  /* ---------- Hero ---------- */
  header.hero {
    background: var(--ink); color: var(--paper);
    padding: 96px 0 88px;
    position: relative; overflow: hidden;
  }
  header.hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse 90% 70% at 80% -10%, rgba(168,133,47,0.13), transparent 60%);
    pointer-events: none;
  }
  .hero-grid {
    display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: end;
    position: relative; z-index: 1;
  }
  .hero h1 {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(42px, 6vw, 68px);
    line-height: 1.06; letter-spacing: -0.01em;
    margin: 20px 0 26px;
  }
  .hero h1 em { font-style: italic; color: var(--brass-soft); }
  .hero p.lede {
    font-size: 18.5px; font-weight: 300; line-height: 1.7;
    color: rgba(251,249,244,0.85); max-width: 52ch;
  }
  .hero .dossier { margin-bottom: 6px; color: rgba(251,249,244,0.92); }

  /* ---------- Stats band ---------- */
  .stats {
    background: var(--ink-soft); color: var(--paper);
    border-top: 1px solid var(--line-light);
  }
  .stats-inner {
    max-width: 1080px; margin: 0 auto; padding: 30px 24px;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
  }
  .stat .num {
    font-family: var(--display); font-size: 30px; font-weight: 500;
    color: var(--brass-soft); line-height: 1.1;
  }
  .stat .lbl {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
    text-transform: uppercase; color: rgba(251,249,244,0.66); margin-top: 5px;
  }

  /* ---------- Sections ---------- */
  section { padding: 88px 0; }
  section h2 {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(30px, 4vw, 42px); line-height: 1.15;
    color: var(--ink); margin-bottom: 22px; max-width: 24ch;
  }

  /* About */
  .about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; }
  .about-grid .statement {
    font-family: var(--display); font-size: 23px; font-weight: 300;
    line-height: 1.55; color: var(--ink);
  }
  .about-grid .statement strong { font-weight: 500; }
  .principles { display: grid; gap: 26px; align-content: start; }
  .principle h3 {
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--brass); margin-bottom: 8px;
  }
  .principle p { font-size: 15.5px; color: var(--text-faint); }
  .principle p b { color: var(--text); font-weight: 600; }

  /* ---------- Case studies ---------- */
  .cases { background: var(--paper-dim); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .case {
    display: grid; grid-template-columns: 1fr 1fr; gap: 56px;
    padding: 64px 0; border-top: 1px solid var(--line);
  }
  .case:first-of-type { border-top: none; padding-top: 40px; }
  .case h3 {
    font-family: var(--display); font-weight: 500; font-size: 29px;
    line-height: 1.2; color: var(--ink); margin: 18px 0 16px;
  }
  .case .challenge { font-size: 16.5px; margin-bottom: 22px; }
  .case .dossier { color: var(--text); margin-bottom: 22px; }
  .case .dossier dt { color: var(--brass); }
  .case ul { list-style: none; display: grid; gap: 9px; margin-bottom: 8px; }
  .case ul li {
    padding-left: 20px; position: relative; font-size: 15.5px; color: var(--text);
  }
  .case ul li::before {
    content: "—"; position: absolute; left: 0; color: var(--brass);
  }
  .outcome {
    background: var(--ink); color: var(--paper);
    padding: 26px 28px; margin-top: 10px;
  }
  .outcome .eyebrow { color: var(--brass-soft); margin-bottom: 10px; }
  .outcome p { font-size: 15.5px; color: rgba(251,249,244,0.9); }
  .outcome .big {
    font-family: var(--display); font-size: 34px; font-weight: 500;
    color: var(--brass-soft); line-height: 1.15; margin-bottom: 6px;
  }
  .case-media {
    background: repeating-linear-gradient(45deg, rgba(14,33,56,0.04), rgba(14,33,56,0.04) 12px, transparent 12px, transparent 24px);
    border: 1px dashed var(--line); min-height: 260px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: 12px; color: var(--text-faint);
    text-align: center; padding: 24px;
  }

  /* ---------- Featured excerpt ---------- */
  .excerpt { background: var(--ink); color: var(--paper); }
  .excerpt .dossier { color: rgba(251,249,244,0.92); margin: 26px 0 36px; }
  .excerpt blockquote {
    font-family: var(--display); font-weight: 300; font-style: italic;
    font-size: clamp(24px, 3.2vw, 34px); line-height: 1.45;
    max-width: 30ch; border: none;
  }
  .excerpt blockquote span { color: var(--brass-soft); }
  .excerpt .attrib {
    font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.05em;
    color: rgba(251,249,244,0.6); margin-top: 28px;
  }

  /* ---------- Timeline ---------- */
  .timeline { display: grid; gap: 0; margin-top: 18px; }
  .t-row {
    display: grid; grid-template-columns: 170px 1fr; gap: 36px;
    padding: 30px 0; border-top: 1px solid var(--line);
  }
  .t-row .years {
    font-family: var(--mono); font-size: 13.5px; color: var(--brass);
    letter-spacing: 0.04em; padding-top: 4px;
  }
  .t-row h3 {
    font-family: var(--display); font-size: 22px; font-weight: 500;
    color: var(--ink); line-height: 1.25;
  }
  .t-row .role { font-size: 15px; color: var(--text-faint); margin: 3px 0 10px; }
  .t-row p.desc { font-size: 15.5px; max-width: 68ch; }

  /* ---------- Writing ---------- */
  .writing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 12px; }
  .w-card {
    border: 1px solid var(--line); padding: 26px;
    background: #fff; display: flex; flex-direction: column; gap: 12px;
    text-decoration: none; color: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease;
  }
  .w-card:hover, .w-card:focus-visible { border-color: var(--brass); transform: translateY(-2px); }
  .w-card .eyebrow { margin-bottom: 0; }
  .w-card h3 { font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--ink); line-height: 1.3; }
  .w-card p { font-size: 14.5px; color: var(--text-faint); }
  .w-card .read { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); margin-top: auto; }

  /* ---------- Contact ---------- */
  .contact { background: var(--ink); color: var(--paper); }
  .contact h2 { color: var(--paper); }
  .contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: start; }
  .contact p.pitch { font-size: 17.5px; font-weight: 300; color: rgba(251,249,244,0.85); max-width: 50ch; }
  .contact .dossier { color: rgba(251,249,244,0.92); }
  .contact .dossier a { color: var(--paper); text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
  .contact .dossier a:hover { color: var(--brass-soft); }

  footer {
    background: var(--ink); color: rgba(251,249,244,0.45);
    border-top: 1px solid var(--line-light);
    padding: 22px 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  }
  footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

  /* ---------- Responsive ---------- */
  @media (max-width: 880px) {
    .hero-grid, .about-grid, .case, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .writing-grid { grid-template-columns: 1fr; }
    .t-row { grid-template-columns: 1fr; gap: 6px; }
    section { padding: 64px 0; }
    header.hero { padding: 64px 0; }
    .nav-links { display: none; }
  }

/* ============ ASK ERIK — vintage notebook chatbot ============ */
:root {
    --leather: #4A3526;
    --leather-hi: #6B4E36;
    --leather-edge: #2E2018;
    --page: #F7F1E1;
    --page-line: rgba(74, 53, 38, 0.12);
    --ink-pen: #2B3A55;
    --hand: "Caveat", cursive;
  }

  /* Closed notebook button */
  .nb-launcher {
    position: fixed; bottom: 26px; right: 26px; z-index: 90;
    width: 84px; height: 104px; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--leather-hi), var(--leather) 55%, var(--leather-edge));
    border-radius: 6px 12px 12px 6px;
    box-shadow: inset 3px 0 0 var(--leather-edge), inset -2px -2px 8px rgba(0,0,0,0.35),
                0 8px 24px rgba(14,33,56,0.4);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    transition: transform 0.25s ease;
  }
  .nb-launcher:hover, .nb-launcher:focus-visible { transform: translateY(-4px) rotate(-2deg); }
  .nb-launcher .strap {
    position: absolute; right: -3px; top: 18%; width: 10px; height: 64%;
    background: var(--leather-edge); border-radius: 4px;
    box-shadow: inset 0 2px 3px rgba(255,255,255,0.12);
  }
  .nb-launcher .nb-name {
    font-family: var(--hand); font-size: 17px; font-weight: 600;
    color: rgba(247,241,225,0.92); transform: rotate(-4deg); line-height: 1.05;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.4); padding: 0 8px;
  }
  .nb-launcher .nb-leaf {
    position: absolute; bottom: 8px; left: 10px; font-size: 13px;
    color: rgba(125, 155, 140, 0.85); transform: rotate(12deg);
  }
  .nb-launcher .nb-hint {
    font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(247,241,225,0.55);
  }

  /* Open notebook panel */
  .nb-panel {
    position: fixed; bottom: 26px; right: 26px; z-index: 95;
    width: min(420px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 60px));
    display: none; flex-direction: column;
    border-radius: 8px 14px 14px 8px;
    background: var(--page);
    box-shadow: -10px 0 0 var(--leather), -10px 6px 0 var(--leather-edge),
                0 18px 50px rgba(14,33,56,0.45);
    overflow: hidden;
    transform-origin: bottom right;
  }
  .nb-panel.open { display: flex; animation: nb-open 0.45s cubic-bezier(0.2, 0.8, 0.3, 1); }
  @keyframes nb-open {
    from { transform: perspective(1200px) rotateY(-65deg) scale(0.6); opacity: 0; }
    to   { transform: perspective(1200px) rotateY(0deg) scale(1); opacity: 1; }
  }

  .nb-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 10px; border-bottom: 2px solid rgba(74,53,38,0.25);
    background: linear-gradient(var(--page), rgba(74,53,38,0.04));
  }
  .nb-head .title { font-family: var(--hand); font-size: 26px; font-weight: 600; color: var(--leather); }
  .nb-head button {
    border: none; background: none; cursor: pointer;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--leather-hi); padding: 6px;
  }
  .nb-head button:hover { color: var(--leather-edge); }

  .nb-pages {
    flex: 1; overflow-y: auto; padding: 18px 20px 18px 44px; position: relative;
    background:
      linear-gradient(to right, transparent 30px, rgba(176,76,76,0.25) 30px, rgba(176,76,76,0.25) 31px, transparent 31px),
      repeating-linear-gradient(var(--page), var(--page) 27px, var(--page-line) 28px);
  }
  .nb-msg { margin-bottom: 16px; }
  .nb-msg.erik { font-family: var(--hand); font-size: 20px; font-weight: 500; line-height: 28px; color: var(--ink-pen); white-space: pre-wrap; }
  .nb-msg.visitor {
    font-family: var(--hand); font-size: 20px; font-weight: 400; line-height: 28px;
    color: #6E4A2F; text-align: right; font-style: italic;
  }
  .nb-msg.erik .caret {
    display: inline-block; width: 2px; height: 18px; background: var(--ink-pen);
    vertical-align: -3px; animation: nb-blink 0.9s steps(1) infinite;
  }
  @keyframes nb-blink { 50% { opacity: 0; } }

  .nb-bubbles { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-top: 1px dashed rgba(74,53,38,0.3); background: rgba(74,53,38,0.03); }
  .nb-bubbles button {
    font-family: var(--hand); font-size: 16.5px; font-weight: 500; color: var(--ink-pen);
    background: #fff; border: 1px solid rgba(43,58,85,0.35); border-radius: 16px 18px 16px 4px;
    padding: 5px 13px; cursor: pointer; transition: all 0.15s ease;
    box-shadow: 1px 2px 0 rgba(43,58,85,0.15);
  }
  .nb-bubbles button:hover, .nb-bubbles button:focus-visible {
    background: var(--ink-pen); color: var(--page); transform: translateY(-1px);
  }

  .nb-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 2px solid rgba(74,53,38,0.25); background: var(--page); }
  .nb-input input {
    flex: 1; border: none; border-bottom: 2px dotted rgba(74,53,38,0.4);
    background: transparent; outline: none;
    font-family: var(--hand); font-size: 19px; font-weight: 500; color: var(--ink-pen);
    padding: 4px 2px;
  }
  .nb-input input:focus { border-bottom-color: var(--ink-pen); }
  .nb-input input::placeholder { color: rgba(74,53,38,0.45); }
  .nb-input button {
    border: none; background: var(--ink-pen); color: var(--page); cursor: pointer;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 8px 14px; border-radius: 4px;
  }
  .nb-input button:hover { background: var(--ink); }

  @media (prefers-reduced-motion: reduce) {
    .nb-panel.open { animation: none; }
    .nb-msg.erik .caret { animation: none; }
  }
  @media (max-width: 880px) {
    .nb-launcher { width: 68px; height: 86px; bottom: 18px; right: 18px; }
    .nb-launcher .nb-name { font-size: 14px; }
    .nb-panel { bottom: 12px; right: 12px; }
  }
