:root {
  color-scheme: light dark;
  --bg: light-dark(#fafafa, #121214);
  --fg: light-dark(#1d1d1f, #ececf0);
  --muted: light-dark(#6e6e73, #9a9aa2);
  --accent: light-dark(#0a66c2, #5aa9ff);
  --border: light-dark(#e2e2e5, #2a2a2e);
  --chip: light-dark(#f0f0f3, #1e1e22);
  --ok: #2e9e5b;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
main { width: 100%; max-width: 960px; padding: 1.5rem; }

/* Buttons & icons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  color: var(--accent);
  background: none;
  font: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); }
.btn.icon-only { padding: 0.3rem; }
.btn.copied { color: var(--ok); border-color: var(--ok); }
.btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--bg);
  background: var(--fg);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.icon {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
:root[data-theme="dark"] .show-light,
:root:not([data-theme="dark"]) .show-dark { display: none; }

.toolbar { position: fixed; top: 0.75rem; right: 0.75rem; display: flex; gap: 0.4rem; }
:root:not([data-theme]) .toolbar { display: none; }

/* Header */
header { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.intro { text-align: center; }
header h1 { font-size: 2rem; margin: 0; letter-spacing: -0.02em; }
.role { color: var(--muted); margin: 0.1rem 0 0.6rem; }
.typed { color: var(--fg); font-weight: 600; font-size: 1.05rem; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
.links { display: flex; gap: 0.5rem; justify-content: center; }

/* Doodle */
.doodle { width: 190px; height: auto; flex-shrink: 0; overflow: visible; }
.doodle .s, .doodle .a { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.doodle .s { stroke: var(--fg); }
.doodle .a { stroke: var(--accent); }
.doodle .thin { stroke-width: 1.6; }
.doodle .hit { fill: transparent; stroke: none; }
.doodle .rack, .doodle .laptop { cursor: pointer; }
.doodle .led { fill: var(--ok); animation: led 2.4s steps(1) infinite; animation-delay: var(--d, 0s); }
.doodle .led.busy { fill: var(--accent); }
.doodle .cursor { animation: blink 1s steps(1) infinite; }
.doodle .steam { transform-box: fill-box; animation: steam 3s ease-in-out infinite; animation-delay: var(--d, 0s); }
.doodle .cloud { transform-box: fill-box; animation: drift 6s ease-in-out infinite alternate; }
.doodle .rack.shake { transform-box: fill-box; transform-origin: 50% 100%; animation: shake 0.3s; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes led { 50% { opacity: 0.3; } }
@keyframes steam {
  0% { transform: translateY(4px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(-6px); opacity: 0; }
}
@keyframes drift { from { transform: translateX(-5px); } to { transform: translateX(5px); } }
@keyframes shake {
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Content */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2.5rem; }
h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.4rem;
}
section + section { margin-top: 1.1rem; }
p { margin: 0; }
.job + .job { margin-top: 0.6rem; }
.job strong { display: block; }
.meta { color: var(--muted); font-size: 0.85rem; }
.job ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
ul.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
ul.chips li {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 0.45rem;
  font-size: 0.82rem;
}
.label { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 0.2rem; }

/* Terminal */
.term {
  width: min(720px, 94vw);
  height: min(440px, 80vh);
  padding: 0;
  border: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #0d1117;
  color: #d1d5db;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.term[open] { display: flex; }
.term::backdrop { background: rgb(0 0 0 / 0.45); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  background: #161b22;
  color: #8b949e;
  font-size: 12px;
}
.tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot.r { background: #ff5f56; }
.tdot.y { background: #ffbd2e; }
.tdot.g { background: #27c93f; }
.term-title { flex: 1; text-align: center; }
.term-close { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.term-out { flex: 1; overflow-y: auto; padding: 0.7rem 0.9rem; }
#term-log > div { white-space: pre-wrap; word-break: break-word; }
.term .p { color: #7ee787; }
.term .acc { color: #79c0ff; }
.term .err { color: #ff7b72; }
.term-in { display: flex; gap: 1ch; }
.term-in input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: inherit;
  font: inherit;
  caret-color: #7ee787;
}

/* Easter egg */
.panic {
  position: fixed;
  inset: 0;
  z-index: 20;
  margin: 0;
  padding: 1.5rem;
  overflow: auto;
  background: #000;
  color: #e5e5e5;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .doodle *, .caret { animation: none !important; }
}
@media (max-width: 720px) {
  body { display: block; }
  .toolbar { position: static; justify-content: flex-end; padding: 0.75rem 0.75rem 0; }
  header { flex-direction: column; gap: 0.75rem; }
  .grid { grid-template-columns: 1fr; }
}
