:root {
  --background: #DEDEDE;
  --primary: #1B1B1B;
  --secondary: #828282;
  --surface: #EAEAEA;
  --line: rgba(27, 27, 27, 0.12);
  --mobile-skills-offset: 20px;
  --mobile-visual-bg-top: 35%;
  --mobile-visual-bg-width: 92%;
  --mobile-visual-bg-height: 60%;
  --mobile-portrait-width: 100%;
  --section-gap: clamp(54px, 8vw, 112px);
  --projects-gap: clamp(22px, 4vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--primary);
  background: var(--background);
  overflow-x: hidden;
}

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

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

.page-shell {
  width: 100%;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 56px);
}

.hero {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  min-height: min(700px, calc(100svh - 36px));
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  /* allow hero-portrait to extend slightly without clipping */
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(27, 27, 27, 0.14);
}

.site-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(24px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

a.mark,
.mark {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  color: #1B1B1B;
}


.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: var(--primary);
}

.menu-button {
  width: 38px;
  height: 30px;
  display: none;
  place-content: center;
  gap: 5px;
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  width: 22px;
  height: 2px;
  background: currentColor;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(36px, 7vw, 84px) clamp(24px, 5vw, 64px);
  padding-right: clamp(300px, 44vw, 540px);
}

.hero-copy {
  position: relative;
  z-index: 3;
  max-width: 620px;
}

.kicker {
  margin: 24px 0 0;
  color: var(--secondary);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 900;
  text-transform: uppercase;
}

/* Software skills */
.software-skills {
  margin: 24px 0 40px;
}

