@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/space-grotesk-300.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/space-grotesk-400.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-500.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
}

:root {
  --bg: #0a0d0f;
  --bg-alt: #10151a;
  --fg: #c9d1d9;
  --fg-dim: #7d8590;
  --accent: #00ff9c;
  --accent-cyan: #5fd7ff;
  --accent-dim: #0b3d2c;
  --border: #22292f;
  --seg-ctx-bg: #1c2128;
  --seg-path-bg: #99982e;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code",
    Menlo, Consolas, "Liberation Mono", monospace;
  --font-display: "Space Grotesk", var(--font-mono);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% 0%, rgba(0, 255, 156, 0.05), transparent 70%),
    repeating-linear-gradient(rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 3px);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  margin: 0;
  padding: 0 clamp(24px, 8vw, 140px);
}

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

a:hover {
  text-decoration: underline;
}

.prompt {
  color: var(--accent);
}

.agnoster {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: clamp(0.85rem, 1.1vw, 1.05rem);
  margin: 0;
}

.command-line {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  margin: 0 0 32px;
}

.seg {
  display: flex;
  align-items: center;
  padding: 0.55em 1em;
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: 1.3;
  white-space: nowrap;
}

.seg-ctx {
  background: var(--seg-ctx-bg);
  color: var(--fg);
}

.seg-path {
  background: var(--seg-path-bg);
  color: var(--bg);
  font-weight: 600;
}

.arrow {
  width: 0;
  height: 0;
  flex-shrink: 0;
  border-style: solid;
  border-width: 1.2em 0 1.2em 0.7em;
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.arrow-ctx {
  border-left-color: var(--seg-ctx-bg);
  background-color: var(--seg-path-bg);
}

.arrow-path {
  border-left-color: var(--seg-path-bg);
  background-color: transparent;
}

.cmd-title {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.01em;
  text-transform: lowercase;
}

.cmd-title .char {
  opacity: 0;
}

.cmd-title.is-typing .char.is-shown,
.cmd-title.is-done .char {
  opacity: 1;
}

.cmd-title .cursor {
  display: inline-block;
  width: 0.7em;
  height: 0.08em;
  margin-left: 0.12em;
  background: currentColor;
  vertical-align: baseline;
  transform: translateY(0.18em);
  opacity: 0;
}

.cmd-title.is-done .cursor {
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

@media (max-width: 480px) {
  .seg-ctx,
  .arrow-ctx {
    display: none;
  }
}

/* header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 13, 15, 0.9);
  backdrop-filter: blur(4px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--fg-dim);
  font-size: 14px;
}

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

/* hero */

.hero {
  padding-top: clamp(48px, 8vw, 96px);
  padding-bottom: clamp(48px, 6vw, 72px);
  display: grid;
  gap: clamp(32px, 5vw, 64px);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
  }

  .hero-tagline {
    order: 1;
  }

  .terminal {
    order: 2;
  }
}

.terminal {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-alt);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 255, 156, 0.03), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #0d1116;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
  margin-left: 8px;
  color: var(--fg-dim);
  font-size: 12px;
}

.terminal-body {
  padding: 20px;
  min-height: 90px;
}

.terminal-body p {
  margin: 0 0 8px;
}

.output {
  color: var(--fg);
}

.cursor-line {
  margin-bottom: 0;
}

.blink {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}

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

.hero-tagline h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.5vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--fg);
}

.hero-tagline p {
  color: var(--fg-dim);
  max-width: 640px;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  margin: 0;
}

/* sections */

.section {
  padding-top: clamp(40px, 6vw, 80px);
  padding-bottom: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--border);
}

.section-note {
  color: var(--fg-dim);
  font-size: 13px;
  margin: -12px 0 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.projects-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 28px;
  border-radius: 4px;
  transition: border-color 0.15s ease;
}

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

.focus-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
}

.focus-grid .card {
  padding: clamp(24px, 3vw, 44px);
}

.focus-grid .card h3 {
  font-size: clamp(1.3rem, 1.8vw, 1.9rem);
}

.focus-grid .card p {
  font-size: clamp(14px, 1vw, 17px);
}

@media (max-width: 900px) {
  .focus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .focus-grid {
    grid-template-columns: 1fr;
  }
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0 0 12px;
  font-size: 1.3rem;
  color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 14px;
}

.card.placeholder {
  opacity: 0.75;
}

.project-card {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  padding: clamp(24px, 3vw, 36px);
}

.project-card h3 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  line-height: 1.2;
  margin: 0;
}

.project-card p {
  font-size: clamp(1rem, 1.3vw, 1.4rem);
  line-height: 1.7;
  color: var(--fg-dim);
  margin: 0;
}

