/* 0x88f8.github.io: terminal-inspired personal homepage
   Plain CSS, no build step. Colour tokens live in :root. */

/* ── Fonts (self-hosted, SIL OFL; see assets/fonts/OFL.txt) ── */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Tokens ── */
:root {
  /* Light theme, built around the avatar's solid blue (#6E98EE). That blue is
     only ~2.7:1 on white, so text and controls use a deeper blue of the same
     hue (--accent, ~5.2:1); the avatar blue stays for decoration (--avatar). */
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --text: #0F172A;
  --text-2: #5B6675;
  --accent: #3563C9;
  --accent-dim: rgba(110, 152, 238, 0.14);
  --avatar: #6E98EE;
  --warn: #8A5F00;
  --border: #D8DFE8;
  --border-hi: #BFC9D6;

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

  --radius: 10px;
  --gutter: clamp(16px, 4vw, 32px);
  --max: 1080px;
  --nav-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--avatar); color: #0F172A; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px;
  background: var(--accent); color: var(--bg);
  font: 500 .875rem/1 var(--mono);
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Navigation ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(246, 248, 251, .9);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .site-header {
    background: rgba(246, 248, 251, .75);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.site-header.is-scrolled { border-bottom-color: var(--border); }

.nav {
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--mono);
  font-size: .875rem;
}
.nav__brand { font-weight: 500; white-space: nowrap; }
.prompt-user { color: var(--accent); }
.prompt-sep, .prompt-sign { color: var(--text-2); }
.prompt-path { color: var(--text); }
.prompt-sign { margin-left: .15em; }

.nav__links { display: flex; gap: clamp(4px, 1.5vw, 12px); }
.nav__links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  color: var(--text-2);
  border-radius: 6px;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a[aria-current="true"] { color: var(--accent); }
.nav__key {
  display: none;
  min-width: 1.4em; padding: 0 .3em;
  font-size: .75rem; line-height: 1.5;
  text-align: center;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.js .nav__key { display: inline-block; }

@media (max-width: 640px) {
  .nav__brand { display: none; }
  .nav { justify-content: center; }
  .js .nav__key { display: none; }
  .nav__links a { padding: 6px 6px; font-size: .8125rem; }
}

/* ── Hero ── */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 104px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -32px rgba(15, 23, 42, .28);
  overflow: hidden;
}
.terminal__bar {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 38px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.terminal__dots { position: absolute; left: 14px; display: flex; gap: 8px; }
.terminal__dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-hi); }
.terminal__title { font: .8125rem var(--mono); color: var(--text-2); }
.terminal__body { padding: clamp(20px, 4vw, 36px); font-family: var(--mono); }

.cmd { color: var(--text-2); font-size: .9375rem; min-height: 1.65em; }
.cmd + .out, .cmd + .hero__name { margin-top: 4px; }
.ps1 { color: var(--accent); font-weight: 500; }
.out + .cmd { margin-top: 22px; }

.hero__name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}
.hero__hello { font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.45; color: var(--text); }
.hero__traits { margin-top: 14px; color: var(--text); }
.hero__traits li::before { content: "> "; color: var(--accent); }
.hero__lede {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 44ch;
}
.hero__loc { margin-top: 12px; font-size: .875rem; color: var(--text-2); }
.hero__loc { display: flex; align-items: center; gap: 6px; }
.hero__loc svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.5; }

.cursor, .typing::after {
  display: inline-block;
  width: .6em; height: 1.1em;
  vertical-align: -.2em;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
.typing::after { content: ""; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* Progressive enhancement: with JS, outputs reveal after their command is typed. */
.js .is-pending { opacity: 0; transform: translateY(4px); }
.js .out { transition: opacity .45s var(--ease), transform .45s var(--ease); }

.hero__side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.portrait {
  margin: 0;
  width: min(280px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--avatar);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--avatar);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.tagline { font: 500 1.0625rem/1.5 var(--mono); color: var(--text); }
.tagline span { color: var(--accent); }

.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font: .875rem var(--mono);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.social svg { width: 15px; height: 15px; fill: currentColor; }
.social a:hover { color: var(--text); border-color: var(--accent); background: var(--accent-dim); }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__side { order: -1; flex-direction: row; flex-wrap: wrap; justify-content: center; text-align: left; }
  .portrait { width: 132px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--avatar); }
  .hero__side .social { width: 100%; }
}
@media (max-width: 420px) {
  .hero__side { flex-direction: column; text-align: center; }
}

