:root {
  --bg: #fbf7ef;
  --bg-alt: #efe3d7;
  --text: #1f1a16;
  --muted: #655d54;
  --accent: #8a5f43;
  --accent-pop: #d26a3d;
  --border: #d9cbbd;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  cursor: default;
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  letter-spacing: 0;
}

body::after {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  height: 7px;
  left: var(--cursor-x, -20px);
  opacity: 0.35;
  pointer-events: none;
  position: fixed;
  top: var(--cursor-y, -20px);
  transform: translate(-50%, -50%);
  width: 7px;
  z-index: 100;
}

a,
button {
  color: inherit;
  font: inherit;
}

button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

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

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

p {
  margin: 0;
}

.site-nav {
  background: rgba(250, 250, 248, 0.82);
  border-bottom: 1px solid transparent;
  left: 0;
  padding: 22px 0;
  position: sticky;
  top: 0;
  transition: padding 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease, background 0.25s ease;
  width: 100%;
  z-index: 50;
}

.site-nav--scrolled {
  backdrop-filter: blur(16px);
  background: rgba(250, 250, 248, 0.94);
  border-color: var(--border);
  padding: 13px 0;
}

.nav-brand {
  color: var(--text);
  font-family: "Cormorant Garamond", serif;
  font-size: 25px;
  font-weight: 600;
  text-decoration: none;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 30px;
}

.nav-links button,
.nav-links a {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-links button:hover,
.nav-links a:hover,
.nav-links .is-active {
  color: var(--accent);
}

.nav-links .is-active::after {
  background-image: url("data:image/svg+xml,%3Csvg width='170' height='12' viewBox='0 0 170 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8C34 5 61 7 88 6C116 5 142 5 166 7' stroke='%23d26a3d' stroke-width='5' stroke-linecap='round' stroke-opacity='0.76'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  bottom: -8px;
  content: "";
  height: 10px;
  left: var(--nav-mark-left, -4%);
  pointer-events: none;
  position: absolute;
  transform: rotate(-0.6deg);
  width: var(--nav-mark-width, 108%);
}

.nav-link--portfolio {
  --nav-mark-left: -5%;
  --nav-mark-width: 110%;
}

.nav-link--tools {
  --nav-mark-left: -4%;
  --nav-mark-width: 112%;
}

.nav-link--about,
.nav-link--resume {
  --nav-mark-left: -7%;
  --nav-mark-width: 114%;
}

.nav-link--contact {
  --nav-mark-left: -5%;
  --nav-mark-width: 110%;
}

.nav-toggle {
  display: none;
  height: 36px;
  position: relative;
  width: 36px;
}

.nav-toggle span {
  background: var(--text);
  display: block;
  height: 1px;
  margin: 7px auto;
  width: 22px;
}

.section-pad {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.fallback-container {
  margin: 0 auto;
  max-width: 1100px;
  padding: 0 20px;
}

.fallback-hero-grid,
.fallback-about-grid {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: 1.05fr 0.8fr;
}

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

.home-page {
  background: var(--bg);
}

.home-page .hero-section {
  background:
    radial-gradient(ellipse at 78% 22%, rgba(210, 106, 61, 0.24) 0%, rgba(210, 106, 61, 0.09) 36%, rgba(210, 106, 61, 0) 70%),
    radial-gradient(ellipse at 16% 18%, rgba(138, 95, 67, 0.2) 0%, rgba(138, 95, 67, 0.08) 42%, rgba(138, 95, 67, 0) 74%),
    linear-gradient(180deg, #dac0ac 0%, #ead8c8 66%, #fbf7ef 100%);
  color: var(--text);
}

.home-page #work {
  background:
    linear-gradient(180deg, #fbf7ef 0%, #fffdf8 18%, #fffdf8 76%, #efe3d7 100%);
}

.home-page #about {
  background:
    radial-gradient(ellipse at 82% 12%, rgba(210, 106, 61, 0.2) 0%, rgba(210, 106, 61, 0.08) 36%, rgba(210, 106, 61, 0) 70%),
    linear-gradient(180deg, #6f4c3b 0%, #4b342a 100%);
  border-top: 1px solid rgba(210, 106, 61, 0.24);
  color: #fff8ef;
}

.home-page #about .eyebrow {
  color: #f0a06f;
}

.home-page #about .bio-copy,
.home-page #about .fact span,
.home-page #about .skill-cloud span {
  color: rgba(255, 248, 239, 0.78);
}

.home-page #about .bio-copy strong,
.home-page #about .fact strong {
  color: #fff8ef;
}

.home-page #about .fact-grid,
.home-page #about .fact,
.home-page #about .skill-cloud span {
  border-color: rgba(255, 248, 239, 0.18);
}