@media (max-width: 560px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

.link-arrow {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
}

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

.list li::before {
  content: "» ";
  color: var(--fg-dim);
}

.list.inline {
  display: flex;
  gap: 24px;
}

.list.inline li::before {
  content: none;
}

/* footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
}

.site-footer p {
  color: var(--fg-dim);
  font-size: 13px;
  margin: 0;
}

/* writeups */

.writeup-page {
  --writeup-green: #7fe4b8;
  --writeup-ink: #dfeae4;
  background-color: #08110d;
  background-image:
    linear-gradient(rgba(127, 228, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 228, 184, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 85% 10%, rgba(127, 228, 184, 0.13), transparent 28%),
    radial-gradient(circle at 5% 80%, rgba(95, 215, 255, 0.08), transparent 25%);
  background-size: 36px 36px, 36px 36px, auto, auto;
}

.writeup-shell,
.post-shell {
  position: relative;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) 0 120px;
}

.writeup-shell {
  width: min(100% - 40px, 980px);
}

.post-shell {
  width: min(100% - 40px, 1400px);
}

.writeup-shell::before,
.post-shell::before {
  content: "";
  position: absolute;
  top: 72px;
  right: -6vw;
  width: clamp(90px, 13vw, 180px);
  aspect-ratio: 1;
  border: 1px solid rgba(127, 228, 184, 0.35);
  transform: rotate(45deg);
  box-shadow: 0 0 0 12px rgba(127, 228, 184, 0.04), 0 0 36px rgba(127, 228, 184, 0.12);
  pointer-events: none;
}

.writeup-kicker,
.meta {
  color: var(--writeup-green);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.writeup-shell h1,
.post-shell h1 {
  position: relative;
  max-width: 780px;
  margin: 12px 0 42px;
  color: var(--writeup-ink);
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
  font-weight: 500;
}

.writeup-shell h1::after {
  content: "_";
  color: var(--writeup-green);
}

.writeup-intro {
  max-width: 580px;
  margin: -20px 0 48px;
  color: #9eb5aa;
  font-size: 1.05rem;
}

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

.writeup-shell .list li {
  position: relative;
  margin: 0;
  padding: 22px 28px;
  border: 1px solid rgba(127, 228, 184, 0.18);
  background: rgba(11, 20, 17, 0.78);
  box-shadow: 8px 8px 0 rgba(127, 228, 184, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.writeup-shell .list li::before {
  content: "//";
  margin-right: 14px;
  color: var(--writeup-green);
}

.writeup-shell .list li:hover {
  border-color: var(--writeup-green);
  background: rgba(18, 35, 28, 0.92);
  transform: translateX(8px);
}

.writeup-shell .list a {
  color: var(--writeup-ink);
  border: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.writeup-shell .list a:hover {
  color: var(--writeup-green);
  text-decoration: none;
}

.writeup-excerpt {
  max-width: 760px;
  margin: 8px 0 0;
  color: #8fa99c;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
}

#latest-writeups .writeup-excerpt {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--fg-dim);
  font-size: 13px;
}

.top-link,
.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--writeup-green);
  font-size: 13px;
}

.post-shell {
  max-width: 1440px;
}

.post-shell .meta {
  margin: 0 0 14px;
}

.post-shell h1 {
  margin: 0 0 54px;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
}

.post-shell article {
  position: relative;
  width: 88%;
  max-width: 1240px;
  padding: clamp(28px, 6vw, 68px);
  border: 1px solid rgba(127, 228, 184, 0.24);
  border-radius: 2px;
  background: rgba(8, 17, 13, 0.9);
  box-shadow: 14px 14px 0 rgba(127, 228, 184, 0.07), 0 20px 60px rgba(0, 0, 0, 0.25);
}

.post-shell article::before {
  content: "EOF";
  position: absolute;
  top: 18px;
  right: 24px;
  color: rgba(127, 228, 184, 0.5);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.post-shell article h2,
.post-shell article h3 {
  color: var(--writeup-ink);
  font-family: var(--font-display);
  line-height: 1.2;
}

.post-shell article h2 {
  margin: 0 0 28px;
  color: var(--writeup-green);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.post-shell article h3 {
  margin: 42px 0 14px;
  font-size: 1.3rem;
}

.post-shell article p {
  margin: 0 0 22px;
  color: #c1d0c8;
  font-size: 1.04rem;
  line-height: 1.85;
}

.post-shell article strong {
  color: var(--writeup-green);
}

.post-shell article code {
  padding: 3px 7px;
  border: 1px solid rgba(127, 228, 184, 0.18);
  border-radius: 2px;
  background: rgba(127, 228, 184, 0.08);
  color: var(--writeup-green);
}

.post-shell article pre {
  position: relative;
  overflow-x: auto;
  margin: 28px 0 30px;
  padding: 58px 28px 26px;
  border: 1px solid rgba(127, 228, 184, 0.2);
  border-radius: 5px;
  background:
    linear-gradient(#101914, #101914) top / 100% 38px no-repeat,
    #050b08;
  box-shadow: 10px 10px 0 rgba(127, 228, 184, 0.06), 0 14px 30px rgba(0, 0, 0, 0.25);
}

.post-shell article pre::before {
  content: "tty1  —  bash";
  position: absolute;
  top: 0;
  left: 18px;
  right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  color: #71877c;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.post-shell article pre::after {
  content: "X";
  position: absolute;
  top: 0;
  right: 18px;
  height: 38px;
  display: flex;
  align-items: center;
  color: #8fa99c;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.post-shell article pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c8e8d8;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre;
}

.post-shell article ul,
.post-shell article ol {
  margin: 0 0 24px;
  padding-left: 24px;
  color: #c1d0c8;
}

.post-shell article li {
  margin-bottom: 10px;
  padding-left: 6px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .writeup-shell,
  .post-shell {
    width: min(100% - 28px, 980px);
    padding-top: 48px;
  }

  .writeup-shell::before,
  .post-shell::before {
    right: -30px;
    top: 32px;
    opacity: 0.55;
  }

  .writeup-shell .list li {
    padding: 18px;
  }

  .post-shell article {
    width: 100%;
    box-shadow: 7px 7px 0 rgba(127, 228, 184, 0.07);
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: auto;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }

  .nav ul {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }

  .hero {
    padding-top: 32px;
  }
}
