/* irfanmohammed.ca. One stylesheet, no build step, no dependencies. Dark only. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0f1311;
  --surface: #151a17;
  --surface-2: #1b221e;
  --text: #ece5d3;      /* light beige */
  --text-2: #c9c1ad;
  --text-3: #a39c8a;
  --rule: #2b332e;
  --rule-strong: #3d4842;
  --green: #5cc488;      /* buttons, primary actions */
  --green-ink: #08120c;  /* text on green */
  --link: #86d9a8;
  --green-soft: #17301f;
  --warn: #e6b56a;
  --warn-soft: #2d2517;
  --ok: #86d9a8;
  --ok-soft: #17301f;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --wrap: 72rem;
  --radius: 6px;
  color-scheme: dark;
  accent-color: var(--green);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--rule-strong) var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
::selection { background: var(--green); color: var(--green-ink); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
  caret-color: var(--green);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; color: var(--text); }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); letter-spacing: -0.025em; }
h3 { font-size: 1.25rem; }
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; }
li::marker { color: var(--text-3); }
b, strong { font-weight: 600; color: var(--text); }
code, kbd { font-family: var(--mono); font-size: 0.88em; background: var(--surface-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(--green); color: var(--green-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-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { color: var(--text-2); text-decoration: none; padding: 0.6rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--green); }

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

/* ---------- Section scaffolding ---------- */
.section { padding: 5.5rem 0 0; }
.lede { font-size: 1.2rem; color: var(--text-2); max-width: 60ch; }
.muted { color: var(--text-3); }
.small { font-size: 0.9rem; }

/* ---------- Hero ---------- */
.hero { padding: 5.5rem 0 1rem; }
.hero h1 { max-width: 20ch; margin-bottom: 1.5rem; }
.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.65rem 1.05rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: background-color 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--green); text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--green-ink); font-weight: 600; }
.btn.primary:hover { background: #74d29a; border-color: #74d29a; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; margin: 3.5rem 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 1.1rem 1rem 1.1rem 0; }
.facts dt { font-size: 0.85rem; color: var(--text-3); margin-bottom: 0.3rem; }
.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-size: 0.92rem; color: var(--text-3); padding-top: 0.2rem; }
.job h3 { margin-bottom: 0.15rem; }
.job .where { color: var(--text-2); margin-bottom: 0.9rem; }
.job ul { margin-bottom: 0.5rem; }
@media (max-width: 40rem) { .job { grid-template-columns: 1fr; gap: 0.25rem; } }

/* ---------- Skills: a plain definition list, not chips ---------- */
.skills { display: grid; grid-template-columns: 15rem 1fr; gap: 0; margin: 2rem 0 0; max-width: 60rem; }
.skills dt, .skills dd { padding: 0.8rem 0; border-top: 1px solid var(--rule); margin: 0; }
.skills dt { font-weight: 600; padding-right: 1.5rem; }
.skills dd { color: var(--text-2); }
@media (max-width: 40rem) { .skills { grid-template-columns: 1fr; } .skills dd { border-top: 0; padding-top: 0; } }

/* ---------- Project list ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 2.5rem; }
.card { display: flex; flex-direction: column; padding: 1.5rem 0 1.75rem; border-top: 1px solid var(--rule); color: var(--text); text-decoration: none; }
.card h2, .card h3 { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 0.35rem; transition: color 0.15s; }
.card:hover { text-decoration: none; }
.card:hover h2, .card:hover h3 { color: var(--link); }
.card .card-meta { font-size: 0.9rem; color: var(--text-3); margin-bottom: 0.7rem; }
.card p { color: var(--text-2); font-size: 0.98rem; }
.card .stack { margin-top: auto; margin-bottom: 0; font-size: 0.9rem; color: var(--text-3); }
.card.feature { grid-column: 1 / -1; padding: 2rem 0 2.25rem; }
.card.feature h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.025em; }
.card.feature p { max-width: 64ch; font-size: 1.05rem; }

/* ---------- Case study pages ---------- */
.crumbs { font-size: 0.9rem; color: var(--text-3); padding-top: 2.5rem; }
.crumbs a { color: var(--text-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-size: 0.85rem; color: var(--text-3); margin-bottom: 0.25rem; }
.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.9rem; }
.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(--text-3); text-decoration: none; margin-left: -1px; border-left: 1px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--green); }
@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: 3rem; }
.case-body h2 { font-size: 1.6rem; }
.case-body p, .case-body ul, .case-body ol { max-width: var(--measure); }

