/*
 * public/styles.css
 * Nazir Magsi
 *
 * Copyright © 2026 Nazir Magsi. All rights reserved.
 *
 * This source code is proprietary and confidential.
 * Unauthorized copying, modification, or distribution is prohibited.
 *
 * The software is provided "as is", without warranty of any kind.
 */

:root {
  color-scheme: light;
  --ink: #17232b;
  --muted: #58666e;
  --navy: #173f56;
  --navy-deep: #102f41;
  --accent: #a44e36;
  --accent-soft: #e9b3a2;
  --sand: #f3efe8;
  --paper: #fffdf9;
  --line: #dad7d0;
  --card: #f8f5ef;
  --max: 72.5rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --gap: clamp(1.5rem, 4vw, 3.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .92em; }
ul { padding-inline-start: 1.25rem; margin: .75rem 0 0; }
li { margin: .35rem 0; }
p { margin: 0 0 1rem; }
h1, h2 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; }
h1, h2, h3 { color: var(--navy-deep); }
h1 { margin: 0; font-size: clamp(2.5rem, 1.2rem + 4.5vw, 4.875rem); line-height: 1.06; letter-spacing: -.04em; }
h2 { margin: 0; font-size: clamp(1.875rem, 1.35rem + 2vw, 2.875rem); line-height: 1.16; letter-spacing: -.025em; }
h3 { margin: 0 0 .65rem; font-size: 1.375rem; line-height: 1.3; }
.shell { width: calc(100% - var(--gutter) * 2); max-width: var(--max); margin-inline: auto; }
.shell *, .hero__grid > *, .section-title-row > * { min-width: 0; }
.skip-link { position: fixed; z-index: 10; top: .5rem; left: 1rem; padding: .75rem 1rem; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.hero { padding: clamp(2.5rem, 6vw, 4.625rem) 0; background: var(--sand); border-top: 9px solid var(--navy-deep); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; gap: 2rem; align-items: center; }
.hero__toolbar { display: flex; justify-content: flex-end; margin-top: -1rem; margin-bottom: 1.5rem; }
.language-switch { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid #bdc4c4; border-radius: .5rem; }
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .5rem .75rem; border-radius: .25rem; font-size: .8125rem; font-weight: 700; line-height: 1.25; text-decoration: none; }
.language-switch a:hover { background: #e4dfd6; }
.language-switch a[aria-current="page"] { background: var(--navy-deep); color: #fff; }
.eyebrow, .section-no { margin: 0 0 1rem; color: var(--accent); font-size: .75rem; line-height: 1.5; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero__lead { max-width: 42rem; margin: 1.5rem 0 0; font-size: clamp(1.0625rem, .95rem + .4vw, 1.1875rem); line-height: 1.55; color: #354852; }
.hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; border-top: 1px solid #bdc4c4; }
.hero__stats > div { padding-top: 1rem; }
.hero__stats strong { display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 1.875rem; line-height: 1.15; color: var(--navy-deep); }
.hero__stats span { display: block; margin-top: .5rem; font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.hero__portrait { margin: 0 .75rem .75rem 0; width: min(10.625rem, calc(100% - .75rem)); position: relative; }
.hero__portrait::after { content: ""; position: absolute; right: -.75rem; bottom: -.75rem; width: 70%; height: 70%; background: #c86447; }
.hero__portrait img { position: relative; z-index: 1; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; filter: saturate(.82) contrast(1.02); }
.section { padding: clamp(3rem, 6vw, 4.75rem) 0; border-bottom: 1px solid var(--line); }
.split-intro { display: grid; gap: 1.75rem; }
.profile-copy p:last-child { margin-bottom: 0; }
.section-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem var(--gap); align-items: flex-end; margin-bottom: 2rem; }
.section-title-row > div { flex: 1 1 22rem; }
.section-note { flex: 0 1 24rem; margin: 0; color: var(--muted); font-size: .875rem; }
.activity-grid { margin-top: 2rem; border-top: 1px solid var(--line); }
.role-card, .timeline__item, .project-item { display: grid; gap: .75rem var(--gap); padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.role-card__meta, .timeline__date { margin: 0; padding-top: .25rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.role-card h3 { font-size: 1.25rem; }
.role-card__role, .position { font-weight: 700; color: #375467; }
.role-card__location { color: var(--muted); font-size: .875rem; }
.role-card__content > :last-child, .project-item__content > :last-child, .timeline__content > :last-child { margin-bottom: 0; }
.timeline, .project-list { margin-top: 2rem; border-top: 1px solid var(--line); }
.timeline__content p, .project-item p { color: #425058; }
.timeline__content .position { color: var(--navy); }
.software-section { background: var(--navy-deep); color: #ecf2f4; border-bottom: 0; }
.software-section h2, .software-card h3 { color: #fff; }
.software-section .section-no { color: var(--accent-soft); }
.section-title-row--light .section-note { color: #bcc9d0; }
.software-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.125rem; }
.software-card { border: 1px solid #587382; background: #173c51; padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.software-card__tag { display: block; margin-bottom: 1.5rem; color: var(--accent-soft); font-size: .75rem; line-height: 1.5; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; }
.software-card h3 { font-size: 1.3125rem; }
.software-card p, .software-card li { color: #d5e0e5; }
.software-card > :last-child { margin-bottom: 0; }
.software-card--apps { background: #1b465f; }
.project-item__top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; color: var(--muted); font-size: .8125rem; }
.project-item h3 { font-size: 1.5rem; }
.status { display: inline-block; padding: .3rem .6rem; border-radius: 1rem; font-size: .6875rem; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; background: #e7ecef; color: var(--navy); }
.status--active { background: #dfece4; color: #315f46; }
.status--done { background: #ece8df; color: #6b5d3d; }
.status--work { background: #f3e1da; color: #8b432f; }
.graph-line { display: block; margin: .25rem 0 1rem; padding: .8rem 1rem; border-left: 3px solid var(--accent); background: var(--card); font-family: "SFMono-Regular", Consolas, monospace; font-size: .8125rem; line-height: 1.6; }
.section--publications { background: #faf8f3; }
.year-group, .conference-year { display: grid; gap: 1rem var(--gap); margin-top: 2.5rem; }
.year-group__year, .conference-year__label { font-family: "Source Serif 4", Georgia, serif; font-size: 1.75rem; line-height: 1.15; color: var(--accent); font-weight: 700; }
.publication, .conference { padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.publication:last-child, .conference:last-child { margin-bottom: 0; }
.publication__type { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.publication h3 { margin-top: .5rem; font-size: 1.3125rem; }
.publication p, .conference p { margin: .5rem 0; color: #445159; }
.publication a { display: inline-block; padding-block: .35rem; font-size: .875rem; }
.conference h3 { font-size: 1.25rem; }
.conference p.within { color: var(--navy); font-weight: 600; }
.conference__meta { display: flex; gap: .5rem 1.375rem; flex-wrap: wrap; margin-top: .75rem; color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.footer { background: #0e2938; color: #bdc8ce; padding: 1.75rem 0; font-size: .8125rem; }
.footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
/* Screen breakpoints cannot affect the print grid. */
@media screen and (max-width: 27.5em) {
  .hero__stats { grid-template-columns: 1fr; gap: 0; }
  .hero__stats > div { padding: .875rem 0; border-bottom: 1px solid var(--line); }
}
@media screen and (max-width: 39.999em) {
  .hero__portrait { grid-row: 1; }
}
@media screen and (min-width: 40em) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(10rem, 24%); gap: var(--gap); }
  .hero__portrait { width: calc(100% - .75rem); }
  .role-card, .timeline__item, .project-item { grid-template-columns: 9rem minmax(0, 1fr); }
  .project-item__top { flex-direction: column; }
  .year-group, .conference-year { grid-template-columns: 5rem minmax(0, 1fr); }
}
@media screen and (min-width: 64em) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) 16.375rem; gap: 5rem; }
  .split-intro { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 5rem; }
  .role-card, .timeline__item, .project-item { grid-template-columns: 12rem minmax(0, 1fr); }
  .section-note { text-align: right; }
  .year-group, .conference-year { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .year-group__year, .conference-year__label { font-size: 2.125rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@page { size: A4; margin: 13mm 14mm 15mm; }
@media print {
  body { background: white; color: #17232b; font-size: 10pt; line-height: 1.45; }
  .shell { width: 100%; max-width: none; }
  .skip-link, .footer, .hero__toolbar { display: none; }
  .hero { padding: 6mm 0; border-top-width: 2mm; background: white; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) 38mm; gap: 9mm; }
  .hero__portrait { width: 100%; margin: 0; }
  .hero__portrait::after { display: none; }
  h1 { font-size: 29pt; }
  h2 { font-size: 19pt; }
  h3, .role-card h3, .project-item h3, .publication h3, .conference h3, .software-card h3 { font-size: 12pt; }
  .hero__lead { font-size: 11pt; margin-top: 4mm; }
  .hero__stats { margin-top: 4mm; gap: 4mm; }
  .hero__stats strong { font-size: 17pt; }
  .hero__stats span { font-size: 8pt; }
  .section { padding: 7mm 0; }
  .split-intro { gap: 4mm; }
  .section-title-row { display: block; margin-bottom: 4mm; }
  .section-note { margin-top: 2mm; font-size: 9pt; }
  .eyebrow, .section-no, .role-card__meta, .timeline__date { font-size: 8pt; }
  .role-card, .timeline__item, .project-item { grid-template-columns: 30mm minmax(0, 1fr); gap: 5mm; padding: 4mm 0; }
  .project-item__top { flex-direction: column; }
  .software-section, .software-card, .software-card--apps { background: white; color: #17232b; }
  .software-section h2, .software-card h3, .software-card p, .software-card li, .software-card__tag, .section-title-row--light .section-note, .software-section .section-no { color: #17232b; }
  .software-grid { grid-template-columns: 1fr; gap: 3mm; }
  .software-card { padding: 4mm; border-color: #68747b; }
  .software-card__tag { margin-bottom: 2mm; }
  .year-group, .conference-year { grid-template-columns: 20mm minmax(0, 1fr); gap: 5mm; margin-top: 5mm; }
  .year-group__year, .conference-year__label { font-size: 17pt; }
  .publication, .conference { padding-bottom: 4mm; margin-bottom: 4mm; }
  /* Long entries may split; headings stay with the following content. */
  h1, h2, h3, .section-no, .publication__type { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  .hero, .software-card { break-inside: avoid; }
  a { color: inherit; text-decoration: underline; }
}
