/* ==========================================================================
   Shahriar Khan portfolio  |  styles.css
   Tokens first, then base, layout, components, pages, utilities.
   See STYLE_GUIDE.md for the rationale behind every token.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Colour */
  --paper:          #F3F5F2;   /* page background, misty paper with a hint of green */
  --paper-deep:     #E8ECE8;   /* alternate bands */
  --ink:            #14262B;   /* primary text, deep teal-black */
  --ink-soft:       #3C4F55;   /* secondary text */
  --ink-mute:       #6B7B80;   /* meta, captions */
  --rule:           #CFD7D3;   /* hairlines, borders */
  --verdigris:      #1E7F73;   /* single accent: links, focus, active */
  --verdigris-deep: #155F56;   /* accent hover */
  --verdigris-tint: #DCEDE8;   /* accent background wash */

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body:    "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Type scale: 1.25 ratio, base 18px */
  --step--1: 0.889rem;
  --step-0:  1rem;
  --step-1:  1.25rem;
  --step-2:  1.563rem;
  --step-3:  1.953rem;
  --step-4:  2.441rem;
  --step-5:  3.052rem;
  --step-6:  3.815rem;

  /* Space (4px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;   --s-7: 3rem;    --s-8: 4.5rem; --s-9: 7rem;

  /* Layout */
  --measure: 62ch;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --radius: 4px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
h1 { font-size: clamp(var(--step-4), 5vw, var(--step-6)); }
h2 { font-size: clamp(var(--step-2), 3vw, var(--step-3)); }
h3 { font-size: var(--step-2); }
h4 { font-family: var(--font-body); font-weight: 600; font-size: var(--step-0); }
p, ul, ol, dl { margin: 0 0 var(--s-4); }
p { max-width: var(--measure); }
a { color: var(--verdigris); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--verdigris-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 3px;
  border-radius: 2px;
}
img, svg { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-7) 0; }
::selection { background: var(--verdigris-tint); color: var(--ink); }
small, .meta { font-size: var(--step--1); color: var(--ink-mute); }
strong { font-weight: 600; }

/* ---------- 3. Layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--s-8); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); max-width: var(--measure); }
.section-head h2 { margin: 0; }
.section-head p { color: var(--ink-soft); margin: 0; }
.band { background: var(--paper-deep); }
.two-col { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 52em) {
  .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-8); }
  .two-col.aside-right { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); }
}

.skip-link {
  position: absolute; left: var(--s-4); top: -3rem;
  background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4);
  border-radius: var(--radius); z-index: 100; text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

/* ---------- 4. Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: var(--s-4); }
.brand { display: inline-flex; align-items: baseline; gap: var(--s-3); text-decoration: none; color: var(--ink); }
.brand-mark { font-family: var(--font-display); font-size: var(--step-1); font-weight: 500; letter-spacing: -0.01em; }
.brand-role { color: var(--ink-mute); font-size: var(--step--1); }
.site-nav ul { list-style: none; display: flex; gap: var(--s-5); margin: 0; padding: 0; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); padding-block: var(--s-2); border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--verdigris); }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-2) var(--s-3); color: var(--ink); font: inherit; font-size: var(--step--1); cursor: pointer; }
@media (max-width: 44em) {
  .brand-role { display: none; }
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; inset: 100% 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--rule); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: var(--s-3) var(--gutter); }
  .site-nav a { display: block; padding-block: var(--s-3); border-bottom: 1px solid var(--rule); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--verdigris); }
}

/* ---------- 5. Hero ---------- */
.hero { padding-block: clamp(var(--s-8), 12vh, var(--s-9)) var(--s-8); }
.hero-grid { display: grid; gap: var(--s-7); grid-template-columns: 1fr; align-items: end; }
@media (min-width: 60em) { .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr); gap: var(--s-8); } }
.hero h1 { max-width: 20ch; margin-bottom: var(--s-5); }
.hero .lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; margin-bottom: var(--s-6); }
.hero .lede strong { color: var(--ink); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; }

