:root {
  --bg: #0c1117;
  --bg-alt: #121922;
  --panel: rgba(15, 22, 31, 0.84);
  --panel-strong: rgba(10, 15, 21, 0.94);
  --text: #f6f3eb;
  --muted: #aab6c3;
  --line: rgba(255, 255, 255, 0.1);
  --warm: #f4a261;
  --cool: #76d7c4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 16px;
  --max: 1220px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244, 162, 97, 0.18), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(118, 215, 196, 0.12), transparent 20%),
    linear-gradient(180deg, #0b1016 0%, #0f151d 40%, #0a1017 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  pointer-events: none;
}

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

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.page-shell,
.lab-shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 0;
  backdrop-filter: blur(16px);
}

.wordmark {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.section {
  padding: 3.8rem 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding-top: 4.5rem;
}

.hero-copy {
  align-self: center;
}

.eyebrow,
.detail-label {
  color: var(--warm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 0.98;
}

h1,
h2 {
  font-family: "Fraunces", serif;
}

h1 {
  font-size: clamp(3.4rem, 8vw, 6.3rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
}

.hero-lead {
  max-width: 42rem;
  margin: 1.4rem 0 0;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: #ebf0f5;
}

.hero-summary,
.section-copy {
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.65;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.8rem;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.contact-chip {
  padding: 0.75rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.contact-chip span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.contact-chip strong,
.contact-chip a {
  color: #edf4fa;
  font-weight: 600;
}

.button,
.detail-actions a,
.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover,
.button:focus-visible,
.detail-actions a:hover,
.detail-actions a:focus-visible,
.detail-close:hover,
.detail-close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
}

.button.primary {
  background: linear-gradient(135deg, #f4a261, #e76f51);
  color: #15100c;
  border-color: transparent;
}

.button.ghost,
.detail-actions a,
.detail-close {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.hero-panel,
.panel,
.project-card,
.nex-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1.4rem;
}

.profile-figure {
  margin: 0 0 1.1rem;
}

.profile-frame {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at top, rgba(244, 162, 97, 0.14), transparent 45%);
}

.profile-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 14, 19, 0) 40%, rgba(9, 14, 19, 0.14) 100%);
}

.profile-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
}

.profile-caption {
  margin-top: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #dde7ef;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.signal-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4a261, #76d7c4);
  box-shadow: 0 0 0 8px rgba(118, 215, 196, 0.08);
}

.hero-metrics,
.detail-meta,
.pillar-list,
.timeline,
.filter-bar,
.file-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.metric-card,
.meta-chip,
.filter-button,
.file-tab {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.metric-card {
  min-width: 148px;
  padding: 1rem;
}

.metric-card strong {
  display: block;
  font-size: 1.45rem;
  color: #fff3e6;
}

.metric-card span,
.perf-list,
.meta-chip,
.project-card p,
.nex-card p {
  color: var(--muted);
}

.perf-card {
  margin-top: 1rem;
  padding: 1.2rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.perf-title {
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.perf-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.7;
}

.section-heading {
  margin-bottom: 1.8rem;
}

.section-heading-inline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.resume-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}

.resume-detail-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

.panel {
  padding: 1.4rem;
}

.pillar {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.6;
}

.timeline-item {
  padding: 1rem;
  min-width: 220px;
  flex: 1 1 220px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline-item strong {
  display: block;
  color: #fff0e3;
  margin-bottom: 0.4rem;
}

.timeline-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.project-card,
.nex-card {
  position: relative;
  overflow: hidden;
  padding: 1.2rem;
}

.project-card::before,
.nex-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-surface, linear-gradient(135deg, rgba(244, 162, 97, 0.1), transparent 60%));
  opacity: 0.9;
  pointer-events: none;
}

.project-card > *,
.nex-card > * {
  position: relative;
  z-index: 1;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.card-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--card-accent, var(--warm));
}

