/*
 * Terminal theme: Atom One Light, or Atom One Dark when the visitor's
 * system is set to dark mode.
 *
 * Window frame: the page is drawn inside a terminal window when <html> has
 * class="framed" (see index.html). Remove that class to turn the frame off;
 * the page then fills the screen with the editor background.
 */

/* JetBrains Mono, self-hosted (SIL Open Font License, see fonts/JetBrainsMono-OFL.txt).
   One variable file covers every weight, Latin characters only. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* Light mode: Atom One Light. Yellow, blue and cyan are a shade darker than
   the stock palette so text stays readable (WCAG AA) on the light background. */
:root {
  --od-bg: #fafafa;
  --od-deep: #eaeaeb;
  --od-line: #ececed;
  --od-edge: #d3d4d7;
  --od-fg: #383a42;
  --od-comment: #696c77;
  --od-red: #e45649;
  --od-green: #50a14f;
  --od-yellow: #986801;
  --od-blue: #2f6bd9;
  --od-purple: #a626a4;
  --od-cyan: #0172a3;

  /* roles */
  --page: var(--od-bg);        /* page background when unframed */
  --backdrop: #f0f0f1;         /* behind the window when framed */
  --text: var(--od-fg);
  --heading: #202227;
  --muted: var(--od-comment);
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --window-shadow: 0 18px 50px rgba(56, 58, 66, 0.14);

  color-scheme: light dark;
}

/* Dark mode: Atom One Dark. Kept in an explicit prefers-color-scheme: dark
   block so browser extensions (Noir, Dark Reader) see the site has its own
   dark mode and leave it alone. */
@media (prefers-color-scheme: dark) {
  :root {
    --od-bg: #282c34;
    --od-deep: #21252b;
    --od-line: #2c313a;
    --od-edge: #181a1f;
    --od-fg: #abb2bf;
    --od-comment: #7f848e;
    --od-red: #e06c75;
    --od-green: #98c379;
    --od-yellow: #e5c07b;
    --od-blue: #61afef;
    --od-purple: #c678dd;
    --od-cyan: #56b6c2;

    --backdrop: #1e2127;
    --heading: #e6e9ef;
    --window-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15.5px/1.6 var(--font);
}

a { color: var(--od-blue); }

h1, h2, h3 { margin: 0; line-height: 1.2; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 72px 20px 48px;
}

/* ---------- window frame (only with html.framed) ---------- */

html.framed,
html.framed body { background: var(--backdrop); }

html.framed .window {
  max-width: min(680px, calc(100% - 32px));
  margin: 40px auto;
  background: var(--od-bg);
  border: 1px solid var(--od-edge);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--window-shadow);
}

/* title bar with the three window buttons */
html.framed .window::before {
  content: "";
  display: block;
  height: 34px;
  background-color: var(--od-deep);
  border-bottom: 1px solid var(--od-edge);
  background-image:
    radial-gradient(circle at 20px 50%, #ff5f57 5.5px, transparent 6px),
    radial-gradient(circle at 39px 50%, #febc2e 5.5px, transparent 6px),
    radial-gradient(circle at 58px 50%, #28c840 5.5px, transparent 6px);
}

html.framed main { padding: 32px 28px 12px; }

/* ---------- header ---------- */

.card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.avatar {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  border: 1px solid var(--od-line);
  object-fit: cover;
  flex-shrink: 0;
}

h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading);
}

h1::before { content: "❯ "; color: var(--od-green); }

.role { margin: 6px 0 0; color: var(--od-yellow); font-size: 0.95rem; }

/* ---------- about ---------- */

.about { margin: 28px 0 56px; }
.about p { margin: 0 0 20px; }

.links { display: flex; flex-wrap: wrap; gap: 20px; }
.links a { color: var(--od-cyan); font-weight: 500; text-decoration: none; }
.links a::before { content: "→ "; color: var(--muted); }
.links a:hover { color: var(--od-blue); text-decoration: underline; }

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

h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--od-purple);
  margin-bottom: 16px;
}

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.project {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

a.project { transition: background-color 0.15s; }
a.project:hover { background: var(--od-line); }

.project h3 { font-size: 1rem; font-weight: 500; color: var(--od-blue); }
.project p { margin: 2px 0 0; color: var(--muted); font-size: 0.93rem; line-height: 1.45; }

.thumb {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  background: var(--od-line);
  color: var(--od-purple);
  font-weight: 600;
  font-size: 0.9rem;
}

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

footer { margin-top: 40px; color: var(--muted); font-size: 0.85rem; }

/* blinking cursor */
footer p::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 10px;
  background: var(--od-blue);
  vertical-align: -3px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  footer p::after { animation: none; }
  a.project { transition: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  main { padding-top: 48px; }
  html.framed .window { margin: 16px; }
  html.framed main { padding: 22px 18px 4px; }
  .card { flex-direction: column; gap: 16px; }
  .avatar { width: 88px; height: 88px; }
  h1 { font-size: 1.7rem; }
}
