:root {
  --paper: #fbf8f3;
  --white: #ffffff;
  --cream: #f1e7d8;
  --sand: #d7c1a3;
  --wood: #7b4b2b;
  --walnut: #4b2e20;
  --clay: #a76845;
  --sage: #7d876b;
  --blueprint: #3f5158;
  --ink: #27231f;
  --muted: #756b60;
  --line: #e5d8c7;
  --shadow: 0 18px 50px rgba(48, 35, 24, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroLight {
  from {
    background-position: center, 50% 50%;
  }

  to {
    background-position: center, 54% 48%;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(123, 75, 43, 0.16);
  background: rgba(251, 248, 243, 0.88);
  backdrop-filter: blur(18px);
  animation: fadeDown 0.65s ease both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark,
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(123, 75, 43, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--walnut), var(--clay));
  color: var(--white);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(123, 75, 43, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.nav-links a {
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  background: var(--cream);
  color: var(--walnut);
}

.nav-links a:hover {
  transform: translateY(-1px);
}

.nav-action,
.button,
.filter-button,
.contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
}

.nav-action:hover,
.button:hover,
.filter-button:hover,
.contact-actions a:hover {
  transform: translateY(-2px);
}

.nav-action {
  padding: 0 16px;
  background: var(--walnut);
  color: var(--white);
  white-space: nowrap;
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  min-height: min(760px, 78vh);
  padding: clamp(56px, 9vw, 112px) clamp(22px, 6vw, 82px);
  background:
    linear-gradient(90deg, rgba(251, 248, 243, 0.96) 0%, rgba(251, 248, 243, 0.82) 34%, rgba(251, 248, 243, 0.08) 70%),
    url("assets/hero-studio.png") center / cover no-repeat;
  overflow: hidden;
  animation: heroLight 18s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 84px;
  background: linear-gradient(180deg, rgba(251, 248, 243, 0), var(--paper));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(650px, 100%);
  animation: fadeUp 0.78s 0.12s ease both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 18px;
  color: var(--walnut);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 8vw, 7.8rem);
  line-height: 0.92;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 12px;
  color: var(--walnut);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.6vw, 4.1rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.08rem;
}

.hero-copy {
  width: min(560px, 100%);
  margin-bottom: 26px;
  color: #51473f;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  padding: 0 18px;
}

.button.primary {
  background: var(--walnut);
  color: var(--white);
  box-shadow: 0 14px 28px rgba(75, 46, 32, 0.2);
}

.button.ghost {
  border-color: rgba(75, 46, 32, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: var(--walnut);
}

.quick-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(1120px, calc(100% - 36px));
  margin: -34px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  z-index: 5;
  animation: fadeUp 0.76s 0.24s ease both;
}

.quick-strip article {
  min-width: 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.quick-strip span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--blueprint);
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  font-weight: 900;
  line-height: 1;
}

.quick-strip p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.section {
  position: relative;
  z-index: 5;
  padding: clamp(72px, 9vw, 122px) clamp(20px, 6vw, 78px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 0.55fr);
  align-items: end;
  gap: clamp(24px, 6vw, 76px);
  width: min(1180px, 100%);
  margin: 0 auto 34px;
}

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

.section-heading p:last-child {
  color: var(--muted);
  font-size: 1rem;
}

.profile-grid,
.resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.identity-panel,
.tool-panel,
.timeline-panel,
.process-panel,
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 34px rgba(48, 35, 24, 0.07);
}

.project-card {
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(123, 75, 43, 0.28);
  box-shadow: 0 22px 46px rgba(48, 35, 24, 0.13);
}

.identity-panel,
.tool-panel,
.timeline-panel,
.process-panel {
  padding: clamp(22px, 3vw, 34px);
}

.identity-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.avatar {
  width: 58px;
  height: 58px;
  font-size: 1.1rem;
}

.identity-top h3 {
  margin-bottom: 2px;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.identity-top p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
}

.identity-panel > p {
  margin-bottom: 24px;
  color: #4e453e;
  font-size: 1.03rem;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.profile-facts div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(125, 135, 107, 0.25);
  border-radius: var(--radius);
  background: #f8f1e8;
}

