/* Final visual polish: warm editorial palette, responsive navigation and subtle interaction */

:root {
  --bg: #e9e6e1;
  --hero: #d8d3cc;
  --paper: #f7f5f1;
  --ink: #1b1b1a;
  --muted: #65615c;
  --line: rgba(27, 27, 26, 0.68);
  --soft-line: rgba(27, 27, 26, 0.24);
  --yellow: #e8e0c8;
  --mint: #c8d1c2;
  --blue: #cbd5dc;
  --lavender: #d5d1c9;
}

body {
  background: var(--bg);
}

#about,
#skills,
#portfolio,
#resume,
#contact {
  scroll-margin-top: 2rem;
}

.brand-block,
.connect-block,
.nav-pills a,
.work-link,
.email-chip,
.project-meta a,
.footer-links a {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    text-decoration-color 180ms ease;
}

.brand-block {
  background: #eee7ce;
}

.brand-block:hover {
  transform: translateY(-2px);
  background: #e5dcc0;
  box-shadow: 0 8px 18px rgba(27, 27, 26, 0.05);
}

.connect-block {
  background: #ccd6dc;
}

.connect-block:hover {
  transform: translateY(-2px);
  background: #becbd3;
  box-shadow: 0 8px 18px rgba(27, 27, 26, 0.05);
}

.nav-pills a {
  background: #c9d1c3;
}

.nav-pills a:hover {
  transform: translateY(-2px);
  background: #bac6b3;
  box-shadow: 0 8px 18px rgba(27, 27, 26, 0.045);
}

.work-link {
  background: rgba(247, 245, 241, 0);
}

.work-link:hover {
  transform: translateY(-2px);
  background: rgba(247, 245, 241, 0.34);
}

.work-link:hover span:last-child {
  transform: translateX(5px);
}

.orbit-one,
.plate-two,
.highlight,
.email-chip {
  background: #e7dfc7;
}

.orbit-two,
.plate-three {
  background: #cad3c4;
}

.accent-line {
  color: #ded6b9;
}

.project-visual:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(27, 27, 26, 0.075);
}

.project-meta a,
.footer-links a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(27, 27, 26, 0.4);
}

.project-meta a:hover,
.footer-links a:hover {
  text-decoration-color: currentColor;
}

.email-chip:hover {
  transform: translateY(-2px);
  background: #ded5b7;
  box-shadow: 0 8px 18px rgba(27, 27, 26, 0.05);
}

