:root {
  --bg: #f5eadb;
  --bg-soft: #efe2d1;
  --ink: #20120b;
  --ink-soft: #5d4638;
  --line: rgba(74, 46, 32, 0.16);
  --line-strong: rgba(74, 46, 32, 0.24);
  --panel: rgba(255, 249, 241, 0.8);
  --panel-strong: rgba(255, 252, 247, 0.92);
  --accent: #b7672a;
  --accent-strong: #7f3811;
  --accent-soft: #e7b47b;
  --shadow: 0 28px 70px rgba(69, 39, 21, 0.12);
  --radius-xl: 30px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(183, 103, 42, 0.16), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(127, 56, 17, 0.12), transparent 24%),
    linear-gradient(180deg, #f7eee3 0%, #efe3d3 52%, #eadbc9 100%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

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

img {
  max-width: 100%;
  display: block;
}

.page {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 92px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(250, 242, 231, 0.84);
  box-shadow: 0 18px 40px rgba(80, 48, 29, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 8px rgba(183, 103, 42, 0.08);
}

.brand strong,
h1,
h2,
h3,
h4,
.metric-value,
.project-name,
.section-title,
.display {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link,
.nav-pill,
.chip,
.tag,
.mini-tag {
  border-radius: 999px;
}

.nav-link,
.nav-pill {
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.nav-pill {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(74, 46, 32, 0.08);
}

.nav-link:hover,
.project-card:hover,
.study-link:hover,
.cta:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 38px;
  padding: 50px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 251, 246, 0.96), rgba(246, 235, 219, 0.82));
  box-shadow: var(--shadow);
}

.hero > :first-child {
  position: relative;
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -7% -18% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 103, 42, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-rail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  align-self: stretch;
}

.profile-card {
  position: relative;
  margin: 0;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(183, 103, 42, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(27, 21, 17, 0.96), rgba(55, 33, 20, 0.92));
  box-shadow: 0 22px 48px rgba(69, 39, 21, 0.12);
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(15, 10, 7, 0.22));
  pointer-events: none;
}

.profile-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  object-position: center top;
}

.eyebrow,
.chip,
.tag,
.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--accent-strong);
  background: rgba(183, 103, 42, 0.12);
}

.display {
  margin: 0;
  font-size: clamp(3.15rem, 7vw, 6.2rem);
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.lede {
  max-width: 42rem;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.04rem, 2vw, 1.18rem);
  line-height: 1.78;
}

.hero-actions,
.contact-row,
.metric-row,
.project-meta,
.stack-row,
.cta-row,
.inline-actions,
.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
  font-weight: 600;
}

.cta.primary {
  color: #fff7f0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 34px rgba(127, 56, 17, 0.18);
}

.cta.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(74, 46, 32, 0.12);
}

.cta.text-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-strong);
}

.hero-panel,
.section-panel,
.project-card,
.study-shell,
.timeline-item,
.system-card,
.impact-card,
.quote-card,
.contact-card {
  border: 1px solid rgba(74, 46, 32, 0.1);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(69, 39, 21, 0.05);
  backdrop-filter: blur(12px);
}

.hero-panel {
  padding: 24px;
  align-self: end;
}

.panel-grid,
.metrics-grid,
.projects-grid,
.two-up,
.three-up,
.timeline,
.system-grid,
.impact-grid,
.resume-grid,
.footer-grid {
  display: grid;
  gap: 18px;
}

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

.metric {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(74, 46, 32, 0.1);
}

.metric-value {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.section {
  margin-top: 56px;
}

.section-panel,
.study-shell,
.contact-card {
  padding: 32px;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.72rem, 3vw, 2.55rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.section-copy,
.body-copy,
.list,
.footer-copy,
.project-summary,
.study-summary,
.fact-list,
.timeline-copy,
.caption {
  color: var(--ink-soft);
  line-height: 1.75;
}

.projects-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
}

.project-card {
  display: grid;
  gap: 0.25rem;
  padding: 28px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(250, 242, 231, 0.9));
  grid-column: span 4;
  align-content: start;
  position: relative;
}

.project-card::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 20px;
  height: 1px;
  background: linear-gradient(90deg, rgba(127, 56, 17, 0.2), transparent 70%);
}

.project-card:nth-child(1) {
  grid-column: span 7;
  min-height: 320px;
}

.project-card:nth-child(2) {
  grid-column: span 5;
  min-height: 320px;
}

