/* =========================================================
   Atiq Mehri, AI portfolio
   System fonts, zinc neutrals, one blue (the send button).
   Radius scale: chips 8 / cards 24 / buttons and fields pill.
   ========================================================= */

:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --bg: #ffffff;
  --fg: #09090b;
  --fg-2: #27272a;
  --muted: #71717a;
  --muted-2: #52525b;
  --line: #e4e4e7;
  --line-2: #d4d4d8;
  --soft: #f4f4f5;
  --soft-2: #ececf0;
  --blue: #0171e3;
  --ok: #16a34a;

  --tone-teal: #0d9488;
  --tone-green: #16a34a;
  --tone-violet: #7c3aed;
  --tone-pink: #db2777;
  --tone-orange: #ea580c;

  --col: clamp(768px, 50vw, 920px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(1, 113, 227, 0.2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.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; }
.ico { flex: none; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 18px; border-radius: 999px; background: var(--fg); color: #fff; text-decoration: none; font-size: 14px; }
.skip:focus { top: 16px; outline-offset: 3px; }

/* ---------- pill in the top-left corner ---------- */
.top-pill {
  position: fixed;
  z-index: 20;
  top: 32px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 10px 16px 10px 14px;
  border: 0.8px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.12s var(--ease);
}
.top-pill:hover { background: #fafafa; border-color: var(--line-2); }
.top-pill:active { transform: scale(0.98); }
.mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--fg);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}
.top-pill .ico { color: var(--muted); }

/* ---------- the question field, shared ---------- */
.ask {
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ask input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}
.ask input::placeholder { color: var(--muted); opacity: 1; }
.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  transition: opacity 0.2s, transform 0.12s var(--ease), background 0.2s;
}
.send:hover { background: #0267cc; }
.send:active { transform: scale(0.94); }
.ask.is-empty .send { opacity: 0.7; }
.send:disabled { cursor: not-allowed; opacity: 0.5; }

/* ---------- landing ---------- */
.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* the name behind the page: sized so the whole of it fits the screen's width, and
     given its own strip at the bottom so nothing covers it */
  --wm: min(17.5vw, 14vh, 260px);
  padding: clamp(14px, 3vh, 56px) 16px calc(var(--wm) * 1.16);
  text-align: center;
  overflow: hidden;
}
.landing > *:not(.watermark) { position: relative; z-index: 1; }