.brand-block:focus-visible,
.connect-block:focus-visible,
.nav-pills a:focus-visible,
.work-link:focus-visible,
.project-visual:focus-visible,
.project-meta a:focus-visible,
.email-chip:focus-visible,
.footer-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* Project covers: case-study composition rather than decorative mockups */
.project-grid {
  gap: 18px;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.project-visual {
  isolation: isolate;
  aspect-ratio: 1.08 / 1;
  background-image:
    linear-gradient(rgba(255,255,255,.08), rgba(255,255,255,0));
}

.project-visual::before {
  inset: 14px;
  border-color: rgba(247, 245, 241, 0.32);
}

.cover-copy {
  position: absolute;
  left: 6.5%;
  top: 8%;
  z-index: 3;
  width: 35%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cover-kicker {
  margin-bottom: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cover-copy strong {
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 4.4vw, 5rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.04em;
}

.cover-foot {
  max-width: 235px;
  padding-top: 12px;
  border-top: 1px dashed rgba(27, 27, 26, 0.4);
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ethico-visual {
  background-color: #b8c9c4;
}

.ethico-phone {
  left: auto;
  right: 7%;
  top: 50%;
  width: 43%;
  height: 72%;
  padding: 22px 20px 20px;
  transform: translateY(-50%) rotate(2.4deg);
  border-radius: 30px;
  background: #f5f2eb;
  box-shadow: 16px 18px 0 rgba(27, 27, 26, 0.08);
}

.ethico-visual:hover .ethico-phone {
  transform: translateY(-51%) rotate(1.2deg);
}

.phone-bar {
  width: 31%;
  height: 5px;
  margin: 0 auto 23px;
}

.ethico-wordmark {
  margin-bottom: 19px;
  font-size: clamp(1.8rem, 2.8vw, 3.1rem);
}

.barcode {
  height: 80px;
  gap: 4px;
  margin-bottom: 22px;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(27, 27, 26, 0.24);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ethico-orbit {
  width: auto;
  height: auto;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.orbit-one {
  left: auto;
  right: 42%;
  top: 18%;
  transform: rotate(-5deg);
}

.orbit-two {
  right: 4.5%;
  bottom: 13%;
  transform: rotate(4deg);
}

.visual-caption {
  left: 6.5%;
  bottom: 5.5%;
  font-size: 0.75rem;
}

.wendler-visual {
  background-color: #c8ced1;
}

.wendler-cover-copy {
  width: 34%;
}

.wendler-visual .plate {
  container-type: inline-size;
  z-index: 1;
  opacity: 0.9;
  box-shadow: inset 0 0 0 12px rgba(27, 27, 26, 0.05);
}

/* Keep numerals above the centre hole as each plate changes size. */
.wendler-visual .plate span {
  position: absolute;
  top: 7%;
  transform: none;
  font-size: 32cqi;
  line-height: 1;
}

.wendler-visual .plate-one {
  left: auto;
  right: 20%;
  top: 10%;
  width: clamp(160px, 16vw, 220px);
  height: auto;
  aspect-ratio: 1;
}

.wendler-visual .plate-two {
  right: 5%;
  top: 13%;
  width: clamp(132px, 13vw, 185px);
  height: auto;
  aspect-ratio: 1;
}

.wendler-visual .plate-three {
  right: auto;
  left: 7%;
  bottom: 12%;
  width: clamp(100px, 10vw, 160px);
  height: auto;
  aspect-ratio: 1;
}

/* Align the desktop plates in reading order; keep the mobile grid unchanged. */
@media (min-width: 761px) {
  .wendler-visual .plate {
    top: 25%;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
  }
  .wendler-visual .plate-one { left: 37%; width: 24%; }
  .wendler-visual .plate-two { left: 56%; width: 21%; }
  .wendler-visual .plate-three { left: 73%; width: 18%; }
}

.wendler-visual .terminal-card {
  z-index: 2;
  right: 6%;
  bottom: 8%;
  width: 45%;
  min-height: 39%;
  padding: 22px;
  transform: rotate(1.8deg);
}

.project-copy {
  min-height: 0;
  padding-top: 26px;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.project-title-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.project-title-row > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.project-copy > p {
  margin-bottom: 22px;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    width: min(calc(100% - 36px), var(--max));
  }

  .nav-pills {
    display: flex;
    justify-self: center;
  }

  .nav-pills a {
    min-width: 96px;
    padding: 13px 10px 14px;
    font-size: 1.08rem;
  }

  .brand-block,
  .connect-block {
    font-size: 1.08rem;
  }

  .project-visual {
    aspect-ratio: 1.32 / 1;
  }

  .cover-copy {
    width: 31%;
  }

  .cover-copy strong {
    font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  }
}

@media (max-width: 760px) {
  .site-header {
    width: min(calc(100% - 24px), var(--max));
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 14px;
  }

  .brand-block {
    justify-self: center;
    padding: 12px 18px 13px;
    font-size: 1.05rem;
  }

  .nav-pills {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr minmax(44px, 0.75fr) 1.2fr;
    width: 100%;
    gap: 5px;
  }

  .nav-pills a {
    min-width: 0;
    padding: 11px 6px 12px;
    font-size: 0.98rem;
  }

  .connect-block {
    display: none;
  }

  .hero-kicker {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .work-link {
    gap: 20px;
    padding: 12px 16px;
    font-size: 1.12rem;
  }

  .section-pad {
    padding-top: 82px;
    padding-bottom: 82px;
  }

  .project-grid {
    gap: 44px;
  }

  .project-visual {
    display: grid;
    aspect-ratio: auto;
    gap: 18px 12px;
    padding: 28px 22px 22px;
  }

  .project-visual > * {
    position: relative;
    inset: auto;
  }

  .cover-copy,
  .wendler-cover-copy {
    width: auto;
  }

  .cover-kicker {
    margin-bottom: 12px;
  }

  .cover-copy strong {
    margin-bottom: 0;
    font-size: clamp(2.2rem, 7vw, 3.15rem);
    line-height: 0.95;
  }

  .cover-foot {
    display: none;
  }

  .ethico-visual {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: center;
  }

  .ethico-phone {
    width: 100%;
    max-width: 220px;
    justify-self: end;
    aspect-ratio: 0.62;
    height: auto;
    min-height: 210px;
    padding: 16px 10px;
    transform: rotate(2deg);
    border-radius: 23px;
    box-shadow: 7px 9px 0 rgba(27, 27, 26, 0.08);
  }

  .ethico-visual:hover .ethico-phone {
    transform: rotate(1deg) translateY(-2px);
  }

  .phone-bar {
    margin-bottom: 15px;
  }

  .ethico-wordmark {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  .barcode {
    height: 58px;
    margin-bottom: 14px;
    gap: 3px;
  }

  .phone-status {
    padding-top: 9px;
    gap: 4px;
    letter-spacing: 0;
  }

  .ethico-orbit {
    display: grid;
    justify-self: start;
    padding: 7px 10px;
    transform: none;
  }

  .visual-caption {
    grid-column: 1 / -1;
  }

  .wendler-visual {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }

  .wendler-cover-copy {
    grid-column: 1 / -1;
  }

  .wendler-cover-copy strong {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em;
  }

  .wendler-cover-copy strong br {
    display: none;
  }

  .wendler-visual .plate {
    inset: auto;
    width: 100%;
    max-width: 140px;
    height: auto;
    justify-self: center;
    box-shadow: inset 0 0 0 6px rgba(27, 27, 26, 0.05);
  }

  .wendler-visual .terminal-card {
    grid-column: 1 / -1;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 16px;
    transform: none;
    box-shadow: 7px 9px 0 rgba(27, 27, 26, 0.08);
  }

  .wendler-visual:hover .terminal-card {
    transform: translateY(-2px);
  }

  .terminal-head {
    margin-bottom: 12px;
    padding-bottom: 9px;
  }

  .terminal-line {
    margin: 6px 0;
    font-size: 0.85rem;
  }

  .project-copy {
    min-height: 0;
    padding: 22px 2px 0;
  }

  .project-title-row {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .project-title-row h3 {
    font-size: 1.75rem;
  }

  .project-title-row > span {
    max-width: 140px;
  }

  .project-meta {
    flex-direction: column;
    gap: 8px;
  }

}

@media (max-width: 480px) {
  .site-header {
    width: calc(100% - 20px);
  }

  .brand-block {
    justify-self: stretch;
    text-align: center;
  }

  .nav-pills a {
    padding: 10px 3px 11px;
    font-size: 0.9rem;
  }

  .about-lead h2,
  .portfolio-heading h2,
  .process-heading h2,
  .strengths > h2 {
    font-size: clamp(2.85rem, 12.5vw, 4.15rem);
    line-height: 0.94;
  }

  .contact h2 {
    font-size: clamp(3rem, 13vw, 4.4rem);
    line-height: 0.88;
  }

  .strength-card {
    padding-left: 24px;
    padding-right: 24px;
  }

  .project-title-row {
    flex-direction: column;
    gap: 7px;
  }

  .project-title-row > span {
    max-width: none;
    text-align: left;
  }
}

/* Photography: type-led desktop composition, then a portrait after the CTA. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 96px);
  min-height: 0;
  padding: 170px max(36px, calc((100vw - var(--max)) / 2)) 88px;
}

.hero-copy {
  width: 100%;
  margin: 0;
  text-align: left;
}

.hero h1 {
  font-size: clamp(4rem, 6.6vw, 7.6rem);
  line-height: 0.86;
}

.hero-intro {
  margin-left: 0;
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  line-height: 1.2;
}

.hero-portrait {
  width: min(100%, 480px);
  margin: 0;
  justify-self: end;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--soft-line);
}

.hero-portrait img,
.editorial-photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Preserve the landscape and its headroom; no face-dependent CSS crop. */
.editorial-photo {
  width: min(calc(100% - 56px), 1040px);
  margin: 0 auto 64px;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 156px 28px 64px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 8.6vw, 6.5rem);
  }

  .hero-intro {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-portrait {
    width: min(100%, 360px);
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .hero {
    gap: 36px;
    padding: 160px 14px 48px;
  }

  .hero h1 {
    font-size: clamp(3.05rem, 13.9vw, 5rem);
  }

  .hero-intro {
    font-size: 1.22rem;
  }

  .hero-portrait {
    width: min(calc(100% - 20px), 360px);
    padding: 8px;
  }

  .editorial-photo {
    width: calc(100% - 28px);
    margin-bottom: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
