/* ===== Base ===== */
:root{
  --page-w: 980px;          /* space for main + sidebar */
  --pad-x: 1.5rem;
  --pad-y: 3rem;

  --bg:#ffffff; --fg:#1f2328; --muted:#353536; --muted-2:#3a3a3a;
  --subtle:#8c8c8c;

  --link:#0969da; --link-hover:#054da7;

  --sidebar-w:180px;
  --gap:3rem;
  --left-gutter: 10rem;
  --right-gutter: 1rem;
  --main-w: clamp(320px, 33.33vw, 760px);
}

*{box-sizing:border-box}
html{scrollbar-gutter:stable;overflow-y:scroll}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size:14px;
  line-height:1.65;
}

/* ===== Layout: main | right sidebar ===== */
.shell{
  display: grid;
  grid-template-columns:
    var(--left-gutter)
    minmax(0, var(--main-w))
    1fr
    var(--sidebar-w)
    var(--right-gutter);
  gap: 0;                         /* gap is handled by gutters + spacer */
  align-items: start;
  padding: var(--pad-y) var(--pad-x);
  width: 100vw;                   /* span full viewport so gutters are true to edges */
  overflow-x: clip; 
}

.main{ grid-column: 2; min-width: 0; }
.side{
  grid-column: 4;                 /* the fixed-width sidebar track */
  position: sticky;
  top: var(--pad-y);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  text-align: right; 
}

/* ===== Type ===== */
h1{
  font-size:2rem;
  margin:0 0 1.2rem 0;
  font-weight:300;
  color:var(--muted-2);
}
h2{
  font-size:1.5rem;
  margin:1.25rem 0 .6rem 0;
  font-weight:300;
  color:var(--muted-2);
}
p{margin:0 0 1rem 0;color:var(--muted)}
.tagline{font-size:18px;color:#333;font-weight:300;margin-bottom:1.3rem}

/* ===== Links: underline only under text ===== */
/* --- Global links: no underline by default; underline on hover --- */
a {
  color: var(--link);
  text-decoration: none;
  font-weight: 400;
  transition: color .2s ease, text-decoration-color .2s ease;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-hover);
  color: var(--link-hover);
}

/* --- Right sidebar nav: only active/hover are underlined --- */
.side a { text-decoration: none; }
.side a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-hover);
}
.side a.active {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: #1a1a1a;
}



/* ===== Lists: flush/hanging bullets (no ugly left indent) ===== */
/* Use a two-column grid: a small bullet column + text column.
   This gives a clean left edge and correct wrapping. */
/* Replace the grid + ::before with native bullets */
/* Bullet list (native markers) */
.bullet{ list-style: disc; padding-left:1.1rem; margin:0; }
.bullet li{ margin:.35rem 0; color:var(--muted); font-size: 14px; font-weight: 375;}
.bullet li::marker{ color:var(--muted-2); }
.bullet.tight li{ margin:.15rem 0 .55rem 0; }

/* Link styling INSIDE bullet items */
.bullet li a{
  color: var(--link);                    /* restore your link color */
  text-underline-offset: 2px;
  text-decoration-thickness: 0.06em;
  text-decoration-color: currentColor;
  text-decoration-skip-ink: auto;
  overflow-wrap: anywhere; word-break: break-word;
}
.bullet li a:hover{
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-color: currentColor;
}
.bullet li a:visited{ color: var(--link); }  /* avoid purple */


/* ===== Footer ===== */
.footer{margin-top:2rem;color:#888;font-weight:300; font-size:12px}
.social{display:flex;flex-wrap:wrap;gap:1.2rem;margin:1rem 0 1.2rem; font-size:12px; font-weight:10;}
.emails div{margin:.2rem 0}


/* Mobile/tablet: recentre and drop the shift */
@media (max-width: 780px){
  :root{ --left-gutter: 0; }
  html, body { overflow-x: hidden; }

  .shell{
    max-width: 100%;
    margin: 0;
    padding: var(--pad-y) var(--pad-x);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "side"
      "main";
    gap: 0.75rem;
  }

  /* Top bar aligned to the same left edge as main content */
  .side{
    grid-area: side;
    position: sticky;
    top: 0;
    z-index: 50;

    border-left: none;
    background: var(--bg);

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;

    /* key change: no horizontal padding; rely on .shell padding */
    padding: 0.5rem 0;

    overflow-x: auto;
    white-space: nowrap;

    /* safe areas without shifting alignment */
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }

  .main{
    grid-area: main;
    min-width: 0;
  }

  .side a { text-decoration: none; }
  .side a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
  }
  .side a.active,
  .side a[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    text-decoration-color: #1a1a1a;
    color: #1a1a1a;
  }

  img, video { max-width: 100%; height: auto; }
  pre { white-space: pre-wrap; }
  code, .entry-content, .project-desc { overflow-wrap: anywhere; word-break: break-word; }
}

/* Description text */
.description {
  font-size: 18px;
  color: #333;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

/* Details & summary blocks */
details {
  margin-top: 2rem;
  border-top: 1px solid #e5e5e5;
  padding-top: 1rem;
}

summary {
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  color: #444;
  margin-bottom: 1rem;
}

/* Experience page */
.section { margin-bottom: 3rem; }
.section-title {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--muted-2);
  margin-bottom: 1.2rem;
}

.project { margin-bottom: 2rem; }
.project-date {
  font-size: 12px;
  font-weight: 400;
  color: var(--subtle);
}
.project-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-2);
  margin: 0.2rem 0;
}
.project-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
}

/* Entry styles */
.entry { margin-bottom: 2.5rem; }
.entry-date { font-size: 12px; color: var(--subtle); }
.entry-category {
  font-size: 12px;
  font-weight: 400;
  color: #777;
  text-transform: uppercase;
  margin-top: 0.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}
.entry-content { font-size: 13px; color: var(--muted); }