.project-card:nth-child(1) .project-name,
.project-card:nth-child(2) .project-name {
  font-size: 2.05rem;
}

.project-card:nth-child(3),
.project-card:nth-child(4),
.project-card:nth-child(5) {
  min-height: 270px;
}

.project-card:hover {
  border-color: rgba(127, 56, 17, 0.26);
  box-shadow: 0 20px 44px rgba(69, 39, 21, 0.1);
}

.project-name {
  margin: 12px 0 8px;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.project-summary {
  margin: 0 0 16px;
  max-width: 32rem;
  font-size: 0.98rem;
}

.project-card-actions {
  margin-top: auto;
  padding-bottom: 12px;
}

#work .section-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

#work .section-head {
  margin-bottom: 34px;
  max-width: 54rem;
}

#work .section-title {
  font-size: clamp(2rem, 3.3vw, 3rem);
}

#work .section-copy {
  font-size: 1rem;
}

.chip,
.tag,
.mini-tag {
  color: var(--accent-strong);
  background: rgba(183, 103, 42, 0.1);
  border: 1px solid rgba(183, 103, 42, 0.12);
}

.tag {
  font-size: 0.7rem;
}

.mini-tag {
  font-size: 0.68rem;
  letter-spacing: 0.09em;
}

.stack-row {
  margin-top: 12px;
}

.stack-row span,
.fact-list span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(74, 46, 32, 0.08);
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.two-up {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 20px;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.list li + li {
  margin-top: 10px;
}

.timeline-item,
.system-card,
.impact-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.58);
}

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

.timeline-item h3,
.system-card h3,
.impact-card h3,
.quote-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.system-grid,
.impact-grid,
.resume-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.quote-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(127, 56, 17, 0.08), rgba(183, 103, 42, 0.06));
}

.quote-card p {
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.75;
}

.contact-card {
  background: linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(241, 229, 214, 0.88));
}

.contact-card .impact-card {
  background: rgba(255, 255, 255, 0.64);
}

.about-section .two-up {
  gap: 24px;
  align-items: start;
}

.about-section .section-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: transparent;
}

.about-section .section-panel:first-child {
  padding: 8px 34px 0 0;
}

.about-section .section-panel:last-child {
  padding: 30px 0 0 34px;
  border-left: 1px solid rgba(74, 46, 32, 0.12);
}

.context-section .section-panel,
.preview-section .preview-shell,
.contact-section .contact-card {
  border: 0;
  border-top: 1px solid rgba(74, 46, 32, 0.12);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: transparent;
  padding: 28px 0 0;
}

.context-section .system-card {
  background: rgba(255, 255, 255, 0.76);
}

.preview-section .preview-shell,
.contact-section .contact-card {
  padding-top: 28px;
}

.context-section .section-head,
.preview-section .section-head,
.contact-section .section-head {
  max-width: 52rem;
}

.context-section .section-panel,
.preview-section .preview-shell,
.contact-section .contact-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: start;
}

.context-section .section-head,
.preview-section .section-head,
.contact-section .section-head {
  margin-bottom: 0;
}

.context-section .section-title,
.preview-section .section-title,
.contact-section .section-title {
  font-size: clamp(2rem, 3.1vw, 2.8rem);
}

.preview-section .inline-actions {
  margin-top: auto;
  justify-content: flex-start;
  align-self: end;
}

.contact-section .resume-grid {
  margin-top: 0;
}

.contact-section .impact-card {
  background: rgba(255, 255, 255, 0.78);
}

.preview-section {
  margin-top: 52px;
}

.contact-section .contact-card {
  align-items: start;
}

.footer {
  margin-top: 52px;
  padding: 16px 0 8px;
}

.footer-grid {
  grid-template-columns: 1.3fr auto;
  align-items: end;
  padding-top: 18px;
  border-top: 1px solid rgba(74, 46, 32, 0.12);
}

.footer-copy {
  margin: 0;
}

.study-hero {
  display: grid;
  gap: 16px;
}

.study-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.study-summary {
  max-width: 48rem;
  margin: 0;
  font-size: 1.04rem;
}

.preview-shell {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(74, 46, 32, 0.1);
  background: linear-gradient(160deg, rgba(255, 251, 246, 0.98), rgba(241, 229, 214, 0.88));
  box-shadow: 0 12px 28px rgba(69, 39, 21, 0.06);
}

.preview-copy {
  max-width: 46rem;
}

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

