:root{
    --bg:#faf9f7;
    --surface:#ffffff;
    --text:#1c1a17;
    --text-dim:#57534d;
    --text-faint:#8a8579;
    --accent:#8a5a2f;
    --accent-line:#d8cdbc;
    --rule:#e7e2d9;
    --max:780px;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#15130f;
      --surface:#1c1a15;
      --text:#f1ede4;
      --text-dim:#c3bcac;
      --text-faint:#8f887a;
      --accent:#d5a25f;
      --accent-line:#3a3428;
      --rule:#2b271f;
    }
  }
  :root[data-theme="dark"]{
    --bg:#15130f;
    --surface:#1c1a15;
    --text:#f1ede4;
    --text-dim:#c3bcac;
    --text-faint:#8f887a;
    --accent:#d5a25f;
    --accent-line:#3a3428;
    --rule:#2b271f;
  }
  *{box-sizing:border-box}
  body{
    margin:0;
    background:var(--bg);
    color:var(--text);
    font-family: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", serif;
    line-height:1.6;
    -webkit-font-smoothing:antialiased;
  }
  .wrap{
    max-width:var(--max);
    margin:0 auto;
    padding:64px 24px 96px;
  }
  header.hero{
    margin-bottom:48px;
  }
  h1{
    font-size:2.1rem;
    font-weight:600;
    margin:0 0 4px;
    letter-spacing:-0.01em;
  }
  .title{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    color:var(--text-dim);
    font-size:1.02rem;
    margin:0 0 18px;
  }
  .contact{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.88rem;
    color:var(--text-faint);
    display:flex;
    flex-wrap:wrap;
    gap:4px 14px;
  }
  .contact a{ color:var(--text-dim); text-decoration:none; border-bottom:1px solid var(--accent-line); }
  .contact a:hover{ color:var(--accent); border-color:var(--accent); }
  .contact span.dot{ color:var(--text-faint); }

  section{ margin-bottom:40px; }
  h2{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.72rem;
    font-weight:700;
    letter-spacing:0.14em;
    text-transform:uppercase;
    color:var(--accent);
    margin:0 0 16px;
    padding-bottom:8px;
    border-bottom:1px solid var(--rule);
  }
  p.lede{ margin:0; color:var(--text-dim); }

  ul.plain{ margin:0; padding:0; list-style:none; }
  ul.plain li{
    position:relative;
    padding-left:16px;
    margin-bottom:8px;
    color:var(--text-dim);
  }
  ul.plain li::before{
    content:"";
    position:absolute;
    left:0; top:0.62em;
    width:5px; height:5px;
    border-radius:50%;
    background:var(--accent-line);
  }

  .role{ margin-bottom:26px; }
  .role:last-child{ margin-bottom:0; }
  .role-head{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:16px;
    flex-wrap:wrap;
  }
  .role-title{ font-weight:600; font-size:1rem; }
  .role-org{ color:var(--accent); font-weight:600; }
  .role-dates{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.8rem;
    color:var(--text-faint);
    white-space:nowrap;
  }
  .role ul.plain{ margin-top:10px; }
  .role ul.plain li{ font-size:0.94rem; }

  .grid2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
  }
  @media (max-width:640px){ .grid2{ grid-template-columns:1fr; } }
  .tech-group{ margin-bottom:14px; }
  .tech-label{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.78rem;
    font-weight:700;
    color:var(--text);
    margin-bottom:2px;
  }
  .tech-value{ color:var(--text-dim); font-size:0.92rem; }

  .edu-item{ margin-bottom:12px; }
  .edu-item:last-child{ margin-bottom:0; }
  .edu-degree{ font-weight:600; }
  .edu-meta{ color:var(--text-faint); font-size:0.88rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }

  footer{
    margin-top:64px;
    padding-top:20px;
    border-top:1px solid var(--rule);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.8rem;
    color:var(--text-faint);
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:8px;
  }
  footer a{ color:var(--text-faint); }

  @media print{
    body{ background:#fff; color:#000; }
    .wrap{ padding:0; max-width:none; }
    footer{ display:none; }
  }

  /* --- personal / login pages --- */
  .center-wrap{
    max-width:420px;
    margin:0 auto;
    padding:96px 24px;
    min-height:60vh;
  }
  .card{
    background:var(--surface);
    border:1px solid var(--rule);
    border-radius:14px;
    padding:32px;
  }
  .card h1{ font-size:1.3rem; margin:0 0 6px; }
  .card p.sub{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    color:var(--text-faint);
    font-size:0.88rem;
    margin:0 0 24px;
  }
  form.gate{ display:flex; flex-direction:column; gap:14px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
  form.gate input[type="password"]{
    font-family:inherit;
    font-size:0.95rem;
    padding:11px 13px;
    border-radius:8px;
    border:1px solid var(--accent-line);
    background:var(--bg);
    color:var(--text);
  }
  form.gate input[type="password"]:focus{ outline:2px solid var(--accent); outline-offset:1px; }
  form.gate button{
    font-family:inherit;
    font-size:0.92rem;
    font-weight:600;
    padding:11px 13px;
    border-radius:8px;
    border:none;
    background:var(--accent);
    color:#fff;
    cursor:pointer;
  }
  form.gate button:hover{ opacity:0.92; }
  .error-msg{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.85rem;
    color:#b3432f;
    margin:0;
  }
  .back-link{
    display:block;
    margin-top:18px;
    text-align:center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.82rem;
    color:var(--text-faint);
    text-decoration:none;
  }
  .interest-card{
    background:var(--surface);
    border:1px solid var(--rule);
    border-radius:12px;
    padding:22px 24px;
    margin-bottom:16px;
  }
  .interest-card h3{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.95rem;
    margin:0 0 8px;
  }
  .interest-card p{ margin:0; color:var(--text-dim); font-size:0.94rem; }
  .placeholder-note{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size:0.8rem;
    color:var(--text-faint);
    font-style:normal;
  }