.home-page #about .skill-cloud span {
  background: rgba(255, 248, 239, 0.08);
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero-section {
  min-height: calc(100vh - 72px);
}

.hero-copy h1 {
  display: inline-block;
  font-size: 64px;
  isolation: isolate;
  margin-bottom: 18px;
  position: relative;
}

.hero-subhead {
  color: var(--muted);
  font-size: 20px;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.75;
  max-width: 520px;
}

.portrait {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  border-radius: 22px;
  height: auto;
  object-fit: cover;
  width: min(100%, 400px);
}

figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
}

.btn {
  align-items: center;
  border: 1px solid var(--accent);
  display: inline-flex;
  font-size: 14px;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  color: var(--accent);
}

.bio-copy {
  color: var(--text);
  display: grid;
  font-size: 18px;
  gap: 22px;
  line-height: 1.75;
}

.bio-copy strong {
  color: var(--accent);
  font-weight: 400;
}

.fact-grid {
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fact {
  border-bottom: 1px solid var(--border);
  min-height: 104px;
  padding: 22px;
}

.fact:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.fact:nth-last-child(-n + 1) {
  border-bottom: 0;
}

.fact span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-bottom: 10px;
}

.fact strong {
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span,
.project-tags span {
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  padding: 7px 11px;
}

.skill-cloud span {
  background: rgba(250, 250, 248, 0.72);
}

.section-heading {
  margin-bottom: 46px;
}

.section-heading h2,
.contact-footer h2 {
  font-size: 48px;
  margin-bottom: 14px;
}

.home-page #work .section-heading h2 {
  display: inline-block;
  isolation: isolate;
  position: relative;
}

.home-page #work .section-heading h2::before {
  background: rgba(210, 106, 61, 0.24);
  bottom: 0.08em;
  clip-path: polygon(0 18%, 99% 5%, 100% 82%, 2% 96%);
  content: "";
  height: 0.5em;
  left: -0.08em;
  opacity: 1;
  pointer-events: none;
  position: absolute;
  right: -0.1em;
  transform: rotate(-0.6deg) skewX(-4deg);
  transform-origin: left center;
  z-index: -1;
}

.section-heading p,
.contact-footer p {
  color: var(--muted);
  font-size: 17px;
}

.tools-hero h1 {
  font-size: 58px;
  max-width: 820px;
}

.tools-intro {
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
  padding-left: 32px;
}

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

.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 26px;
}

.tool-card span {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.tool-card h3 {
  font-size: 30px;
  margin-bottom: 16px;
}

.tool-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.tool-card strong {
  border-top: 1px solid var(--border);
  display: block;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  margin-top: auto;
  padding-top: 20px;
}

.technical-edge h2 {
  font-size: 46px;
}

.edge-list {
  border-top: 1px solid var(--border);
}

.edge-list div {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 24px;
  grid-template-columns: 52px 1fr;
  padding: 28px 0;
}

.edge-list span {
  color: var(--accent);
  font-family: "Cormorant Garamond", serif;
  font-size: 38px;
  line-height: 1;
}

.edge-list p {
  color: var(--text);
  font-size: 18px;
  line-height: 1.65;
}

.tools-proof {
  background: var(--bg-alt);
}

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

.workflow-card {
  background: var(--bg);
  border: 1px solid var(--border);
  min-height: 220px;
}

.workflow-card img {
  aspect-ratio: 5 / 3;
  border-bottom: 1px solid var(--border);
  object-fit: cover;
  width: 100%;
}

.workflow-card div {
  padding: 22px;
}

.workflow-card h3 {
  font-size: 25px;
  margin-bottom: 12px;
}

.workflow-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

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

.project-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  box-shadow: 0 22px 54px rgba(24, 24, 26, 0.12);
  transform: scale(1.02);
}

