:root {
  --bg: #fffdf8;
  --surface: #ffffff;
  --surface-2: #f6f3ed;
  --ink: #20221f;
  --muted: #686b64;
  --line: #dfd9ce;
  --emerald: #047857;
  --emerald-dark: #03543f;
  --mint: #dbeee5;
  --champagne: #efe2cb;
  --silver: #c8cbc5;
  --shadow: 0 18px 50px rgba(40, 38, 30, 0.11);
  --shadow-soft: 0 10px 28px rgba(40, 38, 30, 0.08);
  --radius: 8px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-space: clamp(76px, 9vw, 122px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

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

img,
svg {
  max-width: 100%;
}

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

::selection {
  background: var(--mint);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--emerald);
  color: white;
  padding: 10px 14px;
  border-radius: 6px;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  backdrop-filter: blur(18px);
}

.site-header.compact {
  border-color: var(--line);
  box-shadow: 0 8px 28px rgba(32, 34, 31, 0.05);
  background: rgba(255, 253, 248, 0.97);
}

.nav {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: min-height 180ms ease;
}

.compact .nav {
  min-height: 64px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--surface);
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark span {
  transform: translateY(-1px);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.nav-link {
  position: relative;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--emerald);
  background: var(--mint);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
  transition: transform 180ms ease, opacity 180ms ease;
}

.section {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: var(--section-space) 0;
  scroll-margin-top: 84px;
}

.hero {
  min-height: min(860px, calc(100svh - 78px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: clamp(32px, 7vw, 92px);
  padding-top: clamp(48px, 7vw, 76px);
}

.hero-copy,
.hero-visual,
.section-heading,
.about-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--emerald);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.45rem, 6.8vw, 6.35rem);
  font-weight: 500;
  overflow-wrap: break-word;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 5vw, 5rem);
  font-weight: 500;
}

h3 {
  font-size: 1.15rem;
}

.hero-subtitle {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 12px 18px;
  border-radius: 6px;
  font-weight: 750;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:focus-visible,
.nav-link:focus-visible,
.brand-mark:focus-visible,
.nav-toggle:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(4, 120, 87, 0.32);
  outline-offset: 3px;
}

.button.primary {
  background: var(--emerald);
  color: white;
  box-shadow: 0 12px 24px rgba(4, 120, 87, 0.18);
}

.button.primary:hover {
  background: var(--emerald-dark);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--silver);
  box-shadow: var(--shadow-soft);
}

.button.text-link {
  min-height: auto;
  padding-inline: 2px;
  color: var(--emerald);
  background: transparent;
}

.button.text-link:hover {
  transform: translateX(3px);
}

.hero-visual {
  min-height: clamp(360px, 44vw, 530px);
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.portrait-frame {
  position: relative;
  width: min(430px, 100%);
  aspect-ratio: 0.78;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform 260ms ease;
}

.portrait-frame::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 12%;
  width: 10px;
  height: 62%;
  background: var(--emerald);
  transform: translateZ(50px);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  right: -16px;
  bottom: 8%;
  width: 42%;
  height: 12px;
  background: var(--champagne);
  transform: translateZ(48px);
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.96) contrast(1.02);
}

.portrait-note {
  position: absolute;
  left: 0;
  bottom: 0;
  min-width: 142px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 14px 16px;
  color: var(--emerald);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  transform: translateZ(64px);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 7vw, 92px);
  align-items: start;
}

.about-copy {
  display: grid;
  gap: 20px;
  color: var(--muted);
  font-size: 1.08rem;
}

.about-copy p {
  margin: 0;
}

.juzgro-section {
  padding-top: 40px;
}

.juzgro-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding: clamp(32px, 6vw, 64px);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 10px solid var(--emerald);
  box-shadow: var(--shadow);
}

.juzgro-panel .eyebrow {
  color: var(--emerald);
}

.juzgro-copy p {
  color: var(--muted);
  font-size: 1.08rem;
}

.juzgro-panel .button.primary {
  background: var(--emerald);
  color: white;
  box-shadow: 0 12px 24px rgba(4, 120, 87, 0.18);
}

.clients-section {
  padding-top: 44px;
}

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

.client-logo-button {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(16px, 2.4vw, 26px);
  box-shadow: 0 1px 0 rgba(32, 34, 31, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.client-logo-button:hover {
  border-color: var(--silver);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px);
}

.client-logo-button img {
  display: block;
  width: min(100%, 180px);
  max-height: 82px;
  object-fit: contain;
}

.section-intro {
  max-width: 780px;
  margin-bottom: 44px;
}

.section-intro p:not(.section-kicker) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(255px, auto);
  gap: 16px;
  perspective: 1200px;
}

.work-card {
  position: relative;
  display: flex;
  min-height: 255px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 28px;
  box-shadow: 0 1px 0 rgba(32, 34, 31, 0.04);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
  transform-style: preserve-3d;
}

.work-card:hover {
  border-color: var(--silver);
  box-shadow: var(--shadow-soft);
}

.work-card.tall {
  grid-row: span 2;
  background: var(--mint);
}

.work-card.wide {
  grid-column: span 2;
  background: var(--surface-2);
}

.card-index {
  color: var(--emerald);
  font-weight: 800;
}

