/* ==========================================================================
   Uzair Ahmad — portfolio
   Minimal, monospaced, single column. Light by default, dark on request.
   ========================================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #16161a;
  --body: #4a4a52;
  --muted: #8d8d96;
  --line: #e8e7e3;
  --line-strong: #d8d7d2;
  --accent: #d08700;
  --accent-soft: #fdf3dc;
  --green: #16a34a;
  --green-soft: #e8f6ec;
  --heart: #e0504f;

  --radius: 10px;
  --shell: 640px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace;
}

/* Light is the default for everyone, whatever the browser prefers. Dark
   arrives only by choice: the toggle sets data-theme to "dark", or to
   "system" to hand the decision back to the operating system. */
:root[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #151515;
  --text: #f2f2ef;
  --body: #a9a9a4;
  --muted: #71716d;
  --line: #262626;
  --line-strong: #363636;
  --accent: #f0b429;
  --accent-soft: #2a2009;
  --green: #4ade80;
  --green-soft: #12240f;
  --heart: #f06a69;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0e0e0e;
    --surface: #151515;
    --text: #f2f2ef;
    --body: #a9a9a4;
    --muted: #71716d;
    --line: #262626;
    --line-strong: #363636;
    --accent: #f0b429;
    --accent-soft: #2a2009;
    --green: #4ade80;
    --green-soft: #12240f;
    --heart: #f06a69;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  clip-path: inset(50%);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  clip-path: none;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------- Top bar */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 18px 24px;
  background: var(--bg);
  transition: border-color 0.2s ease, background 0.2s ease;
  border-bottom: 1px solid transparent;
}

.top-bar.scrolled {
  border-bottom-color: var(--line);
}

.brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand-slashes {
  color: var(--accent);
}

/* ----------------------------------------------------------------- Intro */

.intro {
  padding: 40px 0 8px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  object-fit: cover;
  margin-bottom: 22px;
}

.headline {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.name {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.name:hover {
  text-decoration-thickness: 2px;
}

.line {
  margin: 0 0 4px;
}

.flag {
  font-style: normal;
}

.nowrap {
  white-space: nowrap;
}

/* --------------------------------------------------------------- Buttons */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--muted);
}

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  border-color: var(--text);
  opacity: 0.9;
}

/* ---------------------------------------------------------------- Status */

.status {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* -------------------------------------------------------------- Sections */

.section {
  padding: 40px 0 0;
}

.label {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  margin: 0 0 16px;
}

.underline-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.underline-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ----------------------------------------------------------------- Chips */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-link {
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chip-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

/* The sprite only holds <symbol> defs; it must never take up space. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  /* Marks that are black in their brand guidelines inherit the text colour
     instead, so they stay legible in the dark theme. */
  fill: var(--mark, currentColor);
}

/* -------------------------------------------------------------- Projects */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 6px 20px -12px rgba(0, 0, 0, 0.35);
}

.card-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.card-arrow {
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.card:hover .card-arrow,
.card:focus-within .card-arrow {
  opacity: 1;
  transform: none;
  color: var(--accent);
}

.card-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--body);
}

/* A link inside a card's text sits above the full-card overlay link, so it
   opens its own page rather than the project's. */
.card-inline-link {
  position: relative;
  z-index: 2;
  text-underline-offset: 3px;
}

.badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(125, 125, 125, 0.12);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-active,
.badge-live {
  background: var(--green-soft);
  color: var(--green);
}

/* ------------------------------------------------------------- Education */

/* Not a link, so it shouldn't lift on hover like the project cards. */
.card-static:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.edu-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.edu-logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.edu-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.edu-head .badge {
  align-self: flex-start;
}

/* Inverted so the grade stands out against the card. */
.badge-strong {
  background: var(--text);
  color: var(--bg);
}

.edu-achievements {
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--body);
}

.edu-achievements li::marker {
  color: var(--accent);
}

/* ---------------------------------------------------------------- Footer */

.site-footer {
  margin-top: 56px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  justify-content: space-between;
}

.heart {
  color: var(--heart);
}

.theme-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(125, 125, 125, 0.1);
}

.theme-toggle button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------- Project pages */

.project-page {
  padding-top: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent);
}

.project-hero {
  padding: 28px 0 4px;
}

.project-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.project-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* The badge sits next to the title here, not pushed to the far edge. */
.project-title-row .badge {
  margin-left: 0;
}

.project-summary {
  max-width: 52ch;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--body);
}

.project-hero .button-row {
  margin-bottom: 0;
}

.btn .icon {
  width: 14px;
  height: 14px;
}

/* A framed player: the surface border matches the cards, the inner radius
   keeps the video's corners from poking out. */
.project-demo {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.45);
}

.project-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
}

.project-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.project-next .label {
  margin: 0;
}

.project-next-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.project-next-link:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------- Small print */

@media (max-width: 560px) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .headline {
    font-size: 17px;
  }

  .button-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
