/* Terminal-style portfolio. Zero JavaScript: dark mode is a CSS-only checkbox. */

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --fg: #c9d1d9;
  --dim: #8b949e;
  --line: #30363d;
  --accent: #3fb950;
  --accent-2: #58a6ff;
  --warn: #d29922;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbf8;
    --bg-alt: #f0efe9;
    --fg: #24292f;
    --dim: #6a737d;
    --line: #d8d6cc;
    --accent: #1a7f37;
    --accent-2: #0550ae;
    --warn: #9a6700;
  }
}

/* Checkbox flips whichever theme the system picked. */
:root:has(#theme-switch:checked) {
  --bg: #fbfbf8;
  --bg-alt: #f0efe9;
  --fg: #24292f;
  --dim: #6a737d;
  --line: #d8d6cc;
  --accent: #1a7f37;
  --accent-2: #0550ae;
  --warn: #9a6700;
}

@media (prefers-color-scheme: light) {
  :root:has(#theme-switch:checked) {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --fg: #c9d1d9;
    --dim: #8b949e;
    --line: #30363d;
    --accent: #3fb950;
    --accent-2: #58a6ff;
    --warn: #d29922;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
label:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

strong {
  color: var(--fg);
  font-weight: 700;
}

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

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.bar .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 3rem;
}

.bar .brand {
  color: var(--accent);
  font-weight: 700;
  margin-right: auto;
}

.bar nav {
  display: flex;
  gap: 1rem;
}

.bar nav a {
  color: var(--dim);
}

.bar nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.theme-toggle {
  cursor: pointer;
  color: var(--dim);
  user-select: none;
}

#theme-switch:focus-visible+.theme-toggle {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle:hover {
  color: var(--fg);
}

.theme-toggle::before {
  content: "[dark]";
}

:root:has(#theme-switch:checked) .theme-toggle::before {
  content: "[light]";
}

/* Hero */
.hero {
  padding-block: 4.5rem 3rem;
  border-top: 0;
}

.prompt {
  font-size: 1rem;
  color: var(--dim);
  margin: 0;
}

.prompt::before {
  content: "$ ";
  content: "$ " / "";
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.15;
  margin: 1rem 0 0.25rem -0.04em;
  /* optical fix: cancel the "G" left side bearing at display size */
  letter-spacing: -0.02em;
}

.hero .role {
  color: var(--accent);
  margin: 0 0 1.5rem;
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

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

.hero p.lead {
  text-wrap: balance;
  margin: 0 0 1.5rem;
  color: var(--dim);
}

.kv {
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 1.25rem;
}

.kv dt {
  color: var(--warn);
}

.kv dd {
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.btn.ghost {
  border-color: var(--line);
  color: var(--dim);
  font-weight: 400;
}

.btn.ghost:hover {
  border-color: var(--fg);
  background: none;
  color: var(--fg);
}

/* Sections */
section {
  padding: 2.5rem 0;
  border-top: 1px dashed var(--line);
}

section>.wrap>h2 {
  font-size: 1rem;
  font-weight: 400;
  margin: 0 0 1.5rem;
  color: var(--dim);
}

section>.wrap>h2::before {
  content: "$ ";
  content: "$ " / "";
  color: var(--accent);
}

section>.wrap>h2 span {
  color: var(--fg);
}

.about p {
  margin: 0 0 1rem;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.75rem;
}

.stats li {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.75rem 0.9rem;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
}

.stats b {
  display: block;
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 0.15rem;
}

/* Log entries (experience, education) */
.entry {
  padding: 0 0 1.75rem 1.25rem;
  border-left: 1px solid var(--line);
  position: relative;
  margin-left: 0.3rem;
}

.entry:last-child {
  padding-bottom: 0;
}

.entry::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 0.6rem;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.entry .meta {
  color: var(--warn);
  font-size: 13px;
  margin: 0;
}

.entry h3 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.entry .org {
  color: var(--dim);
  margin: 0 0 0.5rem;
}

.entry ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.entry li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.entry li::before {
  content: "+";
  position: absolute;
  left: 0.25rem;
  color: var(--accent);
}

.entry p.detail {
  margin: 0;
}

/* Projects */
.projects {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.group {
  color: var(--dim);
  font-size: 13px;
  margin: 0 0 0.75rem;
}

.projects+.group {
  margin-top: 2rem;
}

.project {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 1rem 1.15rem;
  transition: border-color 0.15s;
}

.project:hover {
  border-color: var(--accent);
}

.project h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin: 0 0 0.25rem;
}

.project-head h3 {
  margin: 0;
}

.project-head .links {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  display: flex;
  gap: 1rem;
}

.project p {
  margin: 0 0 0.6rem;
  color: var(--dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 12px;
}

.tags span {
  color: var(--accent);
}

.tags span::before {
  content: "#";
  opacity: 0.6;
}

.entry .tags {
  margin-top: 0.85rem;
}

/* Certs */
.certs {
  list-style: none;
  padding: 0;
  margin: 0;
}

.certs li {
  display: flex;
  gap: 1rem;
  padding: 0.15rem 0;
}

.certs time {
  color: var(--warn);
  flex: none;
}

/* Footer */
footer {
  border-top: 1px dashed var(--line);
  padding: 2rem 0 3rem;
  color: var(--dim);
  font-size: 13px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

footer p {
  margin: 0;
}

footer .links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .bar nav {
    display: none;
  }

  .kv {
    grid-template-columns: 1fr;
  }

  .kv dd {
    margin-bottom: 0.5rem;
  }

  .project-head .links {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cursor {
    animation: none;
  }
}