/* irfanmohammed.ca — one stylesheet, no build step, no dependencies. */

:root {
  --paper: #f5f3ee;
  --paper-2: #ebe8e0;
  --ink: #17191e;
  --ink-2: #4a4d55;
  --ink-3: #6f727a;
  --rule: #d6d2c7;
  --accent: #0d5f73;
  --accent-ink: #ffffff;
  --accent-soft: #d7e8ec;
  --warn: #9a5b0b;
  --warn-soft: #f6e6cc;
  --ok: #2f6b2f;
  --ok-soft: #dcebd6;

  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --wrap: 72rem;
  --radius: 6px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101316;
    --paper-2: #181c20;
    --ink: #e8e5de;
    --ink-2: #b4b1aa;
    --ink-3: #8d8a84;
    --rule: #2b3035;
    --accent: #6cc0d2;
    --accent-ink: #0b1215;
    --accent-soft: #173038;
    --warn: #e0a95a;
    --warn-soft: #33281a;
    --ok: #8fcf8a;
    --ok-soft: #1d2d1c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility;
}

img, video, svg, iframe { max-width: 100%; display: block; }
img, video { height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.2em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
code, kbd { font-family: var(--mono); font-size: 0.9em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--measure); }

/* ---------- Header / footer ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 5rem; padding: 2rem 0 3rem; color: var(--ink-3); font-size: 0.9rem; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-foot a { color: var(--ink-2); }

/* ---------- Section scaffolding ---------- */
.section { padding: 4.5rem 0 0; }
.label { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; display: flex; gap: 0.6rem; align-items: center; }
.label::before { content: ""; width: 1.5rem; height: 1px; background: var(--accent); }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--ink-3); }
.small { font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 1rem; }
.hero h1 { max-width: 22ch; }
.hero .role { font: 500 0.9rem/1.4 var(--mono); color: var(--accent); margin-bottom: 1.25rem; }
.hero-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1rem; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); color: var(--accent-ink); }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; margin-top: 3.5rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 1.1rem 1rem 1.1rem 0; }
.facts dt { font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.45rem; }
.facts dd { margin: 0; font-weight: 500; }

/* ---------- Experience timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.job { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.job:last-child { border-bottom: 1px solid var(--rule); }
.job .when { font: 0.85rem/1.5 var(--mono); color: var(--ink-3); padding-top: 0.25rem; }
.job h3 { margin-bottom: 0.15rem; }
.job .where { color: var(--ink-2); margin-bottom: 0.9rem; }
.job ul { margin-bottom: 0.5rem; }
@media (max-width: 40rem) { .job { grid-template-columns: 1fr; gap: 0.25rem; } }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.75rem 2.5rem; }
.skills h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { margin: 0; font: 0.8rem/1 var(--mono); padding: 0.4rem 0.55rem; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink-2); background: var(--paper); }

/* ---------- Project cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1.25rem; }
.card { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem; background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card .kicker { font: 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.9rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--ink-2); font-size: 0.97rem; }
.card .tags { margin-top: auto; padding-top: 0.75rem; }
.card .go { margin-top: 1rem; font-weight: 500; color: var(--accent); font-size: 0.92rem; }
.card.feature { grid-column: 1 / -1; }
@media (min-width: 56rem) { .card.feature p { max-width: 70ch; } }

.status { font: 0.72rem/1 var(--mono); padding: 0.3rem 0.45rem; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.06em; }
.status.live { background: var(--ok-soft); color: var(--ok); }
.status.wip { background: var(--warn-soft); color: var(--warn); }
.status.done { background: var(--paper-2); color: var(--ink-2); }

/* ---------- Case study pages ---------- */
.crumbs { font: 0.85rem var(--mono); color: var(--ink-3); padding-top: 2.5rem; }
.crumbs a { color: var(--ink-3); }
.case-head { padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--rule); }
.case-head h1 { max-width: 22ch; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 2rem; margin: 2rem 0 0; }
.meta dt { font: 500 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.4rem; }
.meta dd { margin: 0; font-size: 0.95rem; }

.case { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 3rem; padding-top: 2.5rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: 0.88rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.35rem 0 0.35rem 0.9rem; color: var(--ink-3); text-decoration: none; margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }
@media (max-width: 52rem) { .case { grid-template-columns: 1fr; gap: 1rem; } .toc { position: static; } }

.case-body > section { padding-bottom: 2.5rem; }
.case-body > section + section { border-top: 1px solid var(--rule); padding-top: 2.5rem; }
.case-body h2 { font-size: 1.6rem; }
.case-body p, .case-body ul, .case-body ol { max-width: var(--measure); }

