/* ============================================================
   Muhammad Abid — Portfolio
   warm editorial dark
   ============================================================ */

:root {
  /* accent hue drives everything */
  --h: 225;
  --c: 0.018;

  /* base — deep navy default */
  --bg: oklch(0.18 0.025 235);
  --bg-elev: oklch(0.22 0.028 235);
  --bg-card: oklch(0.24 0.030 235);
  --line: oklch(0.36 0.030 235);
  --line-soft: oklch(0.27 0.028 235);

  /* fg */
  --fg: oklch(0.96 0.012 220);
  --fg-mute: oklch(0.74 0.030 220);
  --fg-dim: oklch(0.58 0.030 220);

  /* spotlight (updated by JS) */
  --mx: 50%;
  --my: 50%;

  /* accent — matches TWEAK_DEFAULTS #7DD3FC (cyan), overridable via JS */
  --accent: oklch(0.86 0.10 225);
  --accent-soft: oklch(0.86 0.10 225 / 0.16);
  --accent-line: oklch(0.86 0.10 225 / 0.36);

  /* type */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* alt pair (Tweaks) */
  --f-display-alt: "Newsreader", "Georgia", serif;
  --f-body-alt: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
  overflow-x: hidden;
}

/* selection */
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

/* grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.8 0 0 0 0.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

/* warm vignette */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60vw 50vh at 80% 10%, oklch(0.78 0.13 65 / 0.06), transparent 60%),
    radial-gradient(50vw 50vh at 0% 100%, oklch(0.78 0.13 65 / 0.04), transparent 60%);
}

/* cursor spotlight */
.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mx) var(--my),
    color-mix(in oklab, var(--accent) 18%, transparent),
    transparent 60%
  );
  transition: opacity 240ms ease;
}
.spotlight.off { opacity: 0; }

/* light theme overrides */
html[data-font-pair="playfair"] {
  --f-display: "Playfair Display", Georgia, serif;
  --f-body: "IBM Plex Sans", ui-sans-serif, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
}
html[data-font-pair="playfair"] .sb-name,
html[data-font-pair="playfair"] .subpage-h1 { font-weight: 700; letter-spacing: -0.025em; }
html[data-font-pair="playfair"] .sb-name em,
html[data-font-pair="playfair"] .subpage-h1 em,
html[data-font-pair="playfair"] .accent { font-style: italic; font-weight: 500; }
html[data-font-pair="playfair"] body { font-weight: 300; }
html[data-font-pair="playfair"] .about p,
html[data-font-pair="playfair"] .work-desc,
html[data-font-pair="playfair"] .exp-bullets li,
html[data-font-pair="playfair"] .post-desc,
html[data-font-pair="playfair"] .outcome-text,
html[data-font-pair="playfair"] .cs-body { font-weight: 300; }
html[data-font-pair="playfair"] .sb-title,
html[data-font-pair="playfair"] .eyebrow,
html[data-font-pair="playfair"] .num-label,
html[data-font-pair="playfair"] .exp-period,
html[data-font-pair="playfair"] .post-meta,
html[data-font-pair="playfair"] .teach-proof,
html[data-font-pair="playfair"] .sb-meta { font-family: "IBM Plex Sans", ui-sans-serif, sans-serif; font-style: italic; font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: 12px; }
html[data-font-pair="playfair"] .sb-nav a { font-family: "IBM Plex Sans", ui-sans-serif, sans-serif; font-style: italic; font-weight: 400; letter-spacing: 0.04em; text-transform: none; font-size: 13px; }
html[data-font-pair="playfair"] .tag { font-style: italic; }
html[data-font-pair="playfair"] .sb-tagline { font-weight: 400; }

html[data-theme="light"] {
  --bg: oklch(0.97 calc(var(--c) * 0.5) var(--h));
  --bg-elev: oklch(0.94 calc(var(--c) * 0.5) var(--h));
  --bg-card: oklch(0.92 calc(var(--c) * 0.6) var(--h));
  --line: oklch(0.80 calc(var(--c) * 0.7) var(--h));
  --line-soft: oklch(0.88 calc(var(--c) * 0.5) var(--h));
  --fg: oklch(0.18 var(--c) var(--h));
  --fg-mute: oklch(0.38 var(--c) var(--h));
  --fg-dim: oklch(0.55 var(--c) var(--h));
}
html[data-theme="light"] .spotlight {
  background: radial-gradient(600px circle at var(--mx) var(--my), color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
  mix-blend-mode: multiply;
}
html[data-theme="light"] .exp-entry:hover,
html[data-theme="light"] .work-card:hover,
html[data-theme="light"] .post-card:hover { background: oklch(0.91 0.008 75); }
html[data-theme="light"] .num-value .plus,
html[data-theme="light"] .sb-name em,
html[data-theme="light"] .accent { color: oklch(0.55 0.14 50); }

/* ===== layout ===== */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 64px;
  gap: 80px;
}