.project-image {
  aspect-ratio: 700 / 460;
  overflow: hidden;
  position: relative;
}

.project-image img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  width: 100%;
}

.project-card:hover img {
  transform: scale(1.04);
}

.project-overlay {
  align-items: end;
  background: linear-gradient(180deg, rgba(24, 24, 26, 0), rgba(24, 24, 26, 0.58));
  bottom: 0;
  color: #fff;
  display: flex;
  font-size: 15px;
  inset-inline: 0;
  justify-content: flex-start;
  opacity: 0;
  padding: 26px;
  position: absolute;
  top: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-body {
  padding: 26px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-body h3 {
  font-size: 27px;
  margin: 0 0 12px;
}

.project-body p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.project-body strong,
.back-link,
.contact-links a {
  color: var(--accent);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
}

.contact-footer {
  background: var(--text);
  color: #fff;
  padding: 88px 0 38px;
}

.contact-footer--compact {
  margin-top: 60px;
}

.contact-footer p {
  color: #bdb8af;
  margin-bottom: 28px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  justify-content: center;
  margin-bottom: 54px;
}

.contact-links a {
  color: #efe8df;
}

.contact-footer small {
  color: #8f8980;
  font-size: 13px;
}

.case-hero {
  padding: 44px 0 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 26px;
}

.case-hero-image {
  aspect-ratio: 1100 / 580;
  border: 1px solid var(--border);
  object-fit: cover;
  width: 100%;
}

.meta-bar {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.meta-bar div {
  border-right: 1px solid var(--border);
  padding: 22px;
}

.meta-bar div:last-child {
  border-right: 0;
}

.meta-bar span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 9px;
  text-transform: uppercase;
}

.meta-bar strong {
  display: block;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

.case-content {
  margin: 0 auto;
  max-width: 720px;
  padding: 76px 20px 0;
}

.case-toc {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 58px;
  padding: 16px 0;
}

.case-toc a {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.case-toc a:hover {
  color: var(--accent);
}

.case-section {
  border-top: 1px solid rgba(196, 102, 50, 0.2);
  margin-bottom: 68px;
  padding-top: 30px;
  scroll-margin-top: 96px;
}

.section-kicker {
  margin-bottom: 22px;
}

.section-kicker h3 {
  color: var(--accent);
  display: inline-block;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.45;
  padding: 0 5px 1px;
  position: relative;
  text-transform: uppercase;
  z-index: 0;
}

.section-kicker h3::before {
  background: rgba(196, 102, 50, 0.22);
  bottom: 0;
  content: "";
  height: 58%;
  left: -3px;
  position: absolute;
  right: -6px;
  transform: rotate(-1.2deg) skewX(-8deg);
  transform-origin: left center;
  z-index: -1;
}

.case-section:nth-of-type(2n) .section-kicker h3::before {
  left: -6px;
  right: -3px;
  transform: rotate(0.8deg) skewX(7deg);
}

.case-section:nth-of-type(3n) .section-kicker h3::before {
  transform: rotate(-0.4deg) skewX(-5deg);
}

.case-section p,
.case-section {
  color: var(--text);
  font-size: 18px;
  line-height: 1.78;
}

.case-note {
  color: var(--accent) !important;
  font-size: 13px !important;
  letter-spacing: 0.04em;
  line-height: 1.5 !important;
  margin: -10px 0 18px;
}

.case-list {
  counter-reset: case-list;
  display: grid;
  gap: 18px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.case-list li {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 16px;
  grid-template-columns: 42px 1fr;
  padding-top: 18px;
}

.case-list li::before {
  color: var(--accent-pop);
  content: counter(case-list, decimal-leading-zero);
  counter-increment: case-list;
  font-family: "Cormorant Garamond", serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

.prep-grid {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  gap: 16px;
  margin-top: 28px;
  padding: 24px 0;
}

.prep-label {
  color: var(--accent-pop);
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  letter-spacing: 0.14em;
  position: relative;
  text-transform: uppercase;
  width: fit-content;
}

.prep-label::after {
  background: var(--text);
  color: var(--bg);
  content: attr(data-note);
  font-size: 12px;
  left: 0;
  letter-spacing: 0;
  line-height: 1.45;
  max-width: min(440px, calc(100vw - 48px));
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  position: absolute;
  text-transform: none;
  top: calc(100% + 10px);
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  width: max-content;
  z-index: 4;
}

.prep-label:hover::after,
.prep-label:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

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

.prep-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 210px;
  padding: 18px;
}

.prep-item > span {
  color: var(--accent-pop);
  display: block;
  font-size: 12px;
  margin-bottom: 22px;
}

.prep-item strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 12px;
}

.prep-item p {
  color: var(--muted);
  display: block;
  font-size: 14px;
  line-height: 1.5;
}

.case-proof {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.case-proof--paired {
  align-items: start;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
}

.case-proof figure {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.case-video {
  aspect-ratio: 4 / 3;
  background: var(--text);
  border: 1px solid var(--border);
  display: block;
  object-fit: cover;
  width: 100%;
}

.asset-grid {
  display: grid;
  gap: 16px;
  height: 100%;
}

.asset-grid img {
  background: #fff;
  border: 1px solid var(--border);
  display: block;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: left top;
  width: 100%;
}

.case-proof:not(.case-proof--paired) .asset-grid img {
  height: auto;
  object-fit: contain;
}

.case-proof--paired .asset-grid figure {
  height: 100%;
}

.case-proof--paired .asset-grid img {
  aspect-ratio: 1.92 / 1;
}

.case-proof figcaption {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-top: 9px;
  text-transform: uppercase;
}

.stats-row {
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat {
  min-height: 154px;
  padding: 24px 18px;
}

.stat:not(:last-child) {
  border-right: 1px solid var(--border);
}

.stat strong {
  color: var(--accent-pop);
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 58px;
  font-weight: 600;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.stat span {
  color: var(--muted);
  display: block;
  font-size: 14px;
  line-height: 1.35;
  margin-top: 12px;
}

.results-note {
  color: var(--muted) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  margin-top: 16px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  body::after {
    display: none;
  }
}

@media (max-width: 820px) {
  .site-nav {
    padding: 15px 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    display: none;
    flex-direction: column;
    gap: 0;
    left: 0;
    padding: 10px 20px;
    position: absolute;
    right: 0;
    top: 100%;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links button,
  .nav-links a {
    padding: 14px 0;
    text-align: left;
    width: 100%;
  }

  .section-pad {
    padding: 60px 0;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .portrait {
    width: 100%;
  }

  .bio-copy,
  .case-section p,
  .case-section {
    font-size: 16px;
  }

  .fact-grid,
  .work-grid,
  .fallback-hero-grid,
  .fallback-about-grid,
  .meta-bar,
  .asset-grid,
  .case-proof--paired,
  .stats-row,
  .prep-items {
    grid-template-columns: 1fr;
  }

  .section-kicker {
    margin-bottom: 18px;
  }

  .prep-item {
    min-height: auto;
  }

  .fact,
  .fact:nth-child(odd),
  .meta-bar div,
  .stat:not(:last-child) {
    border-right: 0;
  }

  .fact:not(:last-child),
  .meta-bar div:not(:last-child),
  .stat:not(:last-child) {
    border-bottom: 1px solid var(--border);
  }

  .section-heading h2,
  .contact-footer h2 {
    font-size: 38px;
  }

  .tools-hero h1,
  .technical-edge h2 {
    font-size: 38px;
  }

  .tools-intro {
    border-left: 0;
    border-top: 1px solid var(--border);
    font-size: 16px;
    padding-left: 0;
    padding-top: 24px;
  }

  .tools-grid,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

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

  .edge-list div {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .edge-list p {
    font-size: 16px;
  }

  .project-card:hover {
    transform: none;
  }

  .case-content {
    padding-top: 56px;
  }

  .stat strong {
    font-size: 48px;
  }

  .case-proof--paired .asset-grid img {
    aspect-ratio: 4 / 3;
  }
}
