/* mustafaomran.com: "Morning Paper" look. Serif headings, rules instead of boxes.
   Cream by default, dark when the system asks for it or the toggle says so. */
:root {
  --bg: #f4efe6;
  --surface: #faf7f1;
  --raised: #fffdf9;
  --text: #1c1814;
  --text-2: #332e28;
  --muted: #5e5648;
  --line: rgba(28, 24, 20, .14);
  --line-2: rgba(28, 24, 20, .26);
  --rule: #1c1814;
  --field: rgba(28, 24, 20, .045);
  --accent: #1f5fa8;
  --accent-soft: rgba(31, 95, 168, .1);
  --amber: #8a5a10;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --wrap: 1080px;
  --narrow: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110f; --surface: #181613; --raised: #221e19; --text: #ede7dd; --text-2: #cfc7ba;
    --muted: #9b9386; --line: rgba(237, 231, 221, .1); --line-2: rgba(237, 231, 221, .2); --rule: #ede7dd;
    --field: rgba(237, 231, 221, .05); --accent: #8ab8f0; --accent-soft: rgba(138, 184, 240, .12); --amber: #e0b56a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13110f; --surface: #181613; --raised: #221e19; --text: #ede7dd; --text-2: #cfc7ba;
  --muted: #9b9386; --line: rgba(237, 231, 221, .1); --line-2: rgba(237, 231, 221, .2); --rule: #ede7dd;
  --field: rgba(237, 231, 221, .05); --accent: #8ab8f0; --accent-soft: rgba(138, 184, 240, .12); --amber: #e0b56a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--field); padding: .1em .35em; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: var(--narrow); }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.brand { font-family: var(--serif); font-size: 21px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
/* Signature: the SVG is a mask, filled with the text color so it follows light/dark */
.brand { display: flex; align-items: center; }
.sig {
  display: block; width: 128px; height: 55px; background: var(--text);
  -webkit-mask: url(../img/signature.svg) center / contain no-repeat;
  mask: url(../img/signature.svg) center / contain no-repeat;
  transition: opacity .2s ease;
}
.brand:hover .sig { opacity: .7; }
@media (min-width: 720px) { .sig { width: 156px; height: 66px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav a { color: var(--text-2); }
.nav a:hover { color: var(--text); }
.nav .hide-sm { display: none; }
@media (min-width: 720px) { .nav .hide-sm { display: inline; } }
.theme-btn {
  border: 1px solid var(--line-2); background: none; color: var(--text-2); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; padding: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--text); }
.theme-btn svg { width: 15px; height: 15px; }

/* Hero */
.hero { padding: 64px 0 40px; border-bottom: 2px solid var(--rule); }
.kicker { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.hero h1 { font-size: clamp(44px, 9vw, 84px); line-height: 1; }
.hero .lede { font-family: var(--serif); font-size: clamp(20px, 3vw, 26px); color: var(--text-2); margin: 18px 0 0; max-width: 46ch; line-height: 1.3; }
.hero .intro { max-width: 60ch; color: var(--text-2); margin: 22px 0 0; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); font-size: 14px; background: transparent;
}
.btn:hover { border-color: var(--text); text-decoration: none; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { opacity: .88; }
.btn svg { width: 15px; height: 15px; }

/* Sections */
.section { padding: 56px 0; border-bottom: 1px solid var(--line); }
[id] { scroll-margin-top: 84px; }
.section:last-of-type { border-bottom: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(28px, 4.5vw, 40px); }
.section-head p { color: var(--muted); margin: 0; max-width: 46ch; font-size: 15px; }

/* Feature (LINDA) */
.feature { display: grid; gap: 28px; padding-bottom: 36px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
@media (min-width: 900px) { .feature { grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; } }
.feature h3 { font-size: clamp(30px, 4.5vw, 44px); margin: 8px 0 14px; }
.feature h3 a { color: var(--text); }
.feature .summary { font-size: 17px; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 20px 0; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat b { display: block; font: 500 26px/1.1 var(--serif); }
.stat span { font-size: 12px; color: var(--muted); }
.diagram-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }

/* Project rows */
.meta { font: 12px/1.5 var(--mono); color: var(--muted); letter-spacing: .02em; }
.meta .sep { margin: 0 6px; opacity: .6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.tags li { font: 11.5px/1 var(--mono); color: var(--text-2); border: 1px solid var(--line-2); padding: 5px 8px; border-radius: 999px; }
.more { font-size: 14px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; gap: 6px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
@media (min-width: 800px) { .row { grid-template-columns: 220px 1fr; } }
.row h3 { font-size: 25px; margin-bottom: 6px; }
.row h3 a { color: var(--text); }
.row h3 a:hover { color: var(--accent); text-decoration: none; }
.row p { color: var(--text-2); margin: 0; max-width: 62ch; }

/* Card grid (Harvard) */
.grid { display: grid; gap: 28px 24px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; flex-direction: column; color: var(--text); }
.card:hover { text-decoration: none; }
.card .thumb { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--field); border: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .thumb.blank { display: grid; place-items: center; color: var(--muted); font: 12px var(--mono); }
.card h3 { font-size: 21px; margin: 14px 0 4px; }
.card:hover h3 { color: var(--accent); }
.card p { font-size: 14.5px; color: var(--text-2); margin: 6px 0 0; }

/* Unified project grid: every card leads with a line diagram */
.pgrid { display: grid; gap: 44px 28px; grid-template-columns: 1fr; margin-top: 36px; }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
.pcard { display: flex; flex-direction: column; min-width: 0; }
.pthumb {
  display: block; aspect-ratio: 5 / 4; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .2s ease;
}
.pthumb svg { width: 100%; height: 100%; }
a.pthumb:hover { border-color: var(--accent); }
.pcard .meta { margin-top: 14px; }
.pcard h3 { font-size: 23px; margin: 6px 0 8px; }
.pcard h3 a { color: var(--text); }
.pcard h3 a:hover { color: var(--accent); text-decoration: none; }
.pcard > p { color: var(--text-2); font-size: 15px; margin: 0; }
.pcard .more { margin-top: 12px; font-size: 14px; }
.pcard .more .sep { margin: 0 8px; color: var(--muted); }
.facts { list-style: none; margin: 14px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.facts b { font: 500 16px/1.2 var(--serif); color: var(--text); margin-right: 3px; }
/* Project illustrations: thin ink lines on a faint blueprint grid */
.ill { width: 100%; height: 100%; display: block; }
.ill .gridline { fill: none; stroke: var(--line); stroke-width: .6; }
.ill .ln { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ill .ln2 { fill: none; stroke: var(--muted); stroke-width: 1; stroke-linecap: round; }
.ill .ln2.faint { opacity: .35; }
.ill .ac { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ill .ac.thick { stroke-width: 2.6; }
.ill .pf { fill: var(--raised); }
.ill .af { fill: var(--accent); stroke: none; }
.ill .sf { fill: var(--accent-soft); stroke: none; }
.ill .dash { stroke-dasharray: 4 5; }
.ill text { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.ill .t { fill: var(--muted); }
.ill .ta { fill: var(--accent); }
.ill .tb { fill: var(--bg); font-size: 9.5px; font-weight: 500; }
.ill .big { font-size: 24px; font-family: var(--serif); }
.diagram.mini .label { font-size: 12.5px; }
.diagram.mini .sub { font-size: 10.5px; }
.diagram .cone { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.diagram .ring { fill: none; stroke: var(--line-2); stroke-dasharray: 3 4; }
.diagram .cut { fill: var(--raised); stroke: var(--line-2); stroke-width: 1.2; }
.diagram .dim-line { stroke: var(--accent); stroke-width: 1; fill: none; }
.more .sep { margin: 0 8px; color: var(--muted); }

/* Skills + pubs */
.skills { display: grid; gap: 0; margin: 0; }
.skills > div { display: grid; gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .skills > div { grid-template-columns: 200px 1fr; } }
.skills dt { font-family: var(--serif); font-size: 18px; }
.skills dd { margin: 0; color: var(--text-2); }
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--text-2); padding-left: 1.6em; text-indent: -1.6em; }
.pubs li:last-child { border-bottom: 0; }
.pubs a { word-break: break-word; }

/* About */
.about { display: grid; gap: 28px; align-items: start; }
@media (min-width: 800px) { .about { grid-template-columns: 1fr 240px; gap: 48px; } }
.about img { border-radius: 12px; border: 1px solid var(--line); width: 100%; max-width: 240px; aspect-ratio: 3/4; object-fit: cover; }
.about p { color: var(--text-2); font-size: 17px; max-width: 60ch; }

/* Footer */
.footer { border-top: 2px solid var(--rule); padding: 36px 0 48px; margin-top: 24px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: baseline; }
.footer h2 { font-size: 28px; }
.footer .links { margin-top: 0; }
.footer small { display: block; color: var(--muted); margin-top: 18px; width: 100%; font-size: 13px; }

/* Project article pages */
.crumbs { font: 12.5px var(--mono); color: var(--muted); padding-top: 28px; }
.crumbs a { color: var(--muted); }
.article-head { padding: 22px 0 32px; border-bottom: 2px solid var(--rule); }
.article-head h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.04; margin: 10px 0 16px; }
.article-head .dek { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 23px); color: var(--text-2); line-height: 1.4; max-width: 44ch; margin: 0; }
.article { padding: 40px 0 24px; }
.article h2 { font-size: clamp(26px, 4vw, 34px); margin: 48px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); }
.article h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.article h3 { font-size: 21px; margin: 28px 0 8px; }
.article p, .article li { color: var(--text-2); font-size: 17px; }
.article ul { padding-left: 20px; margin: 0 0 1.2em; }
.article li { margin-bottom: 6px; }
.article li::marker { color: var(--muted); }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 24px 0; }
.callout p { margin: 0; font-size: 16px; }
.figure { margin: 28px 0; }
.figure figcaption { font: 12.5px/1.5 var(--mono); color: var(--muted); margin-top: 10px; }
.figure.shot img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: #0b0d10; }
.article-head + .figure.shot { margin: 32px 0 0; }
.shot-pair { display: grid; gap: 20px; margin: 28px 0; align-items: start; }
.shot-pair .figure { margin: 0; }
@media (min-width: 640px) { .shot-pair { grid-template-columns: 0.42fr 1fr; } }
.feature-shot { display: block; }
.feature-shot img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.feature-shot figcaption { font: 12px/1.5 var(--mono); color: var(--muted); margin-top: 8px; }
.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
td { color: var(--text-2); }
.next { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px 0; border-top: 1px solid var(--line); margin-top: 32px; font-size: 15px; }

/* Diagram (inline SVG) */
.diagram text { font-family: var(--sans); fill: var(--text); }
.diagram .sub { fill: var(--muted); font-size: 11px; }
.diagram .box { fill: var(--raised); stroke: var(--line-2); }
.diagram .box.hl { stroke: var(--accent); stroke-width: 1.5; }
.diagram .box.dim { fill: var(--field); }
.diagram .arrow { stroke: var(--muted); stroke-width: 1.2; fill: none; }
.diagram .head { fill: var(--muted); }
.diagram .label { font-weight: 600; font-size: 13.5px; }
.diagram .tag { font-family: var(--mono); font-size: 10px; fill: var(--accent); letter-spacing: .06em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card .thumb img { transition: none; }
}