.card-title {
  font-size: 1.35rem;
  margin: 0.15rem 0 0.6rem;
}

.card-copy {
  min-height: 4.8rem;
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.skill-cloud {
  margin-top: 0;
}

.resume-projects,
.experience-list {
  display: grid;
  gap: 0.9rem;
}

.resume-project-card,
.experience-item {
  padding: 1rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.resume-project-top,
.experience-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.resume-project-card h4,
.experience-item h4 {
  margin: 0;
  font-size: 1rem;
}

.resume-project-card p,
.experience-copy,
.experience-company {
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.impact-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(244, 162, 97, 0.12);
  border: 1px solid rgba(244, 162, 97, 0.28);
  color: #ffe6cf;
  font-size: 0.82rem;
  white-space: nowrap;
}

.experience-panel {
  margin-top: 0;
}

.tag,
.filter-button,
.file-tab,
.meta-chip {
  padding: 0.5rem 0.8rem;
  font-size: 0.84rem;
}

.tag {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf4fa;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.project-status {
  color: #edf4fa;
  font-weight: 700;
}

.card-link {
  font-weight: 700;
  color: var(--card-accent-soft, var(--cool));
}

.filter-bar {
  justify-content: end;
}

.filter-button,
.file-tab {
  cursor: pointer;
  color: var(--muted);
}

.filter-button.active,
.file-tab.active {
  color: #0e141b;
  background: linear-gradient(135deg, #f4a261, #76d7c4);
  border-color: transparent;
}

.detail-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 12, 0.75);
  backdrop-filter: blur(14px);
}

.detail-panel {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  bottom: 1.2rem;
  width: min(880px, calc(100% - 2.4rem));
  padding: 1.2rem;
  overflow-y: auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.detail-close {
  margin-left: auto;
}

.detail-header {
  margin-top: 1.2rem;
}

.detail-summary {
  color: var(--muted);
  line-height: 1.7;
}

.detail-meta {
  margin-top: 1.3rem;
}

.meta-chip {
  color: #dde7ef;
}

.detail-demo {
  margin-top: 1.4rem;
}

.demo-frame,
.demo-placeholder {
  width: 100%;
  min-height: 360px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.demo-frame {
  background: #10161d;
}

.demo-placeholder {
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.detail-code {
  margin-top: 1.4rem;
}

.file-tabs {
  margin-bottom: 0.9rem;
}

.code-block {
  margin: 0;
  min-height: 280px;
  padding: 1.2rem;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #091016;
  color: #d7e3ec;
  line-height: 1.65;
  font-size: 0.92rem;
}

.hidden {
  display: none;
}

.token-keyword {
  color: #f8b66d;
}

.token-string {
  color: #8adbbf;
}

.token-comment {
  color: #7f8b96;
}

.token-number {
  color: #8dc9ff;
}

.token-tag {
  color: #ff928b;
}

.lab-body {
  background:
    radial-gradient(circle at 20% 20%, rgba(244, 162, 97, 0.18), transparent 24%),
    radial-gradient(circle at 80% 30%, rgba(118, 215, 196, 0.16), transparent 22%),
    linear-gradient(180deg, #0c1117 0%, #0a1017 100%);
}

.lab-shell {
  padding: 2rem 0 3rem;
}

.lab-header {
  padding: 1rem 0 1.2rem;
}

.lab-panel {
  display: grid;
  gap: 1rem;
}

.lab-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.5rem;
}

.field label {
  color: #edf4fa;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
}

.field textarea {
  min-height: 180px;
  resize: vertical;
}

.lab-output {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #edf4fa;
  line-height: 1.7;
}

.experience-body {
  background:
    radial-gradient(circle at 15% 15%, rgba(244, 162, 97, 0.2), transparent 22%),
    radial-gradient(circle at 85% 25%, rgba(118, 215, 196, 0.18), transparent 20%),
    linear-gradient(180deg, #0b1118 0%, #0b1016 100%);
}

.experience-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 3rem;
  position: relative;
  z-index: 1;
}

.experience-header,
.experience-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.experience-hero {
  padding: 2rem 0 1.6rem;
}

.experience-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 1rem;
}

.experience-side {
  display: grid;
  gap: 1rem;
}

.experience-stage,
.experience-stats {
  padding: 1.3rem;
}

.stage-header {
  margin-bottom: 1rem;
}

.experience-intro {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.experience-controls,
.experience-output {
  display: grid;
  gap: 1rem;
}

.result-box,
.style-preview,
.calc-screen {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.result-box {
  min-height: 88px;
  color: #f6f3eb;
  font-weight: 700;
  line-height: 1.7;
  word-break: break-word;
}

.pill-list,
.result-stack,
.console-stack {
  display: grid;
  gap: 0.8rem;
}

.result-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.result-card strong {
  display: block;
  margin-bottom: 0.4rem;
  color: #fff2e3;
}

.result-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.meter {
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, #f4a261, #76d7c4);
}

.style-preview {
  min-height: 180px;
  color: #111;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.4rem;
}

.style-preview p {
  margin: 0;
  max-width: 26rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.calc-button {
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.calc-button:hover,
.calc-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.calc-screen {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  text-align: right;
}

.console-line {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e4edf4;
}

.console-line strong {
  color: var(--warm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.console-line span,
.console-line em {
  color: var(--muted);
}

.console-line em {
  font-style: normal;
}

@media (max-width: 1080px) {
  .hero,
  .resume-columns,
  .card-grid,
  .resume-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .site-header,
  .section-heading-inline,
  .hero,
  .resume-columns,
  .card-grid,
  .resume-detail-grid,
  .lab-form-grid,
  .experience-layout,
  .health-grid,
  .experience-hero,
  .experience-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    justify-content: stretch;
  }

  .hero {
    gap: 1.35rem;
    padding-top: 2.4rem;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .section-heading-inline {
    align-items: start;
  }

  .filter-bar {
    justify-content: start;
  }

  .resume-project-top,
  .experience-topline {
    flex-direction: column;
  }

  .project-footer {
    flex-direction: column;
    align-items: start;
  }

  .metric-card {
    flex: 1 1 180px;
  }

  .profile-figure {
    max-width: 520px;
    margin-inline: auto;
  }

  .detail-panel {
    inset: 0.8rem;
    width: auto;
  }

  .console-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell,
  .lab-shell,
  .experience-shell {
    width: min(var(--max), calc(100% - 1rem));
  }

  .section {
    padding: 2.5rem 0;
  }

  .hero-actions,
  .detail-actions,
  .contact-strip {
    gap: 0.7rem;
  }

  .hero-actions .button,
  .detail-actions a,
  .detail-actions button,
  .contact-chip {
    width: 100%;
  }

  .site-nav {
    gap: 0.7rem;
  }

  .hero-panel,
  .panel,
  .project-card,
  .nex-card,
  .detail-panel,
  .experience-stage,
  .experience-stats {
    padding: 1rem;
    border-radius: 20px;
  }

  .metric-card {
    min-width: 100%;
  }

  .tag,
  .filter-button,
  .file-tab,
  .meta-chip {
    font-size: 0.8rem;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .card-copy {
    min-height: auto;
  }

  .card-topline {
    flex-direction: column;
  }

  .demo-frame,
  .demo-placeholder {
    min-height: 280px;
    border-radius: 18px;
  }

  .code-block {
    min-height: 220px;
    font-size: 0.84rem;
    padding: 1rem;
  }

  .field input,
  .field textarea,
  .calc-button {
    min-height: 52px;
  }

  .calc-grid {
    gap: 0.6rem;
  }

  .calc-screen {
    font-size: 1.5rem;
  }

  .impact-chip {
    white-space: normal;
  }
}