.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; max-width: var(--measure); }
.callout p:last-child { margin: 0; }
.callout strong { display: block; font: 500 0.75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; color: var(--accent); }

/* Decision record (why this architecture) */
.decisions { display: grid; gap: 1rem; margin: 1.5rem 0; }
.decision { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.25rem; background: var(--paper); }
.decision h4 { margin-bottom: 0.4rem; }
.decision p { margin-bottom: 0.4rem; color: var(--ink-2); font-size: 0.97rem; }
.decision .alt { font-size: 0.88rem; color: var(--ink-3); margin: 0; }
.decision .alt b { font-weight: 600; color: var(--ink-2); }

table.compare { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 1.25rem 0; }
table.compare th, table.compare td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.compare th { font: 500 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
table.compare tr.chosen td { background: var(--accent-soft); }
.table-scroll { overflow-x: auto; }

/* ---------- Media: images, video, diagrams ---------- */
figure { margin: 2rem 0; }
figure.wide { max-width: none; }
.frame { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.frame img, .frame video { width: 100%; }
figcaption { font-size: 0.88rem; color: var(--ink-3); margin-top: 0.6rem; max-width: var(--measure); }
figcaption b { color: var(--ink-2); font-weight: 600; }

.video { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; }

/* Diagrams are inline SVG so they follow light/dark mode. */
.diagram { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); padding: 1.25rem; overflow-x: auto; }
.diagram svg { min-width: 40rem; width: 100%; height: auto; font-family: var(--sans); }
.diagram .node rect, .diagram rect.node { fill: var(--paper); stroke: var(--ink-3); stroke-width: 1.25; }
.diagram .node.hl rect, .diagram rect.node.hl { stroke: var(--accent); stroke-width: 2; fill: var(--accent-soft); }
.diagram .node.warn rect { stroke: var(--warn); fill: var(--warn-soft); }
.diagram .node.ok rect { stroke: var(--ok); fill: var(--ok-soft); }
.diagram .zone { fill: none; stroke: var(--ink-3); stroke-dasharray: 5 4; stroke-width: 1; }
.diagram text { fill: var(--ink); font-size: 13px; }
.diagram text.t { font-weight: 600; font-size: 13.5px; }
.diagram text.s { fill: var(--ink-3); font-size: 11.5px; }
.diagram text.z { fill: var(--ink-3); font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.diagram .edge { stroke: var(--ink-2); stroke-width: 1.5; fill: none; }
.diagram .edge.accent { stroke: var(--accent); }
.diagram .edge.dash { stroke-dasharray: 5 4; }
.diagram .arrowhead { fill: var(--ink-2); }
.diagram .arrowhead.accent { fill: var(--accent); }

/* Placeholder for media Irfan still needs to add. Delete the element once the real asset is in. */
.todo { border: 1.5px dashed var(--warn); background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 1.25rem; font-size: 0.92rem; margin: 1.5rem 0; max-width: var(--measure); }
.todo::before { content: "To add"; display: block; font: 600 0.72rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.todo p:last-child, .todo ul:last-child { margin-bottom: 0; }
.todo.media { aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: center; max-width: none; }

/* ---------- Blog ---------- */
.posts { list-style: none; padding: 0; margin: 0; }
.posts li { border-top: 1px solid var(--rule); padding: 1.4rem 0; margin: 0; display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; }
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts time { font: 0.85rem var(--mono); color: var(--ink-3); padding-top: 0.3rem; }
.posts h3 { margin-bottom: 0.3rem; }
.posts h3 a { color: var(--ink); text-decoration: none; }
.posts h3 a:hover { color: var(--accent); }
.posts p { color: var(--ink-2); margin: 0; }
@media (max-width: 40rem) { .posts li { grid-template-columns: 1fr; gap: 0.25rem; } }

article.post { max-width: var(--measure); padding-top: 1rem; }
article.post header { padding: 1.5rem 0 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
article.post h2 { font-size: 1.45rem; margin-top: 2.25rem; }
article.post figure { max-width: none; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.contact a { display: block; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; color: var(--ink); }
.contact a:hover { border-color: var(--accent); }
.contact small { display: block; font: 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 0.35rem; }

.list-plain { list-style: none; padding: 0; }
.list-plain li { padding: 0.6rem 0; border-top: 1px solid var(--rule); margin: 0; }

@media print {
  .site-head, .site-foot, .toc, .hero-links, .todo { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; }
}
.diagram .hub { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.job .when, .posts time, .facts dd, .meta dd { font-variant-numeric: tabular-nums; }
.nav a { padding: 0.6rem 0; }
.diagram:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
