:root {
  /* Page background and lighting */
  --bg: #191714;
  --bg-gradient-start: #242019;
  --bg-gradient-end: #1e1b17;
  --bg-grid-line: rgba(222, 197, 149, 0.045);
  --bg-glow-primary: rgba(180, 106, 20, 0.22);
  --bg-glow-accent: rgba(242, 184, 75, 0.12);
  --bg-overlay-mid: rgba(8, 7, 5, 0.18);
  --bg-overlay-end: rgba(8, 7, 5, 0.36);

  /* Surfaces and depth */
  --panel: rgba(42, 38, 32, 0.9);
  --button-bg: rgba(49, 43, 33, 0.88);
  --project-bg-start: rgba(65, 56, 41, 0.82);
  --project-bg-end: rgba(35, 31, 25, 0.94);
  --card-bg: rgba(52, 46, 36, 0.74);
  --tag-bg: rgba(255, 255, 255, 0.04);
  --shadow: rgba(0, 0, 0, 0.22);

  /* Text */
  --text: #f5f1e8;
  --muted: #aaa398;
  --text-intro: #cbc3b6;
  --text-body: #d2cabd;
  --text-soft: #bdb5a8;
  --text-dim: #756e64;
  --text-footer: #898176;

  /* Accent and interactions */
  --accent: #f2b84b;
  --accent-strong: #ffc966;
  --accent-hover: #ffdc91;
  --accent-soft: rgba(242, 184, 75, 0.1);
  --accent-line-soft: rgba(242, 184, 75, 0.12);
  --accent-ring: rgba(242, 184, 75, 0.5);
  --accent-contrast: #241704;

  /* Borders and indicators */
  --border: rgba(224, 207, 177, 0.19);
  --border-bright: rgba(242, 184, 75, 0.34);
  --section-index: rgba(190, 178, 157, 0.34);

  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-line) 1px, transparent 1px),
    radial-gradient(circle at 12% 5%, var(--bg-glow-primary), transparent 33rem),
    radial-gradient(circle at 88% 16%, var(--bg-glow-accent), transparent 28rem),
    linear-gradient(145deg, var(--bg-gradient-start) 0%, var(--bg) 55%, var(--bg-gradient-end) 100%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  color: var(--text);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--bg-overlay-mid) 70%, var(--bg-overlay-end) 100%);
  z-index: -1;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.page {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 460px;
  padding: 76px 0 54px;
  border-bottom: 1px solid var(--border);
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.eyebrow span { width: 28px; height: 1px; background: currentColor; }

h1 {
  max-width: 780px;
  margin: 0 0 24px;
  color: var(--text);
  font-size: clamp(3.5rem, 8vw, 6.75rem);
  font-weight: 780;
  letter-spacing: -0.06em;
  line-height: 0.94;
}

.subtitle {
  max-width: 800px;
  margin: 0;
  color: var(--text-intro);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.7;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 118px;
  padding: 11px 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--text);
  font-size: 0.91rem;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: var(--border-bright);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

.button.primary { background: var(--accent); border-color: transparent; color: var(--accent-contrast); }
.button.primary:hover { background: var(--accent-strong); color: var(--accent-contrast); }

.section {
  margin-top: 32px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 24px 80px var(--shadow);
  backdrop-filter: blur(12px);
}

.hero + .projects { margin-top: 24px; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading.compact { margin-bottom: 20px; }
.section-kicker { margin: 0 0 5px; }
.section-index { color: var(--section-index); font-family: ui-monospace, monospace; font-size: 0.8rem; }

h2 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.025em; line-height: 1.2; }
h3 { margin: 0 0 12px; font-size: 1.15rem; letter-spacing: -0.012em; }
p { margin: 0 0 16px; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--project-bg-start), var(--project-bg-end));
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 180px;
  height: 180px;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  opacity: 0.45;
}

.project-card:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.project-topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 52px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-type { color: var(--accent); }
.project-card h3 { font-size: 1.45rem; }
.project-card .muted { flex-grow: 1; }
.project-link { position: relative; z-index: 1; width: fit-content; margin: 2px 0 8px; font-weight: 700; font-size: 0.9rem; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); }
.card-icon { display: inline-block; margin-bottom: 22px; color: var(--accent); font-family: ui-monospace, monospace; font-size: 1rem; }
.card p { margin-bottom: 0; }
.muted { color: var(--muted); }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: clamp(42px, 7vw, 76px);
  align-items: start;
}

.about-copy { max-width: 620px; }
.about-copy p { color: var(--text-body); font-size: 1.04rem; }

.career {
  padding-left: clamp(0px, 1.5vw, 16px);
}

.career > h3 {
  margin-bottom: 24px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 24px;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 9px;
  left: 3px;
  width: 1px;
  background: linear-gradient(var(--accent), var(--accent-line-soft));
}

.timeline li {
  position: relative;
  padding: 0 0 26px;
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -25px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

.timeline time {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.timeline h4 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.4;
}

.timeline p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.timeline .timeline-org { margin: -2px 0 5px; color: var(--text-soft); font-weight: 650; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 20px 0 0; list-style: none; }
.tag {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--tag-bg);
  color: var(--text-soft);
  font-family: ui-monospace, monospace;
  font-size: 0.74rem;
}

.skills .tag-list { margin-top: 0; }
.skills .tag { padding: 8px 12px; }

footer { padding: 42px 0 0; color: var(--text-footer); text-align: center; font-size: 0.86rem; }
footer p { margin: 0; }

@media (max-width: 820px) {
  .hero { min-height: auto; padding: 72px 0 52px; }
  .about-layout { grid-template-columns: 1fr; gap: 34px; }
  .about-copy { max-width: 100%; }
  .career { padding-left: 0; }
}

@media (max-width: 680px) {
  .page { width: min(calc(100% - 32px), var(--max-width)); padding-top: 16px; }
  .hero { padding: 56px 0 42px; }
  h1 { font-size: clamp(3rem, 15vw, 4.3rem); }
  .section { margin-top: 20px; padding: 26px 20px; border-radius: 16px; }
  .project-grid, .grid { grid-template-columns: 1fr; }
  .project-card { min-height: 300px; padding: 22px; }
  .project-topline { margin-bottom: 38px; }
  .button { flex: 1 1 100px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
