/* ---------------------------------------------------------------
   Mahd Qureshi — personal site
   Single stylesheet. No resets pulled in, no external fonts.
   --------------------------------------------------------------- */

:root {
  --bg:        #faf9f7;
  --surface:   #ffffff;
  --text:      #16150f;
  --muted:     #5f5c54;
  --faint:     #8a867c;
  --rule:      #e2ded6;
  --accent:    #b2410c;
  --accent-dim:#f0e6dd;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #131211;
    --surface:   #1b1a18;
    --text:      #ece9e3;
    --muted:     #a5a099;
    --faint:     #7d7871;
    --rule:      #2e2c29;
    --accent:    #f0904f;
    --accent-dim:#2c211a;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- layout ---------------------------------------------------- */

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 7rem) clamp(1.25rem, 5vw, 2rem) 4rem;
}

main > section {
  padding-top: clamp(2.75rem, 6vw, 4rem);
}

p { max-width: var(--measure); }

/* --- skip link ------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

.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;
}

/* --- masthead -------------------------------------------------- */

.masthead h1 {
  font-size: clamp(2rem, 6.5vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
  margin: 0;
}

.tagline {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0.9rem 0 0;
}

.lede {
  font-size: 1.075rem;
  color: var(--muted);
  margin: 1.75rem 0 0;
}

/* --- section markers ------------------------------------------- */

.marker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 1.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
  max-width: none;
}

/* --- projects -------------------------------------------------- */

.project {
  padding: 1.6rem 0 0;
}

.project + .project {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.project-head { margin-bottom: 1.1rem; }

.project h3 {
  font-size: 1.28rem;
  letter-spacing: -0.012em;
  font-weight: 600;
  margin: 0;
}

.badge {
  display: inline-block;
  vertical-align: 0.18em;
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 3px;
  padding: 0.22em 0.5em;
}

.meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  margin: 0.5rem 0 0;
}

.summary {
  font-size: 1.04rem;
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 0 0 1.4rem;
}

.project p { margin: 0 0 1.05rem; }

.muted-note {
  color: var(--muted);
  font-size: 0.94rem;
}

/* --- formula --------------------------------------------------- */

.formula {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.95rem 1.1rem;
  margin: 0 0 1.05rem;
  overflow-x: auto;
  max-width: none;
}

.formula sup { font-size: 0.78em; }

/* --- tags ------------------------------------------------------ */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 1.3rem 0;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.26em 0.6em;
}

/* --- links ----------------------------------------------------- */

a { color: var(--accent); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.3rem 0 0;
}

.links a,
.contact a {
  font-family: var(--mono);
  font-size: 0.84rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}

.links a:hover,
.contact a:hover { border-bottom-color: var(--accent); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- principles ------------------------------------------------ */

.principles {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--measure);
}

.principles li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.95rem;
  color: var(--muted);
}

.principles li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

/* --- contact --------------------------------------------------- */

.contact {
  list-style: none;
  padding: 0;
  margin: 1.3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.contact li { width: fit-content; }

/* --- footer ---------------------------------------------------- */

footer {
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

footer p {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 0;
}

/* --- 404 ------------------------------------------------------- */

.notfound { padding-top: 1rem; }
.notfound h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }

/* --- motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- now --------------------------------------------------------
   A dated list of what is actually happening. Its whole job is to
   prove the page is maintained, so the date is part of the design
   rather than a footnote.
   --------------------------------------------------------------- */

.dateline {
  float: right;
  color: var(--faint);
  letter-spacing: 0.1em;
}

.now {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--measure);
}

.now li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.now li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0.08em;
  color: var(--accent);
  font-size: 0.8em;
}

.now strong {
  color: var(--text);
  font-weight: 600;
}