.skills-label {
  margin: 0;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.skills-icons {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

/* Ensure all icons visually align with typography baseline */
@media (min-width: 461px) {
  .skills-icons {
    align-items: center;
  }
}


.skills-icon {
  height: clamp(24px, 2.2vw, 32px);
  width: auto;
  opacity: 1;
  filter: grayscale(1);
  transition: opacity 200ms ease, transform 200ms ease, filter 200ms ease;
  transform-origin: center;
  cursor: pointer;
}

.skills-icon:hover {
  opacity: 1;
  filter: grayscale(1);
  transform: scale(1.05);
}

.skills-icon[src$="blender.png"],
.skills-icon[src$="blender.png"]:hover {
  filter: brightness(0) saturate(100%) invert(8%) sepia(0%) saturate(14%) hue-rotate(195deg) brightness(96%) contrast(92%);
}

/* Fade-in sequentially on load */
@media (prefers-reduced-motion: no-preference) {
  .skills-icon {
    opacity: 0;
    animation: skillsFadeIn 0.4s ease forwards;
    animation-delay: calc(var(--i, 0) * 0.1s);
  }

  @keyframes skillsFadeIn {
    to {
      opacity: 1;
    }
  }
}

@media (max-width: 820px) {
  .skills-icons {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .software-skills {
    margin: 18px 0 32px;
  }

  .skills-icons {
    justify-content: center;
    gap: 28px;
  }
}


h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.title {
  max-width: 580px;
  margin: clamp(26px, 4vw, 38px) 0 0;
  color: var(--primary);
  font-size: clamp(24px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1.05;
}

.description {
  max-width: 500px;
  margin: 24px 0 0;
  color: var(--secondary);
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 600;
  line-height: 1.55;
}

.cta-button {
  width: fit-content;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 34px;
  padding: 0 26px;
  border: 1px solid var(--primary);
  color: #DEDEDE;
  background: var(--primary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.cta-button:hover {
  color: var(--primary);
  background: transparent;
}


.hero-visual {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(540px, 46%);
  height: calc(100% - 84px);
  margin: 0;
  overflow: visible;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}


.hero-visual::after {
  content: "";
  position: absolute;
  top: 29%;
  right: 0;
  width: 100%;
  height: 36%;
  background: var(--secondary);
  pointer-events: none;
  z-index: 0;
}

.hero-portrait {
  position: absolute;
  left: 50%;
  /* reduce risk of clipping on some viewport heights */
  bottom: -1px;
  z-index: 1;
  width: min(400px, 90%);
  height: auto;
  display: block;
  filter: grayscale(1) contrast(1.04);
  pointer-events: none;
  transform: translateX(-50%);
  user-select: none;
}

.projects {
  width: min(1180px, 100%);
  margin: var(--section-gap) auto 0;
  display: grid;
  gap: clamp(22px, 4vw, 48px);
}

.project-panel {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(27, 27, 27, 0.12);
}

.project-media {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-height: auto;
  aspect-ratio: var(--aspect-ratio, 16 / 9);
  background: #1B1B1B;
  overflow: hidden;
}

.project-media.ratio-16-9 { --aspect-ratio: 16 / 9; }
.project-media.ratio-9-16 { --aspect-ratio: 9 / 16; }
.project-media.ratio-4-5 { --aspect-ratio: 4 / 5; }
.project-media.ratio-1-1 { --aspect-ratio: 1 / 1; }

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.project-video,
.project-media iframe,
.project-media video,
.project-media img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  background:
    linear-gradient(135deg, rgba(222, 222, 222, 0.08), transparent 42%),
    var(--primary);
  border: 0;
}

.project-yt {
  width: 100%;
  height: 100%;
  display: block;
}

/* YouTube embeds should behave like the existing video container */
.project-yt {
  width: 100%;
  height: 100%;
  display: block;
}


.project-copy {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: clamp(26px, 5vw, 58px);
}

.project-count {
  margin: 0 0 clamp(22px, 4vw, 42px);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-copy h2 {
  max-width: min(100%, 40ch);
  margin: 0;
  color: var(--primary);
  font-size: clamp(26px, 2.5vw, 50px);
  font-weight: 900;
  line-height: 1.24;
  letter-spacing: 0;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
  hyphens: none;
}

.project-description {
  max-width: 100%;
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  color: var(--secondary);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 700;
  line-height: 1.55;
}

.project-meta {
  display: grid;
  gap: 22px;
  margin: clamp(30px, 4vw, 52px) 0 0;
}

.project-meta div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}


.contact {
  width: min(1180px, 100%);
  margin: var(--projects-gap) auto var(--section-gap);
}

.contact-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(27, 27, 27, 0.12);
  overflow: hidden;
}

.contact-copy {
  padding: clamp(26px, 5vw, 58px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 0;
  text-align: left;
}

@media (min-width: 821px) {
  .contact-copy {
    grid-template-columns: 1fr minmax(280px, 0.9fr);
    grid-template-rows: auto auto 1fr;
    align-items: start;
    column-gap: clamp(34px, 4vw, 64px);
  }

  .contact-label {
    grid-column: 1;
    grid-row: 1;
  }

  .contact-copy h2 {
    grid-column: 1;
    grid-row: 2;
  }

  .contact-description {
    grid-column: 1;
    grid-row: 3;
  }
}

/* Keep left side text exactly as-is; place methods on the right */
.contact-methods {
  margin-top: 0;
}

@media (min-width: 821px) {
  .contact-methods {
    grid-column: 2;
    grid-row: 2 / 4;
    justify-self: end;
    align-self: start;
    width: min(360px, 100%);
  }
}




.contact-label {
  margin: 0;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: left;
  line-height: 1.2;
}



.contact-copy h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.05;
}

.contact-description {
  margin: 0;
  color: var(--secondary);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 700;
  line-height: 1.55;
}

/* Contact cards */
.contact-methods {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.contact-card {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(27, 27, 27, 0.045);
  border: 1px solid rgba(27, 27, 27, 0.12);
  box-shadow: 0 18px 50px rgba(27, 27, 27, 0.06);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.contact-card:focus-visible {
  outline: 2px solid rgba(27, 27, 27, 0.35);
  outline-offset: 2px;
}

.contact-card:hover {
  background: rgba(27, 27, 27, 0.075);
  border-color: rgba(27, 27, 27, 0.18);
  transform: translateY(-2px);
}

.contact-card-icon {
  height: 22px;
  width: auto;
  display: block;
}

.contact-card-text {
  color: var(--secondary);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .contact-methods {
    justify-items: stretch;
  }

  .contact-card {
    width: 100%;
  }
}


@media (max-width: 660px) {
  .contact-copy {
    padding: 24px;
  }
}

.project-meta dt {
  margin: 0 0 9px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-meta dd {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.reveal {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 600ms ease, transform 600ms ease;
  }

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

@media (max-width: 980px) and (min-width: 821px) {
  .hero-content {
    padding-right: clamp(230px, 39vw, 360px);
  }

  .hero-visual {
    width: min(430px, 42%);
  }

  .hero-portrait {
    width: min(340px, 88%);
  }

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

  .project-copy h2 {
    font-size: clamp(24px, 3.4vw, 44px);
  }
}


@media (max-width: 820px) {
  .page-shell {
    display: block;
    padding: 14px;
  }

  /* Keep mobile menu above hero visuals */
  .menu-button {
    position: relative;
    z-index: 30;
  }

  /* Mobile menu toggle */
  .nav-links {
    position: absolute;
    top: 72px;
    left: 14px;
    right: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    box-shadow: 0 24px 72px rgba(27, 27, 27, 0.18);
    display: grid;
    gap: 14px;
    z-index: 20;

    /* hidden by default on mobile */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links a {
    color: var(--primary);
    font-size: 12px;
  }

  .hero {
    min-height: calc(100svh - 28px);
  }

  .project-panel {
    grid-template-columns: 1fr;
  }

  .project-media {
    min-height: 280px;
  }

  .project-copy h2 {
    font-size: clamp(28px, 5vw, 48px);
  }

  .site-header {
    min-height: 72px;
  }

  .menu-button {
    display: grid;
  }

  .hero-content {
    min-height: calc(100svh - 100px);
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(clamp(230px, 42svh, 390px), 1fr);
    align-items: start;
    gap: 12px;
    padding-block: 34px 0;
    padding-right: clamp(18px, 5vw, 34px);
  }

  .hero-copy {
    max-width: none;
  }

  .software-skills {
    margin-bottom: 14px;
  }

  h1 {
    font-size: clamp(52px, 16vw, 86px);
  }

  .title {
    font-size: clamp(25px, 8vw, 42px);
  }

  .hero-visual {
    position: relative;
    right: auto;
    bottom: auto;
    align-self: stretch;
    justify-self: center;
    width: min(520px, 100%);
    height: 100%;
    min-height: 0;
  }

  .hero-visual::after {
    top: 36%;
    right: 50%;
    width: 100%;
    height: 34%;
    transform: translateX(50%);
  }

  .hero-portrait {
    left: 50%;
    bottom: -6px;
    width: min(330px, 70%);
    transform: translateX(-50%);
  }

  .projects {
    gap: 28px;
    margin-top: 28px;
  }

  .project-panel {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .project-media::after {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .project-copy {
    min-height: auto;
  }
}

@media (max-width: 460px) {
  .software-skills {
    margin: 18px 0 10px;
    transform: translateY(var(--mobile-skills-offset));
  }

  .skills-label {
    text-align: center;
  }

  .site-header {
    padding-inline: 18px;
  }

  .hero-content {
    padding-inline: 18px;
    padding-block: 24px 0;
    grid-template-rows: auto minmax(clamp(250px, 44svh, 360px), 1fr);
    gap: 16px;
  }

  .hero-visual {
    width: 100%;
    max-width: 360px;
  }

  .hero-visual::after {
    top: var(--mobile-visual-bg-top);
    width: var(--mobile-visual-bg-width);
    height: var(--mobile-visual-bg-height);
  }

  .hero-portrait {
    bottom: 0;
    width: min(275px, var(--mobile-portrait-width));
    max-height: 88%;
    object-fit: contain;
  }

  .kicker {
    margin-top: 18px;
  }

  .description {
    font-size: 15px;
  }

  .cta-button {
    width: 100%;
  }

  .project-copy {
    padding: 26px 18px 30px;
  }

  .project-copy h2 {
    font-size: clamp(20px, 9vw, 36px);
  }
}

@media (max-width: 360px) {
  .page-shell {
    padding: 10px;
  }

  .site-header {
    min-height: 64px;
    padding-inline: 14px;
  }

  a.mark,
  .mark {
    font-size: 15px;
  }

  .hero-content {
    padding-inline: 14px;
    grid-template-rows: auto minmax(clamp(220px, 40svh, 320px), 1fr);
  }

  h1 {
    font-size: clamp(44px, 16vw, 58px);
  }

  .skills-icons {
    gap: 20px;
  }

  .skills-icon {
    height: 23px;
  }
}

@media (max-width: 820px) and (max-height: 700px) {
  .hero {
    min-height: auto;
  }

  .hero-content {
    min-height: 0;
    grid-template-rows: auto minmax(220px, 44svh);
  }

  .software-skills {
    margin-bottom: 8px;
  }
}

/* About */
.about {
  width: min(1180px, 100%);
  margin: var(--projects-gap) auto 0;
  padding-bottom: clamp(10px, 4vw, 26px);
}

.about-panel {
  min-height: min(520px, calc(100svh - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 72px rgba(27, 27, 27, 0.12);
}

.about-copy {
  padding: clamp(26px, 5vw, 58px);
}

.about-label {
  margin: 0;
  color: var(--secondary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.about-copy h2 {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  color: var(--primary);
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 900;
  line-height: 0.96;
}

.about-description {
  max-width: 680px;
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  color: var(--secondary);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: 700;
  line-height: 1.55;
}

.about-meta {
  display: grid;
  gap: 22px;
  margin: clamp(26px, 3.6vw, 48px) 0 0;
}

.about-meta div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.about-meta dt {
  margin: 0 0 9px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.about-meta dd {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .about {
    margin-top: 28px;
    padding-bottom: 18px;
  }

  .about-copy {
    padding: 26px 18px 30px;
  }

  .about-copy h2 {
    font-size: clamp(32px, 12vw, 46px);
  }
}

@media (max-width: 460px) {
  .about {
    margin-top: 22px;
  }

  .about-description {
    font-size: 15px;
  }

  .about-meta {
    gap: 16px;
  }
}