.profile-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-facts dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--walnut);
  font-weight: 800;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(63, 81, 88, 0.16);
  border-radius: var(--radius);
  background: #f6faf4;
  color: var(--blueprint);
  font-weight: 800;
}

.projects-section {
  background: #f3ecdf;
}

.project-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: min(1180px, 100%);
  margin: 0 auto 22px;
}

.filter-button {
  min-height: 38px;
  padding: 0 14px;
  border-color: rgba(123, 75, 43, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 0.92rem;
}

.filter-button.is-active,
.filter-button:hover {
  background: var(--walnut);
  color: var(--white);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.project-card[hidden] {
  display: none;
}

.project-carousel {
  position: relative;
  overflow: hidden;
  background: var(--sand);
}

.project-track {
  display: flex;
  width: 100%;
  transition: transform 0.52s cubic-bezier(0.22, 0.8, 0.24, 1);
  will-change: transform;
}

.project-slide {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 16 / 10;
  margin: 0;
  background: #efe2ce;
}

.project-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-slide figcaption {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(75, 46, 32, 0.74);
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--walnut);
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.86;
  transform: translateY(-50%);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

.carousel-button:hover {
  opacity: 1;
  background: var(--white);
}

.carousel-button-prev {
  left: 10px;
}

.carousel-button-next {
  right: 10px;
}

.carousel-dots {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  padding: 7px;
  background: rgba(75, 46, 32, 0.58);
  backdrop-filter: blur(10px);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition:
    width 0.22s ease,
    background-color 0.22s ease;
}

.carousel-dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: var(--white);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-meta span {
  border-radius: 999px;
  background: #f6f0e7;
  padding: 5px 8px;
}

.project-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.project-card p {
  color: #574e45;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.project-metrics span {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--blueprint);
  font-size: 0.88rem;
  font-weight: 900;
}

.resume-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
  border-left: 2px solid var(--sand);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage);
}

.timeline-item time {
  display: block;
  margin-bottom: 4px;
  color: var(--clay);
  font-size: 0.82rem;
  font-weight: 900;
}

.timeline-item h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.process-panel ol {
  display: grid;
  gap: 13px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: process;
}

.process-panel li {
  counter-increment: process;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: var(--muted);
}

.process-panel li::before {
  content: counter(process, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--walnut);
  font-weight: 900;
}

.process-panel strong {
  display: block;
  color: var(--ink);
}

.contact-section {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) auto;
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 34px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(75, 46, 32, 0.94), rgba(63, 81, 88, 0.9)),
    var(--walnut);
  color: var(--white);
  box-shadow: var(--shadow);
}

.contact-section .eyebrow,
.contact-section h2,
.contact-section p {
  color: var(--white);
}

.contact-section p {
  margin-bottom: 0;
  opacity: 0.82;
}

.contact-actions {
  justify-content: flex-end;
}

.contact-actions a {
  gap: 9px;
  min-width: 138px;
  padding: 0 15px;
  background: var(--white);
  color: var(--walnut);
  white-space: nowrap;
}

.contact-actions svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-actions span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(20px, 6vw, 78px) 34px;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--walnut);
  font-weight: 800;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 0.8, 0.24, 1);
}

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

.project-card.reveal.is-visible:hover {
  transform: translateY(-6px);
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    order: 3;
    grid-column: 1 / -1;
    overflow-x: auto;
  }

  .section-heading,
  .profile-grid,
  .resume-layout,
  .contact-section {
    grid-template-columns: 1fr;
  }

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

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .topbar {
    position: static;
    padding: 12px 16px;
  }

  .nav-action {
    display: none;
  }

  .hero {
    min-height: 72vh;
    padding: 48px 18px 78px;
    background:
      linear-gradient(180deg, rgba(251, 248, 243, 0.98) 0%, rgba(251, 248, 243, 0.82) 58%, rgba(251, 248, 243, 0.18) 100%),
      url("assets/hero-studio.png") center / cover no-repeat;
  }

  h1 {
    max-width: 9ch;
    font-size: clamp(2.9rem, 14vw, 4.25rem);
  }

  .quick-strip,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .quick-strip {
    margin-top: -22px;
  }

  .profile-facts,
  .project-metrics {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 18px;
  }

  .footer {
    flex-direction: column;
  }

  .contact-actions a {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

}