.callout { border: 1px solid #2f5a40; background: var(--green-soft); padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1.5rem 0; max-width: var(--measure); }
.callout p:last-child { margin: 0; }

/* Decision record (why this architecture) */
.decisions { display: grid; gap: 0; margin: 1.5rem 0; max-width: var(--measure); }
.decision { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.decision:last-child { border-bottom: 1px solid var(--rule); }
.decision h3 { font-size: 1.08rem; letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.decision p { margin-bottom: 0.4rem; color: var(--text-2); font-size: 0.98rem; }
.decision .alt { font-size: 0.92rem; color: var(--text-3); margin: 0; }

table.compare { border-collapse: collapse; width: 100%; font-size: 0.93rem; margin: 1.25rem 0; }
table.compare th, table.compare td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.compare th { font-size: 0.85rem; font-weight: 600; color: var(--text-3); }
table.compare tr.chosen td { background: var(--green-soft); }
.table-scroll { overflow-x: auto; }

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

.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 styled from these tokens. */
.diagram { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 1.25rem; overflow-x: auto; }
.diagram:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.diagram svg { min-width: 40rem; width: 100%; height: auto; font-family: var(--sans); }
.diagram .node rect, .diagram rect.node { fill: var(--surface-2); stroke: var(--rule-strong); stroke-width: 1.25; }
.diagram .node.hl rect, .diagram rect.node.hl { stroke: var(--green); stroke-width: 1.75; fill: var(--green-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(--rule-strong); stroke-dasharray: 5 4; stroke-width: 1; }
.diagram .hub { fill: var(--green-soft); stroke: var(--green); stroke-width: 2; }
.diagram text { fill: var(--text); font-size: 13.5px; }
.diagram text.t { font-weight: 600; font-size: 14px; }
.diagram text.s { fill: var(--text-3); font-size: 12.5px; }
.diagram text.z { fill: var(--text-3); font-size: 12.5px; font-weight: 600; }
.diagram .edge { stroke: var(--text-3); stroke-width: 1.5; fill: none; }
.diagram .edge.accent { stroke: var(--green); }
.diagram .edge.dash { stroke-dasharray: 5 4; }
.diagram .arrowhead { fill: var(--text-3); }
.diagram .arrowhead.accent { fill: var(--green); }
.diagram line { stroke: var(--rule); }

/* Placeholder for media still to add. Replace 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.93rem; margin: 1.5rem 0; max-width: var(--measure); }
.todo::before { content: "To add: "; font-weight: 600; }
.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; }
.todo.media::before { display: block; }
.todo a { color: var(--warn); }

/* ---------- Writing ---------- */
.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-size: 0.92rem; color: var(--text-3); padding-top: 0.2rem; }
.posts .post-title { font-size: 1.25rem; margin-bottom: 0.3rem; }
.posts .post-title a { color: var(--text); text-decoration: none; }
.posts .post-title a:hover { color: var(--link); }
.posts p { color: var(--text-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 .byline { color: var(--text-3); font-size: 0.95rem; }
article.post h2 { font-size: 1.45rem; margin-top: 2.5rem; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 2rem; margin-top: 1.5rem; max-width: 60rem; }
.contact a { display: block; border-top: 1px solid var(--rule); padding: 1rem 0; text-decoration: none; color: var(--text); }
.contact a:hover { color: var(--link); }
.contact small { display: block; font-size: 0.85rem; color: var(--text-3); margin-bottom: 0.2rem; }

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

.job .when, .posts time, .facts dd, .meta dd { font-variant-numeric: tabular-nums; }

@media print {
  .site-head, .site-foot, .toc, .hero-links, .todo { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a, h1, h2, h3, b { color: #000; }
}