/* Glance list: a ledger, not cards */
.glance { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.glance li { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.glance .figure { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.glance .label { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.4; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 0.7rem 1.15rem; border-radius: var(--radius);
  font: inherit; font-size: var(--step--1); font-weight: 500; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--verdigris-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.link-quiet { color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- 7. Disciplines (definition list) ---------- */
.disciplines { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--rule); }
.disciplines > div { display: grid; grid-template-columns: 1fr; gap: var(--s-2) var(--s-6); padding: var(--s-5) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 52em) { .disciplines > div { grid-template-columns: 16rem 1fr; } }
.disciplines dt { font-family: var(--font-display); font-size: var(--step-1); margin: 0; }
.disciplines dd { margin: 0; color: var(--ink-soft); max-width: var(--measure); }
.disciplines dd .tools { display: block; margin-top: var(--s-2); color: var(--ink-mute); font-size: var(--step--1); }

/* ---------- 8. Outcomes ---------- */
.outcomes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 52em) { .outcomes { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); } }
.outcomes li { border-left: 2px solid var(--verdigris); padding-left: var(--s-4); }
.outcomes .figure { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; margin-bottom: var(--s-2); font-variant-numeric: tabular-nums; }
.outcomes p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- 9. AI block ---------- */
.ai-note { background: var(--verdigris-tint); border-radius: var(--radius); padding: var(--s-5) var(--s-6); }
.ai-note h3 { margin-bottom: var(--s-3); }
.ai-note p:last-child { margin-bottom: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding-left: 1.75rem; margin-bottom: var(--s-3); color: var(--ink-soft); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.9rem; height: 0.5rem;
  border-left: 2px solid var(--verdigris); border-bottom: 2px solid var(--verdigris); transform: rotate(-45deg);
}

/* ---------- 10. Timeline (a genuine sequence) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.timeline li { position: relative; padding: 0 0 var(--s-6) var(--s-6); }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 0.55em; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--verdigris); }
.timeline li:last-child { padding-bottom: 0; }
.timeline time { display: block; color: var(--ink-mute); font-size: var(--step--1); margin-bottom: var(--s-1); font-variant-numeric: tabular-nums; }
.timeline h3 { font-size: var(--step-1); margin-bottom: var(--s-1); }
.timeline .org { color: var(--ink-soft); margin-bottom: var(--s-3); }
.timeline ul { padding-left: 1.1rem; color: var(--ink-soft); max-width: var(--measure); }
.timeline ul li { padding: 0; margin-bottom: var(--s-2); }
.timeline ul li::before { display: none; }

/* ---------- 11. Certifications table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.table th, .table td { text-align: left; padding: var(--s-3) var(--s-3) var(--s-3) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-weight: 600; color: var(--ink); }
.table td { color: var(--ink-soft); }
.table td:first-child { color: var(--ink); }
.table .id { font-variant-numeric: tabular-nums; color: var(--ink-mute); }
@media (max-width: 44em) {
  .table thead { display: none; }
  .table tr { display: block; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
  .table td { display: block; border: 0; padding: var(--s-1) 0; }
}

/* ---------- 12. Toolbox ---------- */
.toolbox { display: grid; gap: var(--s-5) var(--s-6); grid-template-columns: 1fr; margin: 0; }
@media (min-width: 40em) { .toolbox { grid-template-columns: 1fr 1fr; } }
@media (min-width: 60em) { .toolbox { grid-template-columns: repeat(3, 1fr); } }
.toolbox dt { font-weight: 600; margin-bottom: var(--s-1); }
.toolbox dd { margin: 0; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.55; }

/* ---------- 13. Contact CTA + footer ---------- */
.cta { padding-block: var(--s-8); }
.cta h2 { max-width: 22ch; }
.site-footer { border-top: 1px solid var(--rule); padding-block: var(--s-6); color: var(--ink-mute); font-size: var(--step--1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); justify-content: space-between; }
.site-footer ul { list-style: none; display: flex; gap: var(--s-4); margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- 14. Page header (inner pages) ---------- */
.page-head { padding-block: var(--s-8) var(--s-6); }
.page-head h1 { font-size: clamp(var(--step-3), 4vw, var(--step-5)); max-width: 22ch; }
.page-head p { color: var(--ink-soft); font-size: var(--step-1); }

/* ---------- 15. Blog ---------- */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.post-list li { display: grid; gap: var(--s-2) var(--s-6); grid-template-columns: 1fr; padding: var(--s-5) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 52em) { .post-list li { grid-template-columns: 10rem 1fr; } }
.post-list time { color: var(--ink-mute); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.post-list h2 { font-size: var(--step-2); margin-bottom: var(--s-2); }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--verdigris-deep); text-decoration: underline; }
.post-list p { color: var(--ink-soft); margin: 0; }
.post-list .tags { margin-top: var(--s-2); color: var(--ink-mute); font-size: var(--step--1); }
.status { display: inline-block; font-size: 0.78rem; color: var(--verdigris-deep); background: var(--verdigris-tint); padding: 0.1rem 0.5rem; border-radius: var(--radius); margin-left: var(--s-2); vertical-align: middle; }

.article { padding-block: var(--s-7) var(--s-8); }
.article header { margin-bottom: var(--s-6); }
.article h1 { font-size: clamp(var(--step-3), 4vw, var(--step-5)); }
.article .byline { color: var(--ink-mute); font-size: var(--step--1); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); margin-top: var(--s-7); }
.prose h3 { font-size: var(--step-1); margin-top: var(--s-6); }
.prose p, .prose li { color: var(--ink-soft); }
.prose li { margin-bottom: var(--s-2); }
.prose blockquote { margin: var(--s-5) 0; padding: var(--s-3) var(--s-5); border-left: 2px solid var(--verdigris); color: var(--ink); font-family: var(--font-display); font-size: var(--step-1); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--paper-deep); padding: 0.1em 0.35em; border-radius: 3px; }
.prose pre { background: var(--ink); color: var(--paper); padding: var(--s-4) var(--s-5); border-radius: var(--radius); overflow-x: auto; font-size: var(--step--1); line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose figure { margin: var(--s-6) 0; }
.prose figcaption { color: var(--ink-mute); font-size: var(--step--1); margin-top: var(--s-2); }
.article-nav { border-top: 1px solid var(--rule); padding-top: var(--s-5); margin-top: var(--s-7); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* ---------- 16. Contact ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.contact-list li { display: grid; grid-template-columns: 8rem 1fr; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.contact-list .k { color: var(--ink-mute); font-size: var(--step--1); }
.form { display: grid; gap: var(--s-4); }
.form label { display: grid; gap: var(--s-1); font-size: var(--step--1); font-weight: 500; }
.form input, .form textarea, .form select {
  font: inherit; font-size: var(--step-0); color: var(--ink);
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 0.65rem 0.8rem; width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--verdigris); outline: 2px solid var(--verdigris); outline-offset: 0; }
.form textarea { min-height: 9rem; resize: vertical; }
.form .hint { color: var(--ink-mute); font-size: var(--step--1); font-weight: 400; }
.form .row { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 40em) { .form .row { grid-template-columns: 1fr 1fr; } }
.form .honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-status { font-size: var(--step--1); color: var(--verdigris-deep); min-height: 1.5em; }

/* ---------- 17. Utilities ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--ink-soft); }
.narrow { max-width: var(--measure); }

/* ---------- 17b. Additions (2026-11-28) ---------- */
.eyebrow { font-size: var(--step--1); letter-spacing: 0.04em; color: var(--verdigris); font-weight: 500; margin-bottom: var(--s-4); max-width: none; }
.table-scroll { overflow-x: auto; }
.table .id { overflow-wrap: anywhere; }
.mt-6 { margin-top: var(--s-6); }
/* long links (LinkedIn, GitHub) must wrap instead of pushing the page wider than a phone */
@media (max-width: 51.99em) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.contact-list li { grid-template-columns: minmax(5rem, 8rem) minmax(0, 1fr); }
.contact-list a { overflow-wrap: anywhere; }

/* Dark mode: the same palette, inverted, with the accent lifted for contrast */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:          #0F1C20;
    --paper-deep:     #142629;
    --ink:            #E4EBE8;
    --ink-soft:       #B3C1BE;
    --ink-mute:       #8A9B99;
    --rule:           #2A3E42;
    --verdigris:      #5CC2B2;
    --verdigris-deep: #8AD9CB;
    --verdigris-tint: #183B37;
    color-scheme: dark;
  }
  .btn-primary:hover { color: var(--paper); }
}

/* ---------- 18. Print ---------- */
@media print {
  .site-header, .site-footer, .actions, .nav-toggle, .cta { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  .section { padding-block: 1.2rem; }
}