.about-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(46px, 7vh, 58px);
  height: clamp(46px, 7vh, 58px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px -8px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.about-tile .mark { width: 60%; height: 60%; border-radius: 10px; font-size: 13px; }
.about-tile:hover { transform: translateY(-2px) rotate(-3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 24px -10px rgba(0, 0, 0, 0.28); }

.hello { margin-top: clamp(6px, 1.4vh, 14px); font-size: clamp(17px, min(4.6vw, 2.9vh), 28px); line-height: 1.4; font-weight: 600; color: var(--fg-2); }
.display {
  font-size: clamp(34px, min(10vw, 9.6vh), 88px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero-portrait {
  position: relative;
  flex: none;
  width: clamp(112px, min(46vw, 30vh), 312px);
  aspect-ratio: 1;
  margin: clamp(16px, 3.6vh, 40px) 0 clamp(16px, 3.4vh, 38px);
  border-radius: 50%;
  padding: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 28px 60px -24px rgba(0, 0, 0, 0.4);
  animation: float 7s ease-in-out infinite;
}
.hero-portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--line);
  opacity: 0.8;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.ask-hero {
  flex: none;
  width: min(560px, 100%);
  height: clamp(54px, 7.6vh, 66px);
  padding: 0 11px 0 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 30px -18px rgba(0, 0, 0, 0.2);
}
.ask-hero:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 4px rgba(1, 113, 227, 0.1), 0 14px 30px -18px rgba(0, 0, 0, 0.2); }

.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(12px, 1.8vh, 18px); min-height: clamp(62px, 9.6vh, 92px); }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(104px, 10.5vw, 136px);
  height: clamp(62px, 9.6vh, 92px);
  border: 0.8px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tile:hover { transform: translateY(-3px); background: #fff; border-color: var(--line-2); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.3); }
.tile:active { transform: scale(0.97); }

.tone-teal { color: var(--tone-teal); }
.tone-green { color: var(--tone-green); }
.tone-violet { color: var(--tone-violet); }
.tone-pink { color: var(--tone-pink); }
.tone-orange { color: var(--tone-orange); }

.watermark {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: calc(var(--wm) * 0.08);
  transform: translateX(-50%);
  font-size: var(--wm);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(180deg, #e6e6ea 0%, #f1f1f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  pointer-events: none;
  user-select: none;
}

.rise { opacity: 0; transform: translateY(14px); animation: rise 0.8s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 90ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- chat shell ---------- */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
.chat-head { position: absolute; z-index: 10; top: 0; left: 0; right: 0; height: 84px; pointer-events: none; }
.chat-head > * { pointer-events: auto; }
.head-avatar {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translateX(-50%);
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
  box-shadow: 0 0 0 2px #fff, 0 4px 14px -4px rgba(0, 0, 0, 0.35);
}
.head-avatar-ring { position: absolute; top: 24px; left: 50%; width: 40px; height: 40px; transform: translateX(-50%); border-radius: 50%; pointer-events: none; }
.is-busy .head-avatar-ring { animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(1, 113, 227, 0.45); } 100% { box-shadow: 0 0 0 16px rgba(1, 113, 227, 0); } }
.info-btn { position: absolute; top: 34px; right: 24px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted-2); transition: color 0.2s, background 0.2s; }
.info-btn:hover { color: var(--fg); background: var(--soft); }

.stage-wrap { flex: 1; min-height: 0; display: flex; justify-content: center; }
.stage {
  position: relative;
  width: min(var(--col), 100%);
  height: 100%;
  overflow-y: auto;
  padding: 92px 24px 32px;
  scroll-padding-top: 92px;
  scrollbar-width: thin;
  scrollbar-color: #c4c4cc transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 60px, #000 86px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, transparent 60px, #000 86px, #000 calc(100% - 22px), transparent 100%);
}
.stage::-webkit-scrollbar { width: 7px; }
.stage::-webkit-scrollbar-thumb { background: #c4c4cc; border-radius: 4px; }

.dock { flex: none; width: min(var(--col), 100%); margin: 0 auto; padding: 4px 24px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toggle-q { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 4px 12px; font-size: 12px; color: var(--muted); border-radius: 8px; transition: color 0.2s; }
.toggle-q:hover { color: var(--fg); }
.quick-wrap { position: relative; width: 100%; }
.quick-wrap[hidden] { display: none; }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.q-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 12px 16px;
  border: 0.8px solid #e5e7eb;
  border-radius: 14px;
  background: #f5f5f6;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}
.q-btn:hover { background: #ececef; border-color: var(--line-2); }
.q-btn:active { transform: scale(0.97); }
.q-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.q-more { width: 52px; height: 46px; display: grid; place-items: center; color: var(--muted-2); border-radius: 14px; transition: color 0.2s, background 0.2s; }
.q-more:hover { color: var(--fg); background: var(--soft); }

.more-menu {
  position: absolute;
  z-index: 15;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(320px, 100%);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.28);
  animation: pop 0.2s var(--ease);
}
.more-menu[hidden] { display: none; }
.more-menu button { display: block; width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 14px; color: var(--fg-2); }
.more-menu button:hover { background: var(--soft); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.ask-chat {
  width: 100%;
  height: 58px;
  margin-top: 4px;
  padding: 0 9px 0 24px;
  border-radius: 999px;
  background: var(--soft-2);
}
.ask-chat input { font-weight: 500; }
.ask-chat:focus-within { background: #e6e6ec; }
.foot-note { display: flex; align-items: center; gap: 6px; padding-top: 2px; font-size: 12px; color: var(--muted); }
.foot-note .mark { width: 16px; height: 16px; border-radius: 5px; font-size: 6.5px; }

/* ---------- a turn: the question, then its answer ---------- */
.turn + .turn { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.turn-q {
  width: fit-content;
  max-width: min(100%, 60ch);
  margin: 0 0 clamp(16px, 2.6vh, 24px) auto;
  padding: 10px 16px;
  border-radius: 18px 18px 6px 18px;
  background: var(--soft);
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.empty { padding-top: 12vh; text-align: center; }
.empty .answer-title { margin-bottom: 8px; }
.empty p { color: var(--muted-2); font-size: 15px; }
.sk-w1 { width: 92%; }
.sk-w2 { width: 78%; }
.sk-w3 { width: 64%; }

/* ---------- an answer ---------- */
.answer { animation: rise 0.55s var(--ease) both; }
.answer-title { margin-bottom: clamp(16px, 2.6vh, 24px); font-size: clamp(24px, 3.4vh, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.015em; }
.answer-text { margin-top: clamp(18px, 3vh, 28px); font-size: 16px; line-height: 1.65; color: var(--fg-2); overflow-wrap: anywhere; }
.answer-text > * + * { margin-top: 12px; }
.answer-text ul, .answer-text ol { padding-inline-start: 22px; }
.answer-text p, .answer-text li { text-align: start; }
.answer-text pre { overflow-x: auto; padding: 14px 16px; border-radius: 14px; background: #18181b; color: #f4f4f5; font-family: var(--mono); font-size: 13px; line-height: 1.6; text-align: left; }
.answer-text pre code { padding: 0; background: none; font-size: inherit; color: inherit; }
.answer-text ul { list-style: disc; }
.answer-text ol { list-style: decimal; }
.answer-text li + li { margin-top: 8px; }
.answer-text li::marker { color: var(--muted); }
.answer-text strong { font-weight: 650; color: var(--fg); }
.answer-text a { color: var(--blue); text-underline-offset: 3px; }
.answer-text code { font-family: var(--mono); font-size: 0.9em; padding: 1px 5px; border-radius: 5px; background: var(--soft); }
.answer-text.streaming > :last-child::after, .answer-text.streaming:empty::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  border-radius: 2px;
  background: var(--fg);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 13px; font-weight: 500; line-height: 1.15; }
.chips-dark li { padding: 8px 12px; border-radius: 8px; background: #18181b; color: #fff; }
.chips-soft li { padding: 7px 13px; border-radius: 999px; background: var(--soft); color: #3f3f46; }

/* profile */
.profile { display: grid; grid-template-columns: clamp(150px, min(40%, 34vh), 320px) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: center; }
.profile-photo { width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px; object-fit: cover; background: #6b7a94; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 22px 44px -26px rgba(0, 0, 0, 0.45); }
.profile-name { font-size: clamp(24px, 3.4vh, 32px); line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.profile-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }
.profile-lead { margin: clamp(10px, 2vh, 18px) 0 clamp(10px, 1.8vh, 16px); font-size: 16px; line-height: 1.55; color: var(--fg-2); text-wrap: pretty; }

/* skills */
.skill-group { margin-bottom: clamp(16px, 3vh, 28px); }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 18px; font-weight: 600; color: var(--fg-2); }
.skill-group h3 .ico { color: var(--fg-2); }

/* projects */
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 24px; }
.rail::-webkit-scrollbar { display: none; }
.proj {
  position: relative;
  flex: 0 0 clamp(200px, 30%, 264px);
  display: flex;
  flex-direction: column;
  height: clamp(220px, 38vh, 340px);
  padding: 20px;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  scroll-snap-align: start;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
a.proj:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -22px rgba(0, 0, 0, 0.5); }
.proj-ink { background: radial-gradient(120% 70% at 85% 105%, #3b82f6 0%, rgba(59, 130, 246, 0) 60%), linear-gradient(165deg, #0a0a0f 0%, #151a2e 70%); }
.proj-earth { background: radial-gradient(90% 60% at 50% 112%, #34d399 0%, rgba(52, 211, 153, 0) 62%), radial-gradient(70% 50% at 82% 8%, rgba(96, 165, 250, 0.55) 0%, rgba(96, 165, 250, 0) 70%), linear-gradient(170deg, #020617 0%, #0b2545 62%, #0f3d3e 100%); }
.proj-photo { background-image: linear-gradient(to bottom, rgba(9, 9, 11, 0.78), rgba(9, 9, 11, 0.18) 45%, rgba(9, 9, 11, 0.62)), var(--img); background-size: cover; background-position: center top; }
.proj-label { font-size: 14px; font-weight: 500; opacity: 0.88; }
.proj-title { margin-top: 2px; font-size: clamp(24px, 3.4vh, 30px); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.proj-foot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
}
.rail-nav { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 0 8px; }
.rail-nav[hidden] { display: none; }
.rail-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--fg-2); transition: background 0.2s, color 0.2s, transform 0.12s var(--ease); }
.rail-btn:hover:not(:disabled) { background: #e8e8ec; }
.rail-btn:active:not(:disabled) { transform: scale(0.94); }
.rail-btn:disabled { color: #c4c4cc; cursor: default; }

/* contact */
.contact { padding: clamp(20px, 4vw, 32px); border-radius: 24px; background: var(--soft); }
.cc-head { display: flex; align-items: center; gap: 14px; }
.cc-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.cc-id h2 { font-size: 20px; line-height: 1.2; font-weight: 600; }
.cc-id p { font-size: 14px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 5px 12px; border: 1px solid #bbf7d0; border-radius: 999px; background: #f0fdf4; color: var(--ok); font-size: 13px; font-weight: 600; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: live 2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } }
.cc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.cc-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; text-decoration: none; transition: border-color 0.2s, transform 0.12s var(--ease), box-shadow 0.2s; }
.cc-row:hover { border-color: var(--line-2); box-shadow: 0 10px 20px -14px rgba(0, 0, 0, 0.3); }
.cc-row:active { transform: scale(0.985); }
.cc-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--fg-2); }
.cc-txt { display: flex; flex-direction: column; min-width: 0; }
.cc-txt small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.cc-txt b { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cc-act { flex: none; margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 600; }
.cc-row.done { border-color: #bbf7d0; background: #f0fdf4; }
.cc-row.done .cc-act { color: var(--ok); }
.btn-dark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  height: 46px;
  margin: 0 auto;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.12s var(--ease);
}
.btn-dark:hover { background: #27272a; }
.btn-dark:active { transform: scale(0.98); }

/* loading skeleton and notices */
.skel { display: grid; gap: 14px; }
.sk { border-radius: 10px; background: linear-gradient(90deg, #f1f1f3 25%, #e6e6ea 37%, #f1f1f3 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-title { width: 220px; height: 30px; }
.sk-chips { display: flex; gap: 8px; }
.sk-chips .sk { width: 84px; height: 30px; border-radius: 8px; }
.sk-line { height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.notice { padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; background: #fafafa; }
.notice h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.notice p { font-size: 14px; color: var(--muted-2); }
.notice .btn-dark { margin: 16px 0 0; }

/* ---------- welcome dialog ---------- */
.modal { position: fixed; padding: 32px; border: 0; border-radius: 24px; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; background: #fff; color: var(--fg); box-shadow: 0 40px 100px -24px rgba(0, 0, 0, 0.5); animation: pop 0.3s var(--ease); }
.modal::backdrop { background: rgba(9, 9, 11, 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; } }
.modal h2 { padding-right: 40px; font-size: clamp(24px, 4vw, 34px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.modal-x { position: absolute; top: 22px; right: 22px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fg); color: #fff; transition: background 0.2s, transform 0.12s var(--ease); }
.modal-x:hover { background: #27272a; }
.modal-x:active { transform: scale(0.94); }
.modal-box { margin: 22px 0 26px; padding: 22px 24px; border-radius: 18px; background: var(--soft); }
.modal-box h3 { margin-bottom: 4px; font-size: 18px; font-weight: 600; }
.modal-box p { margin-bottom: 18px; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.modal-box p:last-child { margin-bottom: 0; }
.modal-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.modal-foot a { color: var(--blue); }

/* ---------- /about, the readable page ---------- */
.top-link { position: fixed; z-index: 20; top: 32px; right: 24px; display: inline-flex; align-items: center; height: 46px; padding: 0 18px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted-2); text-decoration: none; transition: color 0.2s, background 0.2s; }
.top-link:hover { color: var(--fg); background: var(--soft); }
.btn-light { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 24px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background 0.2s, transform 0.12s var(--ease); }
.btn-light:hover { background: var(--soft); }
.btn-light:active { transform: scale(0.98); }
.about { width: min(820px, 100%); margin: 0 auto; padding: 112px 24px 96px; }
.about-head { display: grid; grid-template-columns: clamp(140px, 30%, 240px) minmax(0, 1fr); gap: clamp(20px, 4vw, 40px); align-items: center; margin-bottom: 24px; }
.about-photo { width: 100%; height: auto; aspect-ratio: 1; border-radius: 24px; object-fit: cover; background: #6b7a94; box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.45); }
.about h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.about-role { margin-top: 6px; color: var(--muted-2); }
.about-lead { margin-top: 14px; font-size: 18px; line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.about-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.about-cta .btn-dark { margin: 0; }
.about section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--line); }
.about h2 { margin-bottom: 14px; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.about h3 { margin: 22px 0 10px; font-size: 17px; font-weight: 600; color: var(--fg-2); }
.about h3 small { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.about section > p, .about li > p { font-size: 16px; line-height: 1.65; color: var(--fg-2); max-width: 68ch; }
.about section > p + p { margin-top: 12px; }
.about a { color: var(--blue); text-underline-offset: 3px; }
.about a.btn-dark { color: #fff; }
.about a.btn-light { color: var(--fg); }
.about-projects { display: grid; gap: 14px; }
.about-projects li { padding: 20px 22px; border: 1px solid var(--line); border-radius: 20px; }
.about-projects h3 { margin-top: 0; }
.about-projects .chips { margin-top: 14px; }
.about-list { display: grid; gap: 10px; padding-inline-start: 22px; list-style: disc; font-size: 16px; line-height: 1.6; color: var(--fg-2); max-width: 68ch; }
ol.about-list { list-style: decimal; }
.about-list strong { color: var(--fg); font-weight: 650; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; }
.about-links a { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--fg); font-weight: 600; font-size: 14px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.about-links a:hover { border-color: var(--line-2); background: #fafafa; }
.about-links small { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- 404 ---------- */
.nf { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.nf h1 { font-size: clamp(40px, 8vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -0.03em; }
.nf p { margin: 14px auto 28px; max-width: 42ch; color: var(--muted-2); }

/* ---------- large desktop ---------- */
@media (min-width: 1500px) and (min-height: 900px) {
  .top-pill { top: 36px; left: 32px; height: 50px; font-size: 15px; }
  .top-link { top: 36px; right: 32px; height: 50px; font-size: 15px; }
  .info-btn { right: 32px; }
  .q-btn { height: 50px; padding: 12px 18px; font-size: 15px; }
  .q-more { height: 50px; }
  .ask-chat { height: 62px; }
  .ask input { font-size: 17px; }
  .tile { font-size: 15px; }
  .answer-text, .profile-lead { font-size: 17px; }
  .chips li { font-size: 14px; }
  .foot-note, .toggle-q { font-size: 13px; }
}

/* ---------- short screens: laptops, and phones held sideways ---------- */
@media (max-height: 760px) {
  .top-pill { top: 20px; }
  .top-link { top: 20px; }
  .head-avatar, .head-avatar-ring { top: 16px; }
  .info-btn { top: 22px; }
  .stage { padding-top: 74px; padding-bottom: 24px; scroll-padding-top: 74px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 50px, #000 70px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, transparent 50px, #000 70px, #000 calc(100% - 18px), transparent 100%); }
  .dock { gap: 6px; padding-bottom: 10px; }
  .toggle-q { height: 20px; }
  .q-btn { height: 40px; padding: 8px 14px; border-radius: 12px; }
  .q-more { height: 40px; }
  .ask-chat { height: 52px; margin-top: 2px; }
  .cc-list { margin: 16px 0; }
  .contact { padding: 20px 22px; }
}
@media (max-height: 520px) {
  .landing { justify-content: flex-start; padding-top: 16px; }
  .about-tile { display: none; }
  .hello { margin-top: 0; }
  .foot-note, .toggle-q { display: none; }
  .stage { padding-top: 66px; scroll-padding-top: 66px; }
  .proj { height: 200px; }
}

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .stage { padding-left: 28px; padding-right: 28px; }
  .dock { padding-left: 28px; padding-right: 28px; }
}

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .top-pill { top: 16px; left: 16px; height: 42px; padding: 8px 12px 8px 10px; }
  .top-pill .label { display: none; }
  .top-link { top: 16px; right: 8px; height: 42px; padding: 0 12px; }
  .about { padding: 84px 16px 64px; }
  .about-head { grid-template-columns: 1fr; }
  .about-photo { max-width: 180px; }
  .turn-q { font-size: 14px; }
  .ask-hero { padding-left: 20px; }
  .tiles { width: 100%; max-width: 440px; gap: 10px; min-height: 0; }
  .tile { width: calc((100% - 20px) / 3); height: clamp(60px, 9.4vh, 80px); gap: 6px; }
  .info-btn { top: 23px; right: 16px; }
  .head-avatar, .head-avatar-ring { top: 17px; }
  .stage { padding: 76px 16px 24px; scroll-padding-top: 76px; }
  .dock { padding: 4px 16px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  /* one row that scrolls sideways, so the answer keeps the screen */
  .quick { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .quick::-webkit-scrollbar { display: none; }
  .q-btn, .q-more { flex: none; }
  .q-btn { height: 42px; padding: 10px 12px; }
  .q-more { height: 42px; width: 42px; }
  .ask-chat { height: 54px; padding-left: 20px; }
  /* the photo sits beside the name, so the name and the answer stay on screen */
  .profile { grid-template-columns: clamp(96px, 30vw, 132px) minmax(0, 1fr); gap: 4px 16px; align-items: start; }
  .profile-photo { grid-row: 1 / 3; border-radius: 18px; }
  .profile-body { display: contents; }
  .profile-name { align-self: end; font-size: 24px; }
  .profile-meta { grid-column: 2; align-self: start; margin-top: 0; }
  .profile-lead { grid-column: 1 / -1; margin: 14px 0 10px; }
  .profile .chips { grid-column: 1 / -1; }
  .answer-title { font-size: 25px; }
  .proj { flex-basis: 74%; height: clamp(220px, 40vh, 300px); }
  .cc-list { grid-template-columns: 1fr; margin: 18px 0; }
  .cc-head { flex-wrap: wrap; }
  .contact { padding: 18px 16px; border-radius: 20px; }
  .modal { padding: 24px 20px; }
  .more-menu { width: 100%; }
}
@media (max-width: 720px) and (max-height: 520px) {
  .tile { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .rise { opacity: 1; transform: none; }
  .hero-portrait { animation: none; }
}