@media (max-width: 1100px) {
  .shell { padding: 0 40px; gap: 56px; grid-template-columns: minmax(340px, 40%) 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 28px; }
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 96px 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (max-width: 860px) {
  .sidebar { position: static; height: auto; padding: 64px 0 32px; }
}

.sb-top { display: flex; flex-direction: column; gap: 28px; }

.sb-name {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(48px, 5.2vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}

.sb-name em {
  font-style: italic;
  color: var(--accent);
}

.sb-title {
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-mute);
  margin: 0;
}

.sb-tagline {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.35;
  color: var(--fg-mute);
  max-width: 340px;
  margin: 0;
  text-wrap: pretty;
}

.sb-tagline .accent { color: var(--accent); font-style: normal; }

/* status pill */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  width: fit-content;
}
.status::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: oklch(0.78 0.16 145);
  box-shadow: 0 0 0 3px oklch(0.78 0.16 145 / 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.sb-hire-btn {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 180ms ease;
}
.sb-hire-btn:hover { opacity: 0.75; }

/* nav */
.sb-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; }
@media (max-width: 860px) { .sb-nav { display: none; } }
@media (max-width: 860px) { .sb-copy { display: none; } }

.sb-nav a {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  width: fit-content;
  transition: color 220ms ease, gap 220ms ease;
}
.sb-nav a .bar {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--fg-dim);
  transition: width 280ms cubic-bezier(.2,.7,.2,1), background 220ms ease;
}
.sb-nav a:hover, .sb-nav a:focus-visible { color: var(--fg); outline: none; }
.sb-nav a:hover .bar { width: 56px; background: var(--fg); }
.sb-nav a.active { color: var(--fg); }
.sb-nav a.active .bar { width: 64px; background: var(--accent); }

/* socials */
.sb-socials { display: flex; gap: 18px; margin-top: 32px; }
.sb-socials a {
  color: var(--fg-dim);
  display: inline-flex;
  width: 22px; height: 22px;
  transition: color 200ms ease, transform 200ms ease;
}
.sb-socials a:hover { color: var(--fg); transform: translateY(-2px); }
.sb-socials a svg { width: 100%; height: 100%; }

.sb-bottom { display: flex; flex-direction: column; gap: 18px; }

.sb-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.sb-copy {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: oklch(0.42 0.015 235);
}

/* ===== RIGHT CONTENT ===== */
.main {
  padding: 96px 0 120px;
  max-width: 640px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .work-card { grid-template-columns: 130px 1fr; gap: 18px; }
  .exp-entry { grid-template-columns: 110px 1fr; gap: 20px; }
}
@media (max-width: 860px) {
  .main { padding: 40px 0 80px; max-width: 100%; }
}

section { padding: 56px 0; scroll-margin-top: 40px; }
section:first-of-type { padding-top: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 32px;
}
.eyebrow .num { color: var(--accent); }
.eyebrow .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
  max-width: 80px;
}

/* "sticky" section labels — visible only when section near top */
.section-label-sticky {
  display: none;
}

/* ===== ABOUT ===== */
.about p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg-mute);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.about p strong, .about p .hl {
  color: var(--fg);
  font-weight: 500;
}
.about p .accent { color: var(--accent); font-weight: 500; }
.about-quote {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 26px;
  line-height: 1.3;
  color: var(--fg);
  border-left: 1px solid var(--accent-line);
  padding-left: 22px;
  margin: 28px 0 28px;
}
.about-quote .accent { color: var(--accent); font-style: normal; }