/* ── Sections ── */
.section {
  padding: clamp(64px, 10vw, 112px) 0;
  border-top: 1px solid var(--border);
}
.label {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font: .8125rem var(--mono);
  color: var(--text-2);
}
.label::before { content: "$"; color: var(--accent); }
.label__n {
  order: 1; /* badge sits after the command text */
  padding: 1px 6px;
  font-size: .75rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
}
.section__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin-bottom: clamp(24px, 4vw, 40px);
}

/* About */
.about { max-width: 62ch; display: grid; gap: 18px; color: var(--text-2); }
.about__lead { font-size: clamp(1.1875rem, 2.4vw, 1.4375rem); line-height: 1.5; color: var(--text); }
.about__sign {
  font-family: var(--mono);
  font-size: .9375rem;
  color: var(--text);
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

/* Interests */
.interests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.interest {
  position: relative;
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.interest:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.interest:hover .interest__icon { stroke: var(--accent); }
.interest__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.interest__icon {
  width: 34px; height: 34px;
  fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .2s var(--ease);
}
.interest__dir {
  font: .75rem var(--mono);
  color: var(--accent);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.interest h3 { font: 500 1.0625rem/1.35 var(--mono); margin-bottom: 12px; }
.interest__list { display: grid; gap: 4px; font-size: .9375rem; color: var(--text-2); }
.interest__list li { padding-left: 18px; position: relative; }
.interest__list li::before {
  content: "–";
  position: absolute; left: 0;
  font-family: var(--mono);
  color: var(--border-hi);
}
/* Each card gets its own subtle top marker so the six areas read as distinct. */
.interest::before {
  content: "";
  position: absolute; left: 22px; top: -1px;
  height: 2px; width: 32px;
  background: var(--avatar);
  border-radius: 0 0 2px 2px;
}
.interest--llm::before    { width: 48px; }
.interest--ops::before    { width: 20px; }
.interest--agents::before { width: 40px; }
.interest--ml::before     { width: 56px; }
.interest--cs::before     { width: 26px; }
.interest__desc { font-size: .9375rem; color: var(--text-2); }

/* Placeholder card while there are no public repositories. */
.project--empty { border-style: dashed; background: transparent; }

/* Projects (reusable cards) */
.projects { display: grid; gap: 16px; }
.project {
  display: grid; gap: 14px;
  padding: clamp(20px, 3.5vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease);
}
.project:hover { border-color: var(--border-hi); }
.project__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.project__prompt { font-family: var(--mono); color: var(--accent); }
.project__name { font: 700 clamp(1.0625rem, 2.6vw, 1.3125rem)/1.3 var(--mono); overflow-wrap: anywhere; }
.project__desc { color: var(--text-2); max-width: 60ch; }

.status {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: auto;
  padding: 3px 10px;
  font: .75rem var(--mono);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--dev { color: var(--warn); border-color: rgba(138, 95, 0, .35); }
.status--live { color: var(--accent); border-color: rgba(53, 99, 201, .35); }
.status--archived { color: var(--text-2); }
.status--dev::before { animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 2px 10px;
  font: .8125rem var(--mono);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.project__link {
  justify-self: start;
  font: .875rem var(--mono);
  color: var(--accent);
  overflow-wrap: anywhere;
  border-bottom: 1px solid transparent;
  transition: border-color .15s var(--ease);
}
.project__link:hover { border-bottom-color: var(--accent); }

@media (max-width: 520px) {
  .status { margin-left: 0; }
}

/* Connect */
.connect__text { max-width: 58ch; color: var(--text-2); margin: -12px 0 28px; }
.connect { display: grid; gap: 10px; max-width: 560px; }
.connect__link {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 12px;
  padding: 14px 18px;
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.connect__k { color: var(--text-2); font-size: .8125rem; }
.connect__k::after { content: ":"; }
.connect__v { color: var(--text); overflow-wrap: anywhere; }
.connect__arrow { color: var(--accent); transition: transform .2s var(--ease); }
.connect__link:hover { border-color: var(--accent); background: var(--accent-dim); }
.connect__link:hover .connect__arrow { transform: translateX(4px); }

@media (max-width: 420px) {
  .connect__link { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .connect__k { grid-column: 1 / -1; }
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  font: .8125rem var(--mono);
  color: var(--text-2);
}
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--accent); }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__keys { display: none; }
.js .site-footer__keys { display: block; }
kbd {
  display: inline-block;
  padding: 0 5px;
  font: inherit; font-size: .75rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text);
}
@media (hover: none) {
  .js .site-footer__keys { display: none; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .interest:hover { transform: none; }
}

/* Headings focused by the keyboard shortcuts don't need a focus ring. */
[tabindex="-1"]:focus { outline: none; }