.browser-frame {
  overflow: hidden;
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid rgba(74, 46, 32, 0.12);
  background: #120f0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.browser-dots {
  display: inline-flex;
  gap: 8px;
}

.browser-dots span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.browser-dots span:nth-child(1) {
  background: #ff6057;
}

.browser-dots span:nth-child(2) {
  background: #ffbd2f;
}

.browser-dots span:nth-child(3) {
  background: #28ca42;
}

.browser-url {
  min-width: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 249, 241, 0.72);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-preview {
  width: 100%;
  height: 720px;
  border: 0;
  background: #ffffff;
}

.mock-product {
  display: grid;
  gap: 18px;
  padding: 22px;
  min-height: 720px;
  background:
    radial-gradient(circle at top right, rgba(183, 103, 42, 0.18), transparent 30%),
    linear-gradient(180deg, #1a120d 0%, #241711 100%);
  color: #f7eee3;
}

.mock-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mock-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 238, 227, 0.78);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mock-hero {
  display: grid;
  gap: 12px;
}

.mock-hero h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.mock-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(231, 180, 123, 0.14);
  color: #f1c993;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mock-hero p,
.mock-note,
.mock-card p {
  margin: 0;
  color: rgba(247, 238, 227, 0.78);
  line-height: 1.7;
}

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

.mock-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mock-card strong {
  display: block;
  margin-bottom: 8px;
  color: #fff7f0;
  font-size: 1rem;
}

.mock-note {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(183, 103, 42, 0.14);
  border: 1px solid rgba(231, 180, 123, 0.18);
}

.mock-dashboard {
  display: grid;
  gap: 16px;
}

.mock-dashboard-top {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.mock-dashboard-bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mock-panel {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mock-panel h4 {
  margin: 0 0 10px;
  color: #fff7f0;
  font-size: 1rem;
}

.mock-panel p {
  margin: 0;
  color: rgba(247, 238, 227, 0.72);
  line-height: 1.7;
}

.mock-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mock-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mock-stat strong {
  display: block;
  margin-bottom: 6px;
  color: #fff7f0;
  font-size: 1.2rem;
}

.mock-stat span {
  color: rgba(247, 238, 227, 0.68);
  font-size: 0.88rem;
  line-height: 1.5;
}

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

.mock-list-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mock-list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mock-list-item strong,
.mock-list-item span {
  display: block;
}

.mock-list-item strong {
  color: #fff7f0;
  font-size: 0.96rem;
}

.mock-list-item span {
  color: rgba(247, 238, 227, 0.68);
  font-size: 0.84rem;
  line-height: 1.5;
}

.mock-status {
  align-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(231, 180, 123, 0.12);
  color: #f1c993;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.study-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.fact {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(74, 46, 32, 0.1);
}

.fact strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--accent-strong);
}

.divider {
  height: 1px;
  margin: 8px 0 0;
  background: linear-gradient(90deg, rgba(127, 56, 17, 0.18), transparent);
}

@media (max-width: 960px) {
  .hero,
  .projects-grid,
  .two-up,
  .three-up,
  .timeline,
  .system-grid,
  .impact-grid,
  .resume-grid,
  .study-facts,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .topnav {
    justify-content: flex-start;
  }

  .browser-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-grid,
  .context-section .section-panel,
  .preview-section .preview-shell,
  .contact-section .contact-card,
  .mock-metrics,
  .mock-dashboard-top,
  .mock-dashboard-bottom,
  .mock-stat-grid {
    grid-template-columns: 1fr;
  }

  .browser-url {
    width: 100%;
  }

  .app-preview {
    height: 540px;
  }

  .page {
    width: min(var(--max), calc(100% - 22px));
    padding-top: 14px;
  }

  .profile-card,
  .profile-image {
    min-height: 320px;
  }

  .hero,
  .section-panel,
  .study-shell,
  .contact-card {
    padding: 22px;
  }

  .preview-shell {
    padding: 22px;
  }

  .project-card,
  .project-card:nth-child(1),
  .project-card:nth-child(2) {
    min-height: 0;
  }

  .about-section .two-up {
    gap: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .about-section .section-panel {
    border: 1px solid rgba(74, 46, 32, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 24px rgba(69, 39, 21, 0.05);
    background: rgba(255, 249, 241, 0.8);
    padding: 22px;
  }

  .about-section .section-panel + .section-panel {
    border-left: 0;
  }
}
