@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Manrope:wght@400;500;600;700&display=swap");

:root,
[data-theme="light"] {
  --bg: #f7f7f2;
  --panel: #101010;
  --panel-soft: #161616;
  --text: #141414;
  --muted: #666666;
  --line: #d8d8d1;
  --terminal-text: #f2f2eb;
  --terminal-muted: #b9c9bf;
  --prompt: #8ac4a1;
  --glow: rgba(138, 196, 161, 0.22);
  --width: 780px;
  --toggle-bg: #e2e2dc;
  --toggle-icon: "◑";
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --panel: #1a1a1a;
  --panel-soft: #141414;
  --text: #e8e8e0;
  --muted: #888888;
  --line: #2a2a2a;
  --terminal-text: #f2f2eb;
  --terminal-muted: #b9c9bf;
  --prompt: #8ac4a1;
  --glow: rgba(138, 196, 161, 0.28);
  --width: 780px;
  --toggle-bg: #242424;
  --toggle-icon: "◐";
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
  transition: background 200ms ease, color 200ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1 {
  margin: 0;
}

.page-shell {
  width: min(calc(100% - 28px), var(--width));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.brand,
.top-links,
.eyebrow,
.terminal-body,
.terminal-section summary,
.section-title,
.entry-head {
  font-family: "IBM Plex Mono", monospace;
}

.brand {
  font-size: 0.95rem;
}

.top-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.top-links a:hover,
.terminal-body a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

main {
  display: grid;
  gap: 18px;
  padding-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.avatar {
  width: 128px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 24%;
  border-radius: 14px;
}

.hero-copy {
  display: grid;
  gap: 10px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-status {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
}

.hero-status::after {
  content: "_";
  margin-left: 0.18em;
  color: var(--prompt);
  text-shadow: 0 0 12px var(--glow);
  animation: cursor-blink 1.1s steps(1) infinite;
}

.block-cursor {
  display: inline-block;
  color: var(--prompt);
  text-shadow: 0 0 16px var(--glow);
  animation: cursor-blink 1.1s steps(1) infinite;
  font-size: 0.45em;
  vertical-align: 0.2em;
  margin-left: 0.15em;
  line-height: 1;
}

.log-line {
  opacity: 0;
  transform: translateY(6px);
  animation: line-in 240ms ease-out forwards;
}

.theme-toggle {
  background: var(--toggle-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  padding: 3px 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  color: var(--muted);
  transition: border-color 180ms ease, color 180ms ease;
  line-height: 1.4;
}

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

[data-theme="light"] .theme-toggle::after {
  content: "dark";
}

[data-theme="dark"] .theme-toggle::after {
  content: "light";
}

:root:not([data-theme]) .theme-toggle::after {
  content: "dark";
}

.hero-log {
  display: grid;
  gap: 8px;
  max-width: 56ch;
  margin-top: 2px;
}

.hero-log p {
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-log .prompt {
  display: inline-block;
  width: 1.15em;
}

.terminal-window {
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  color: var(--terminal-text);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 16px 40px rgba(0, 0, 0, 0.14);
}

.terminal-bar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--panel-soft);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.terminal-bar span:nth-child(1) {
  background: #ff7d66;
}

.terminal-bar span:nth-child(2) {
  background: #f0c34d;
}

.terminal-bar span:nth-child(3) {
  background: #27c93f;
}

.terminal-body {
  display: grid;
  gap: 10px;
  padding: 18px;
  font-size: 0.9rem;
}

.prompt {
  color: var(--prompt);
  text-shadow: 0 0 12px var(--glow);
}

.output {
  padding-left: 18px;
  color: var(--terminal-muted);
}

.command-list {
  display: grid;
  gap: 10px;
}

.terminal-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--section-bg, rgba(255, 255, 255, 0.55));
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

[data-theme="dark"] .terminal-section {
  --section-bg: rgba(255, 255, 255, 0.03);
}

.terminal-section summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.terminal-section summary::-webkit-details-marker {
  display: none;
}

.terminal-section summary::after {
  content: "[↵ run]";
  color: var(--muted);
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0;
}

.terminal-section:hover {
  border-color: rgba(138, 196, 161, 0.45);
  box-shadow: 0 0 0 1px rgba(138, 196, 161, 0.08);
}

.terminal-section[open] summary {
  border-bottom: 1px solid var(--line);
}

.terminal-section[open] {
  border-color: rgba(138, 196, 161, 0.5);
  box-shadow: 0 0 0 1px rgba(138, 196, 161, 0.14);
}

.terminal-section[open] summary::after {
  content: "[● running]";
  color: var(--prompt);
  font-family: "IBM Plex Mono", monospace;
}

.terminal-section .terminal-window {
  border-radius: 0 0 12px 12px;
}

.terminal-section[open] .terminal-window {
  animation: terminal-reveal 220ms ease-out;
}

.terminal-section[open] .terminal-body > * {
  opacity: 0;
  transform: translateY(4px);
  animation: line-in 220ms ease-out forwards;
}

.terminal-section[open] .terminal-body > *:nth-child(1) {
  animation-delay: 40ms;
}

.terminal-section[open] .terminal-body > *:nth-child(2) {
  animation-delay: 80ms;
}

.terminal-section[open] .terminal-body > *:nth-child(3) {
  animation-delay: 120ms;
}

.terminal-section[open] .terminal-body > *:nth-child(4) {
  animation-delay: 160ms;
}

.terminal-section[open] .entry {
  opacity: 0;
  transform: translateY(4px);
  animation: line-in 220ms ease-out forwards;
}

.terminal-section[open] .entry:nth-child(1) {
  animation-delay: 80ms;
}

.terminal-section[open] .entry:nth-child(2) {
  animation-delay: 120ms;
}

.terminal-section[open] .entry:nth-child(3) {
  animation-delay: 160ms;
}

.terminal-section[open] .entry:nth-child(4) {
  animation-delay: 200ms;
}

.section-title {
  color: #8d9e94;
}

.section-note {
  color: var(--terminal-muted);
  font-size: 0.82rem;
}

.entry-list {
  display: grid;
  gap: 14px;
}

.entry {
  display: grid;
  gap: 4px;
}

.entry-head {
  color: #ffffff;
}

.author-self {
  color: #ffffff;
  font-weight: 600;
}

sup {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
}

@keyframes terminal-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cursor-blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--width));
    padding: 16px 0 28px;
  }

  .site-header,
  .hero {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    justify-content: start;
    gap: 10px;
    padding-bottom: 12px;
  }

  .top-links {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
  }

  .theme-toggle {
    padding: 2px 7px;
    font-size: 0.78rem;
  }

  .avatar {
    width: 96px;
    border-radius: 12px;
  }

  main {
    gap: 14px;
    padding-top: 16px;
  }

  .hero {
    gap: 14px;
  }

  .hero-copy {
    gap: 8px;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
    line-height: 0.95;
  }

  .hero-status,
  .eyebrow {
    font-size: 0.76rem;
  }

  .hero-log {
    gap: 7px;
  }

  .hero-log p {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .block-cursor {
    display: none;
  }

  .terminal-bar {
    padding: 10px 12px;
  }

  .terminal-body {
    gap: 9px;
    padding: 14px;
    font-size: 0.84rem;
  }

  .output {
    padding-left: 14px;
  }

  .command-list {
    gap: 8px;
  }

  .terminal-section {
    border-radius: 10px;
  }

  .terminal-section summary {
    padding: 12px 14px;
    font-size: 0.84rem;
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .terminal-section summary::after {
    font-size: 0.72rem;
  }

  .terminal-section .terminal-window {
    border-radius: 0 0 10px 10px;
  }

  .entry-list {
    gap: 12px;
  }

  .entry {
    gap: 5px;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: min(calc(100% - 16px), var(--width));
    padding-top: 14px;
  }

  .brand {
    font-size: 0.9rem;
  }

  .top-links {
    font-size: 0.76rem;
  }

  .avatar {
    width: 88px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 11vw, 2.45rem);
  }

  .hero-log p {
    font-size: 0.89rem;
  }

  .terminal-section summary {
    padding: 11px 12px;
  }

  .terminal-body {
    padding: 12px;
  }
}