.work-card h3 {
  margin: 44px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.5vw, 2.55rem);
  font-weight: 500;
}

.work-card p {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag-list span {
  border: 1px solid rgba(32, 34, 31, 0.14);
  background: rgba(255, 255, 255, 0.68);
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  color: var(--emerald);
  font-weight: 800;
}

.timeline-body h3 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.timeline-body p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric {
  min-height: 184px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  margin-bottom: 18px;
  color: var(--emerald);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  font-weight: 500;
  line-height: 0.92;
}

.metric span {
  color: var(--muted);
  font-weight: 650;
}

.award-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.award-list p {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 18px;
  color: var(--ink);
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.skills-block,
.education-block {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(26px, 4vw, 44px);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 34px;
}

.skills-grid h3,
.education-list h3 {
  margin-bottom: 8px;
}

.skills-grid p,
.education-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.education-list {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.education-list article {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.education-list span {
  display: inline-block;
  margin-top: 8px;
  color: var(--emerald);
  font-weight: 800;
}

.contact-section {
  padding-top: 44px;
}

.contact-card {
  max-width: 900px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(34px, 7vw, 72px);
  box-shadow: var(--shadow);
}

.contact-card p:not(.section-kicker) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
}

.footer a {
  position: relative;
}

.footer a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.footer a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.footer {
  width: min(var(--max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 34px 0 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

.footer div {
  display: flex;
  gap: 18px;
  color: var(--emerald);
  font-weight: 750;
}

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 620ms ease, transform 620ms ease;
}

.motion-ready .reveal {
  opacity: 0;
  transform: translateY(22px);
}

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

@media (min-width: 1440px) {
  :root {
    --max: 1280px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  }

  .portrait-frame {
    width: min(470px, 100%);
  }
}

@media (max-width: 1040px) {
  .hero,
  .about-grid,
  .juzgro-panel,
  .profile-section {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
    min-height: auto;
    padding-top: 56px;
  }

  .hero-visual {
    min-height: 380px;
    justify-items: start;
  }

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

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

  .work-card.tall,
  .work-card.wide {
    grid-row: auto;
    grid-column: auto;
  }

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

  .metric {
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  .metric:last-child {
    grid-column: span 2;
    border-bottom: 0;
  }

  .footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  :root {
    --gutter: clamp(14px, 4.5vw, 28px);
    --section-space: clamp(66px, 11vw, 88px);
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-line:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
    transform: rotate(-45deg);
  }

  .nav-menu {
    position: fixed;
    inset: 72px var(--gutter) auto var(--gutter);
    display: grid;
    gap: 4px;
    padding: 10px;
    max-height: calc(100svh - 92px);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

  .nav-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    padding: 14px;
  }

  h2 {
    font-size: clamp(2.05rem, 8vw, 3.35rem);
  }

  .juzgro-panel {
    padding: clamp(26px, 7vw, 42px);
    border-left-width: 7px;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

@media (max-width: 640px) {
  .nav {
    min-height: 68px;
  }

  .compact .nav {
    min-height: 60px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-menu {
    top: 66px;
  }

  .section {
    scroll-margin-top: 74px;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    margin-bottom: 18px;
    font-size: clamp(2.7rem, 14.5vw, 4.15rem);
  }

  .hero-subtitle,
  .about-copy,
  .juzgro-copy p,
  .contact-card p:not(.section-kicker) {
    font-size: 1rem;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 26px;
  }

  .button {
    width: 100%;
    min-height: 48px;
    padding-inline: 14px;
  }

  .button.text-link {
    width: auto;
    justify-content: flex-start;
  }

  .hero-visual {
    min-height: auto;
    padding-top: 10px;
  }

  .portrait-frame {
    width: min(310px, 86vw);
    padding: 10px;
  }

  .portrait-frame::before {
    left: -12px;
    width: 7px;
  }

  .portrait-frame::after {
    right: -10px;
    height: 9px;
  }

  .portrait-note {
    min-width: 118px;
    padding: 11px 12px;
    font-size: 0.68rem;
  }

  .about-grid,
  .juzgro-panel,
  .clients-grid,
  .work-grid,
  .skills-grid,
  .award-list,
  .metric-row,
  .profile-section {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-auto-rows: auto;
  }

  .client-logo-button {
    min-height: 132px;
  }

  .work-card {
    min-height: auto;
    padding: 22px;
  }

  .work-card h3 {
    margin-top: 34px;
    font-size: clamp(1.48rem, 9vw, 2rem);
  }

  .tag-list span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .metric,
  .metric:nth-child(2n),
  .metric:last-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .metric {
    min-height: auto;
    padding: 22px;
  }

  .metric strong {
    margin-bottom: 12px;
  }

  .skills-block,
  .education-block,
  .contact-card {
    padding: 24px;
  }

  .footer div {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: clamp(2.35rem, 13vw, 3.05rem);
  }

  h2 {
    font-size: clamp(1.85rem, 10vw, 2.5rem);
  }

  .work-card,
  .skills-block,
  .education-block,
  .contact-card,
  .juzgro-panel {
    padding-inline: 18px;
  }
}

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

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

  .portrait-frame,
  .work-card {
    transform: none !important;
  }
}
