/* fonts */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* palette */
:root {
  --bg: #0b0e11; --card: #0d1216; --border: #2a333c;
  --fg: #d7dde3; --bright: #f2f5f7; --muted: #7d8894; --dim: #3d4852;
  --err: #ff7b72;
  --accent: #5ee0a0; --path: #7fb3ff; --bar: #10161b; --imgbg: #131a20;
  --glow: rgba(94, 224, 160, 0.35);
}
html[data-theme="light"] {
  --bg: #f4f1ea; --card: #faf8f3; --border: #d6d0c4;
  --fg: #2b2a27; --bright: #121110; --muted: #6b675e; --dim: #b8b2a6;
  --err: #c0392b;
  --accent: #1e8f5a; --path: #2a63c9; --bar: #e9e4da; --imgbg: #ece7db;
  --glow: rgba(30, 143, 90, 0.2);
}

/* base */
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body { font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.card h3, .card p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.glow { text-shadow: 0 0 18px var(--glow); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.path { color: var(--path); }

.page { max-width: 1280px; margin: 0 auto; padding: 28px 72px 0; box-sizing: border-box; min-height: 100vh; display: flex; flex-direction: column; gap: 56px; }

/* top bar */
.top-bar { display: flex; justify-content: space-between; align-items: center; height: 44px; font-size: 13px; color: var(--muted); }
.top-bar-right { display: flex; gap: 12px; align-items: center; }
.top-bar-right a, .theme-toggle { display: flex; align-items: center; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 4px; color: var(--fg); }
.top-bar-right a:hover, .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* cursor */
@keyframes blink { 50% { opacity: 0; } }
.cursor { animation: blink 1s step-end infinite; }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

/* typewriter */
.typewriter { font-size: 30px; font-weight: 500; color: var(--accent); }

/* project grid + cards */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; padding-top: 6px; }
.card { position: relative; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--border); border-radius: 4px; padding: 18px; background: var(--card); }
.card:hover { border-color: var(--accent); }
.card-title { font-size: 16px; font-weight: 700; color: var(--bright); }
.card-image { display: block; width: 100%; height: 180px; object-fit: cover; object-position: left; border-radius: 2px; background: var(--imgbg); }
.card-tags { font-size: 13px; color: var(--accent); }
.card-desc { font-size: 14px; line-height: 1.55; color: var(--muted); }
.card-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; min-height: 32px; align-items: center; }
.card-links a { display: flex; align-items: center; min-height: 32px; }
.card-links .none { color: var(--dim); }
/* shell variant: title sits on the border */
.shell .card { padding-top: 26px; background: var(--bg); }
.shell .card-title { position: absolute; top: -10px; left: 14px; padding: 0 8px; background: var(--bg); font-size: 14px; }

/* footer (classic) */
.footer { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding: 24px 0; margin-top: auto; }

section { display: flex; flex-direction: column; gap: 32px; }

/* classic hero */
.hero { display: flex; flex-direction: column; gap: 28px; padding-top: 80px; }
.hero-name { font-size: 92px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--bright); margin: 0; }
.hero-links { display: flex; gap: 32px; font-size: 18px; padding-top: 16px; }
.hero-links a { display: flex; align-items: center; height: 44px; }
.section-title { display: flex; align-items: baseline; gap: 16px; font-size: 22px; font-weight: 700; color: var(--bright); }
.section-title .muted { font-size: 14px; font-weight: 400; }

/* shell variant */
.shell-block { display: flex; flex-direction: column; gap: 14px; }
.prompt-line { color: var(--muted); }
.prompt-line .arrow { color: var(--accent); }
.prompt-line .tilde { color: var(--path); }
.prompt-line .cmd { color: var(--fg); }
.prompt-line .comment { color: var(--dim); }
.last-login { font-size: 13px; color: var(--muted); }
.banner { margin: 0; font-family: inherit; font-size: 15px; line-height: 1; color: var(--bright); white-space: pre; -webkit-text-stroke: 0.6px currentColor; }
.ls-links { display: flex; flex-direction: column; gap: 2px; }
.ls-links a { display: flex; align-items: center; min-height: 40px; gap: 24px; min-width: 0; }
.ls-links .perm { color: var(--muted); width: 200px; flex-shrink: 0; }
.ls-links .arrow-to { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-links a:hover .path, .ls-links a:hover .arrow-to { color: var(--accent); }

/* terminal */
.terminal { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; cursor: text; }
.term-log { display: flex; flex-direction: column; gap: 4px; }
.term-line { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.term-line.err { color: var(--err); }
.term-prompt { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.term-prompt input { flex: 1; font: inherit; color: var(--fg); background: transparent; border: 0; outline: 0; padding: 0; caret-color: var(--accent); }
.term-prompt input::placeholder { color: var(--dim); }
.term-hint { color: var(--dim); font-size: 13px; }

/* status bar */
.status-bar { display: flex; justify-content: space-between; align-items: center; height: 36px; margin: 40px -72px 0; padding: 0 20px; background: var(--bar); font-size: 13px; color: var(--muted); }
.status-bar .left, .status-bar .right { display: flex; align-items: center; height: 36px; }
.status-bar .right { gap: 24px; }
.status-bar .tab { background: var(--accent); color: var(--bg); padding: 0 12px; height: 36px; display: flex; align-items: center; font-weight: 700; }
.status-bar .cwd { padding: 0 12px; }
.status-bar .clock { color: var(--fg); }

/* responsive */
@media (max-width: 1000px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .ls-links .perm { display: none; }
  .ls-links .arrow-to { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 16px 20px 0; gap: 40px; }
  .project-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero-name { font-size: 48px; }
  .hero-links { gap: 20px; font-size: 16px; flex-wrap: wrap; }
  .banner { font-size: 10px; }
  .typewriter { font-size: 22px; }
  .status-bar { margin: 40px -20px 0; }
  .status-bar .right span:not(.clock) { display: none; }
  .top-bar-left { display: none; }
}

/* rm -rf */
html.wiped, html.wiped body { background: #fff; }
html.wiped body > * { visibility: hidden; }
