.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-header {
  padding-top: 2.25rem;
}

.name {
  position: absolute;
  top: 2.25rem;
  left: 2.25rem;
  z-index: 10;
  margin: 0;
  font-family: "Special Elite", cursive;
  font-size: var(--type-home-name);
  font-weight: 400;
  color: var(--text);
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2rem, 3vw, 3.25rem);
  width: min(100%, 75rem);
  margin: 0 auto;
  padding: 4.75rem clamp(1.75rem, 3vw, 2.5rem) 8.5rem;
}

.col-postcard {
  flex: 1 1 0;
  min-width: 0;
  max-width: 42rem;
  padding-top: 2.75rem;
}

.col-info {
  flex: 0 0 25.5rem;
  min-width: 22rem;
  margin-left: -0.85rem;
  padding-top: 0.75rem;
}

.scene {
  position: relative;
  perspective: 1400px;
}

.scene::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 8%;
  bottom: -1.15rem;
  height: 2.2rem;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(44, 33, 20, 0.18) 0%,
    rgba(44, 33, 20, 0.1) 42%,
    rgba(44, 33, 20, 0) 78%
  );
  filter: blur(11px);
  pointer-events: none;
  z-index: 0;
}

.postcard {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  position: relative;
  display: block;
  width: min(720px, 100%);
  aspect-ratio: 3 / 2;
  cursor: pointer;
  text-align: left;
  z-index: 1;
  transform-style: preserve-3d;
  transform: rotate(-1.2deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.postcard.is-flipped {
  transform: rotate(0deg) rotateY(180deg);
}

.postcard-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  box-shadow:
    0 14px 34px rgba(30, 20, 10, 0.11),
    0 30px 70px rgba(30, 20, 10, 0.08),
    inset 0 0 0 1px rgba(62, 49, 34, 0.05);
}

.paper-stains {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(120, 100, 70, 0.12) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(110, 90, 60, 0.1) 0%, transparent 35%),
    radial-gradient(ellipse at 100% 0%, rgba(115, 95, 65, 0.08) 0%, transparent 30%),
    radial-gradient(ellipse at 0% 100%, rgba(120, 100, 70, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 72% 28%, rgba(140, 115, 75, 0.08) 0%, transparent 8%),
    radial-gradient(circle at 25% 65%, rgba(130, 108, 70, 0.06) 0%, transparent 6%),
    radial-gradient(circle at 85% 75%, rgba(135, 112, 72, 0.07) 0%, transparent 7%);
}

.postcard-front,
.postcard-back {
  background: #fbf6ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.postcard-border {
  position: absolute;
  inset: 0.95rem;
  overflow: hidden;
  background: #f7f0e4;
  box-shadow: inset 0 0 0 1px rgba(62, 49, 34, 0.06);
}

.postcard-border img {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  margin: -1px;
  object-fit: cover;
}

.about-card {
  display: none;
  width: 100%;
  grid-template-columns: minmax(13.75rem, 15.25rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.35rem;
}

.about-portrait {
  width: 100%;
  padding: 0;
  justify-self: start;
}

.about-copy {
  min-width: 0;
  padding-top: 0.7rem;
}

.about-label {
  margin: 0 0 0.6rem;
  font-family: "Special Elite", cursive;
  font-size: var(--type-home-label);
  font-weight: 400;
  color: var(--text-muted);
}

.about-text {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: var(--type-home-body);
  line-height: 1.62;
  color: #3b342b;
}

.postcard-back {
  transform: rotateY(180deg);
}

.back-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 100%;
  padding: clamp(2rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
}

.back-divider {
  width: 1px;
  margin: 0 clamp(1rem, 2.5vw, 2rem);
  background: rgba(30, 26, 20, 0.12);
}

.back-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lined-area {
  display: flex;
  flex: 1;
  align-items: flex-start;
}

.lined-text {
  margin: 0;
  display: block;
  width: 100%;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: var(--type-home-postcard-body);
  line-height: 1.58;
  color: #3b342b;
  padding-bottom: 0.08em;
  background-image: linear-gradient(
    to bottom,
    transparent calc(100% - 1px),
    rgba(121, 99, 69, 0.13) calc(100% - 1px)
  );
  background-repeat: repeat-y;
  background-size: 100% 1.58em;
  background-position: 0 0.02em;
}

.back-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.back-photo {
  width: calc(100% + 2px);
  height: auto;
  aspect-ratio: 478 / 720;
  object-fit: cover;
  display: block;
  margin: -1px;
  transform: rotate(0.7deg);
}

.photo-matte {
  width: 100%;
  overflow: hidden;
  padding: 0.72rem;
  background: rgba(252, 248, 240, 0.96);
  border: 1px solid rgba(62, 49, 34, 0.09);
  box-shadow:
    0 12px 26px rgba(41, 31, 18, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.back-right::before,
.back-right::after {
  content: "";
  position: absolute;
  width: clamp(28px, 5vw, 42px);
  height: clamp(12px, 2vw, 16px);
  background: rgba(220, 215, 195, 0.48);
  z-index: 6;
  pointer-events: none;
}

.back-right::before {
  top: clamp(0.75rem, 2vw, 1.5rem);
  left: clamp(0.75rem, 2vw, 1.5rem);
  transform: translate(-30%, -30%) rotate(-45deg);
}

.back-right::after {
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  transform: translate(30%, 30%) rotate(-45deg);
}

.about-portrait::before {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.about-portrait::after {
  bottom: 0;
  right: 0;
  transform: translate(50%, 50%) rotate(-45deg);
}

.project-label {
  margin: 1.75rem 0 1.3rem;
  padding: 0 1rem;
  font-family: "Special Elite", cursive;
  font-size: var(--type-home-label);
  font-weight: 400;
  color: var(--text-muted);
}

.project-label::after {
  content: " ..................";
  letter-spacing: 0.15em;
  font-size: 0.6rem;
}

.projects-nav {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.project {
  display: block;
  margin: -0.42rem 0;
  padding: 0.42rem 1rem 0.5rem;
  text-decoration: none;
}

.col-info > .project:first-of-type {
  margin-bottom: clamp(1.7rem, 3vw, 1.95rem);
}

.project-name {
  display: block;
  font-family: "Special Elite", cursive;
  font-size: var(--type-home-project-title);
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  white-space: normal;
  transition: color 90ms ease-out;
}

.project-name::after {
  content: " >";
  display: inline-block;
  color: var(--text-muted);
  transition:
    color 90ms ease-out,
    transform 90ms ease-out;
}

.project-desc {
  display: block;
  margin-top: 0.15rem;
  font-family: "Source Sans 3", sans-serif;
  font-size: var(--type-home-project-desc);
  line-height: 1.5;
  color: var(--text-muted);
  transition: color 90ms ease-out;
}

.project:hover .project-name,
.project:focus-visible .project-name {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.project:hover .project-name::after,
.project:focus-visible .project-name::after {
  color: var(--accent);
  transform: translateX(2px);
}

.project:hover .project-desc,
.project:focus-visible .project-desc {
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) and (min-width: 981px) {
  .postcard:hover {
    transform: translateY(-4px) rotate(-0.55deg);
  }

  .postcard.is-flipped:hover {
    transform: translateY(-4px) rotateY(180deg);
  }
}

@media (max-width: 980px) {
  .home-header {
    padding: 1.75rem 1.25rem 0;
  }

  .name {
    position: static;
  }

  .main {
    flex-direction: column;
    gap: 2.35rem;
    padding: 1.75rem 1.25rem 2.25rem;
  }

  .col-postcard,
  .col-info {
    width: 100%;
    min-width: 0;
    max-width: 36rem;
    margin-left: 0;
    margin-right: auto;
    margin-left: auto;
    padding-top: 0;
    flex: none;
  }

  .scene {
    display: none;
  }

  .about-card {
    display: grid;
  }

  .project,
  .project-label {
    padding-right: 0;
    padding-left: 0;
  }

  .project-name {
    white-space: normal;
  }

  .site-footer {
    position: static;
    margin-top: auto;
    padding: 1.75rem 1.25rem 1.75rem;
  }
}

@media (max-width: 680px) {
  .about-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about-portrait {
    width: min(100%, 14rem);
    margin: 0 auto;
  }

  .about-copy {
    padding-top: 0;
  }

  .about-label {
    margin-bottom: 0.45rem;
  }

  .about-text {
    line-height: 1.58;
  }

  .project,
  .project-label {
    padding-right: 0;
    padding-left: 0;
  }

  .project-name {
    white-space: normal;
  }

  .contact {
    gap: 1.5rem;
  }
}