/* ===== NUMBERS ===== */
.numbers {
  display: flex;
  justify-content: center;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
@media (max-width: 1100px) {
  .num-value { font-size: 34px; }
  .num-cell { padding: 6px 24px; }
}
@media (max-width: 720px) {
  .numbers { padding: 16px 0; }
  .num-value { font-size: 22px; }
  .num-cell { flex: 1; padding: 6px 8px; text-align: center; align-items: center; min-width: 0; }
  .num-cell:first-child { padding-left: 8px; }
}
.num-cell {
  padding: 6px 48px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.num-cell:last-child { border-right: none; }
.num-cell:first-child { padding-left: 48px; }
.num-value {
  font-family: var(--f-display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.num-value .plus { color: var(--accent); font-style: italic; }
.num-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  line-height: 1.4;
}

/* ===== EXPERIENCE ===== */
.exp-list { display: flex; flex-direction: column; gap: 0; }

.exp-entry {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 28px;
  padding: 28px 16px;
  margin: 0 -16px;
  border-radius: 6px;
  position: relative;
  transition: background 240ms ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.exp-entry:hover {
  background: oklch(0.22 0.01 60 / 0.5);
}
.exp-entry:hover .exp-role { color: var(--accent); }
.exp-entry:hover .arrow-ne { transform: translate(2px, -2px); color: var(--accent); }

@media (max-width: 720px) { .exp-entry { grid-template-columns: 1fr; gap: 10px; } }

.exp-period {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding-top: 5px;
  line-height: 1.5;
}

.exp-role {
  font-family: var(--f-display);
  font-size: 24px;
  line-height: 1.2;
  color: var(--fg);
  margin: 0 0 4px;
  transition: color 200ms ease;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}
.exp-company {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--fg-mute);
  margin: 0 0 14px;
}
.exp-company .arrow-ne {
  display: inline-block;
  margin-left: 4px;
  transition: transform 200ms ease, color 200ms ease;
}
.exp-bullets {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-bullets li {
  font-size: 14.5px;
  color: var(--fg-mute);
  position: relative;
  padding-left: 18px;
  line-height: 1.55;
}
.exp-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  width: fit-content;
  transition: color 200ms ease, border-color 200ms ease, gap 200ms ease;
}
.btn-text:hover { color: var(--accent); border-color: var(--accent-line); gap: 14px; }
.btn-text .arr { transition: transform 200ms ease; }
.btn-text:hover .arr { transform: translateX(3px); }

/* ===== WORK ===== */
.work-list { display: flex; flex-direction: column; gap: 0; }

.work-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px 16px;
  margin: 0 -16px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: background 240ms ease;
}
.work-card:hover { background: var(--bg-elev); }
.work-card:hover .work-title { color: var(--accent); }
.work-card:hover .work-thumb { border-color: var(--accent-line); }
.work-card:hover .arrow-ne { transform: translate(3px, -3px); color: var(--accent); }
@media (max-width: 720px) { .work-card { grid-template-columns: 1fr; } }

.work-thumb {
  aspect-ratio: 9 / 14;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  overflow: hidden;
  position: relative;
  transition: border-color 240ms ease;
}
.work-thumb .phone {
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, oklch(0.23 0.012 60), oklch(0.18 0.008 60));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.work-thumb .phone::before {
  content: "";
  position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 5px; border-radius: 4px;
  background: oklch(0.12 0.005 60);
}

/* Web thumb — browser chrome */
.work-thumb--web { background: oklch(0.16 0.02 225); }
.browser-chrome {
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.browser-bar {
  background: oklch(0.20 0.02 225);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  border-bottom: 1px solid oklch(0.28 0.02 225);
}
.browser-dots { display: flex; gap: 4px; }
.browser-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(0.38 0.01 225);
}
.browser-url {
  flex: 1;
  background: oklch(0.15 0.02 225);
  border-radius: 3px;
  padding: 2px 7px;
  font-family: var(--f-mono);
  font-size: 7.5px;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Real screenshot previews: remove fake browser padding so image uses more height */
.work-thumb--image .browser-chrome {
  inset: 0;
  border-radius: 0;
}
.work-thumb--image .browser-content {
  background: oklch(0.10 0.01 230);
}

/* Web card in homepage work list — title+badge top row, image+desc bottom row */
.work-list .work-card--web {
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 12px 24px;
}
.work-list .work-card--web .work-content { display: contents; }
.work-list .work-card--web .work-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.work-list .work-card--web .work-thumb {
  grid-column: 1;
  grid-row: 2;
  aspect-ratio: 16 / 10;
}
.work-list .work-card--web .work-desc {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}
.work-list .work-card--web .tag-row { display: none; }
@media (max-width: 640px) {
  .work-list .work-card--web {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .work-list .work-card--web .work-head { grid-column: 1; }
  .work-list .work-card--web .work-thumb { grid-column: 1; grid-row: 2; }
  .work-list .work-card--web .work-desc  { grid-column: 1; grid-row: 3; }
}

/* Game thumb */
.work-thumb--game { background: transparent; border-color: transparent; }
.game-tile {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Data thumb */
.work-thumb--data { background: oklch(0.15 0.025 225); }
.data-tile {
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  background: oklch(0.17 0.025 225);
  border: 1px solid oklch(0.28 0.02 225);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.data-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 14px;
  flex: 1;
}
.data-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}

.work-title {
  font-family: var(--f-body);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: var(--fg);
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  transition: color 200ms ease;
}
.work-title .arrow-ne {
  color: var(--fg-dim);
  flex-shrink: 0;
  transition: transform 200ms ease, color 200ms ease;
}
.work-card:hover .arrow-ne { transform: translate(3px, -3px); color: var(--accent); }

.work-content {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.work-head {
  position: relative;
  padding-right: 170px;
}

.status-badge {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  position: absolute;
  top: 0;
  right: 0;
}
.status-badge.live {
  color: oklch(0.86 0.16 145);
  background: oklch(0.86 0.16 145 / 0.12);
}
.status-badge.dev {
  color: oklch(0.85 0.14 75);
  background: oklch(0.85 0.14 75 / 0.12);
}
.status-badge.exp {
  color: oklch(0.82 0.12 320);
  background: oklch(0.82 0.12 320 / 0.12);
}
.status-badge::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
}

@media (max-width: 820px) {
  .work-head {
    padding-right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .status-badge {
    position: static;
    margin-top: 3px;
    flex-shrink: 0;
  }
}

.work-desc {
  font-size: 15px;
  color: var(--fg-mute);
  margin: 10px 0 6px;
  line-height: 1.55;
}
.work-mentor {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 13px;
  color: var(--fg-dim);
  margin: 6px 0 12px;
  line-height: 1.5;
}
.work-mentor::before { content: "“"; color: var(--accent); margin-right: 2px; }
.work-mentor::after { content: "”"; color: var(--accent); margin-left: 2px; }

/* ===== TEACHING ===== */
.teach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}
@media (max-width: 720px) { .teach-grid { grid-template-columns: repeat(2, 1fr); } }

.teach-cell {
  background: var(--bg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 200ms ease;
  cursor: default;
  min-height: 88px;
  justify-content: space-between;
}
.teach-cell:hover { background: var(--bg-elev); }
.teach-cell:hover .teach-name { color: var(--accent); }

.teach-name {
  font-family: var(--f-display);
  font-size: 20px;
  color: var(--fg);
  line-height: 1.1;
  transition: color 200ms ease;
}
.teach-proof {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}
@media (max-width: 720px) { .outcome-grid { grid-template-columns: 1fr; } }

.outcome-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 240ms ease, transform 240ms ease;
}
.outcome-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.outcome-icon {
  font-family: var(--f-display);
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}
.outcome-text {
  font-size: 14px;
  color: var(--fg-mute);
  line-height: 1.45;
}

.cred-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.cred-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  padding: 8px 12px;
  border-radius: 999px;
}
.cred-badge .star { color: var(--accent); }
.retention-line {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 15px;
  color: var(--fg-mute);
}

/* ===== WRITING ===== */
.writing-list { display: flex; flex-direction: column; }

.post-card {
  display: grid;
  grid-template-columns: 100px 1fr 24px;
  gap: 20px;
  align-items: center;
  padding: 20px 16px;
  margin: 0 -16px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line-soft);
  transition: background 240ms ease;
  cursor: pointer;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: oklch(0.22 0.01 60 / 0.55); }
.post-card:hover .post-title { color: var(--accent); }
.post-card:hover .arr { transform: translateX(4px); color: var(--accent); }

.post-thumb {
  aspect-ratio: 4/3;
  border-radius: 4px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(45deg,
      oklch(0.22 0.01 60) 0 8px,
      oklch(0.19 0.009 60) 8px 16px);
  position: relative;
  overflow: hidden;
}

.post-meta {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 6px;
}
.post-title {
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 4px;
  color: var(--fg);
  transition: color 200ms ease;
}
.post-desc { font-size: 13.5px; color: var(--fg-mute); line-height: 1.45; margin: 0; }
.arr { color: var(--fg-dim); transition: transform 200ms ease, color 200ms ease; }

/* ===== FOOTER ===== */
.foot {
  margin-top: 80px;
  padding-top: 40px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 28px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.foot a { color: var(--fg-mute); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.cta-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 24px;
  text-transform: none;
}
.cta-heading {
  font-family: var(--f-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 18px;
  text-transform: none;
}
.cta-btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.cta-btn {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
  cursor: pointer;
}
.cta-btn--primary {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.cta-btn--primary:hover { background: oklch(0.78 0.13 225 / 0.22) !important; color: var(--accent) !important; }
.cta-btn--secondary {
  color: var(--fg-mute);
  background: transparent;
  border-color: var(--line);
}
.cta-btn--secondary:hover { background: var(--bg-card) !important; color: var(--fg) !important; }
.foot-cta {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent) !important;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 12px 22px;
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease;
  align-self: flex-start;
}
.foot-cta:hover { background: oklch(0.78 0.13 175 / 0.18) !important; color: var(--accent) !important; }
.foot-mobile-socials {
  display: none;
  gap: 20px;
}
.foot-mobile-socials a {
  color: var(--fg-dim);
  width: 20px;
  height: 20px;
  transition: color 200ms ease;
}
.foot-mobile-socials a:hover { color: var(--fg); }
.foot-mobile-socials a svg { width: 100%; height: 100%; }
.foot-mobile-copy { display: none; }
@media (max-width: 860px) {
  .foot-mobile-socials { display: flex; }
}

/* ===== reveal anim ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 380ms cubic-bezier(.2,.7,.2,1), transform 380ms cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== top-of-page header (logo + back link, used on subpages) ===== */
.subpage-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 48px 120px;
  position: relative;
  z-index: 2;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-mute);
  text-decoration: none;
  margin-bottom: 40px;
}
.back-link:hover { color: var(--accent); }

.subpage-h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(30px, 3.8vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.subpage-sub {
  font-family: var(--f-body);
  font-style: normal;
  font-size: 15px;
  color: var(--fg-mute);
  margin: 0 0 44px;
  line-height: 1.5;
}

/* /work filter tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}
.filter-tabs button {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-mute);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 200ms ease;
}
.filter-tabs button:hover { color: var(--fg); border-color: var(--fg-dim); }
.filter-tabs button.active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) { .proj-grid { grid-template-columns: 1fr; } }
@media (max-width: 460px) {
  .proj-grid .status-badge { font-size: 0; padding: 5px; gap: 0; }
  .proj-grid .status-badge::before { width: 8px; height: 8px; }
}
.proj-grid .work-card {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  grid-template-columns: 200px 1fr;
  grid-template-rows: 1fr;
  padding: 20px;
  gap: 20px;
  align-items: start;
  overflow: hidden;
}
.proj-grid .work-card:hover { border-color: var(--accent-line); background: var(--bg-card); }
.proj-grid .work-card .work-thumb {
  aspect-ratio: 9 / 19.5;
  border-radius: 8px;
  border: 1px solid var(--line);
  width: 100%;
}
.proj-grid .work-card .work-content {
  padding: 0;
  min-width: 0;
}
.proj-grid .work-card .work-head {
  padding-right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.proj-grid .work-card .status-badge {
  position: static;
  margin-top: 2px;
  flex-shrink: 0;
}
.proj-grid .work-card .work-title {
  font-size: 15px;
  font-weight: 600;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: block;
}

/* Wide card — web projects (full-width, side-by-side with larger image) */
.proj-grid .work-card--web {
  grid-column: 1 / -1;
  grid-template-columns: 320px 1fr;
}
.proj-grid .work-card--web .work-thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
}
.proj-grid .work-card--web .browser-chrome {
  border-radius: 6px;
}
.proj-grid .work-card--web .browser-bar {
  padding: 8px 12px;
}

/* Medium screens: stack web card content earlier to avoid narrow text columns */
@media (max-width: 1060px) {
  .proj-grid .work-card--web {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .proj-grid .work-card--web .work-thumb {
    aspect-ratio: 16 / 9;
  }
}

/* Hero hidden at desktop — only visible in mobile (text-below) layout */
.phone-thumb-hero { display: none; }

/* Smaller screens: make every work card single-column for readability */
@media (max-width: 900px) {
  .proj-grid .work-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .proj-grid .work-card .work-thumb {
    aspect-ratio: 16 / 10;
  }
  /* Show hero image and hide phone frame only when a hero is available */
  .proj-grid .work-card .work-thumb.has-hero .phone-thumb-hero { display: block; }
  .proj-grid .work-card .work-thumb.has-hero .phone-thumb-ss { display: none; }
  /* Fallback: if no hero, phone frame fills the card */
  .proj-grid .work-card .work-thumb .phone {
    inset: 0;
    border-radius: 0;
  }
  .proj-grid .work-card .work-thumb .phone::before {
    display: none;
  }
}

/* tweaks button styling override */
[data-tweaks-toggle] {}
