:root {
  --ink: #f4f0e8;
  --muted: rgba(244, 240, 232, 0.48);
  --line: rgba(255, 255, 255, 0.1);
  --blue: #0a3f77;
  --gold: #c49a16;
  --gold-soft: #e0c160;
  --pointer-x: 65%;
  --pointer-y: 40%;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #05070b;
}

body {
  margin: 0;
  color: var(--ink);
  background: #05070b;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(17, 51, 90, 0.26), transparent 27rem),
    linear-gradient(118deg, #080b11 0%, #05070b 52%, #07080b 100%);
}

.page::before {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24%;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(2, 3, 5, 0.85));
}

.page::after {
  position: absolute;
  z-index: 5;
  inset: 10px;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  opacity: 0.27;
  filter: blur(90px);
  pointer-events: none;
}

.ambient--blue {
  top: 14%;
  left: 35%;
  width: 34vw;
  height: 40vw;
  background: #064784;
  transform: translate3d(calc((var(--pointer-x) - 50%) * -0.03), 0, 0);
}

.ambient--gold {
  right: -12vw;
  bottom: -20vw;
  width: 40vw;
  height: 42vw;
  background: #8a6800;
}

.grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-position: center;
  background-size: 92px 92px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
  mask-image: linear-gradient(90deg, #000, transparent 70%);
}

.site-header {
  position: absolute;
  z-index: 10;
  top: clamp(1.7rem, 5vw, 3.4rem);
  right: clamp(1.65rem, 5.5vw, 6rem);
  left: clamp(1.65rem, 5.5vw, 6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-grid;
  place-items: center;
  width: clamp(5.55rem, 8.7vw, 7.85rem);
  height: clamp(4rem, 6.2vw, 5.65rem);
  opacity: 0;
  transform: translateY(-8px);
  animation: enter 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand:focus-visible {
  outline: 1px solid var(--gold-soft);
  outline-offset: 0.35rem;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.4));
}

.header-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.header-mark span:first-child {
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 9rem clamp(1.65rem, 8vw, 9rem) 6rem;
}

.hero-copy {
  position: relative;
  z-index: 6;
  display: flex;
  width: min(48rem, 52vw);
  min-height: calc(100svh - 15rem);
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.eyebrow {
  display: flex;
  align-items: center;
  margin: 0 0 1.4rem;
  color: var(--gold-soft);
  font-size: clamp(0.58rem, 0.7vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.38em;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(15px);
  animation: enter 0.85s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.eyebrow-line {
  width: clamp(2.4rem, 4vw, 4rem);
  height: 1px;
  margin-right: 1rem;
  background: linear-gradient(90deg, var(--gold), rgba(196, 154, 22, 0.08));
}

h1 {
  margin: 0;
  font-family: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  font-size: clamp(4.75rem, 10.8vw, 11rem);
  font-weight: 400;
  letter-spacing: -0.072em;
  line-height: 0.69;
  text-wrap: balance;
}

h1 > span {
  display: block;
  opacity: 0;
  transform: translateY(32px);
  animation: enter 1s 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

h1 .surname {
  margin-left: clamp(1.6rem, 7vw, 7rem);
  color: transparent;
  font-style: italic;
  -webkit-text-stroke: 1px rgba(244, 240, 232, 0.78);
  text-shadow: 0 0 44px rgba(219, 190, 91, 0.05);
  animation-delay: 0.46s;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: clamp(2.5rem, 5vw, 4.5rem) 0 0.25rem clamp(0.3rem, 1vw, 1rem);
  color: var(--muted);
  font-size: clamp(0.56rem, 0.68vw, 0.68rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: enter 0.9s 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-note i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.socials {
  display: flex;
  gap: clamp(0.45rem, 0.8vw, 0.8rem);
  margin-top: 1.4rem;
  opacity: 0;
  transform: translateY(20px);
  animation: enter 0.9s 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.social-link {
  position: relative;
  display: grid;
  width: clamp(2.8rem, 3.8vw, 3.5rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(224, 193, 96, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 193, 96, 0.055), transparent 58%),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    0 0 0 1px rgba(196, 154, 22, 0.045),
    0 0 18px rgba(196, 154, 22, 0.085),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 30px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition:
    color 0.35s ease,
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-link::after {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  content: attr(data-label);
  color: var(--gold-soft);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: 0.25s ease;
}

.social-link svg {
  width: 38%;
  height: 38%;
  overflow: visible;
  fill: currentColor;
}

.social-link rect,
.social-link circle:not(.solid-dot),
.threads path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.social-link:hover,
.social-link:focus-visible {
  color: #0a0b0e;
  outline: none;
  border-color: var(--gold-soft);
  background: var(--gold-soft);
  box-shadow: 0 0 36px rgba(196, 154, 22, 0.24);
  transform: translateY(-5px);
}

.social-link:hover::after,
.social-link:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.portrait-stage {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.portrait-stage::before {
  position: absolute;
  right: 1%;
  bottom: 8%;
  width: min(46vw, 45rem);
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(14, 51, 89, 0.35), rgba(7, 14, 23, 0.06) 56%, transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(210, 180, 77, 0.08);
}

.portrait-ring {
  position: absolute;
  right: clamp(-9rem, -8vw, -4rem);
  bottom: clamp(-11rem, -9vw, -5rem);
  width: min(56vw, 58rem);
  aspect-ratio: 1;
  border: 1px solid rgba(208, 173, 55, 0.11);
  border-radius: 50%;
  box-shadow:
    0 0 0 4.5rem rgba(255, 255, 255, 0.008),
    0 0 0 4.6rem rgba(255, 255, 255, 0.025);
}

.portrait {
  position: absolute;
  right: clamp(-2.6rem, 0vw, 2rem);
  bottom: 0;
  display: block;
  width: auto;
  height: min(90svh, 57vw, 58rem);
  object-fit: contain;
  object-position: right bottom;
  opacity: 0;
  filter:
    saturate(0.76)
    contrast(1.04)
    drop-shadow(-28px 25px 35px rgba(0, 0, 0, 0.36));
  transform: translate3d(2rem, 1.5rem, 0);
  animation: portrait-enter 1.4s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.portrait-index {
  position: absolute;
  right: 5.5vw;
  bottom: 5.5rem;
  z-index: -1;
  color: rgba(255, 255, 255, 0.035);
  font-family: Georgia, serif;
  font-size: min(24vw, 23rem);
  line-height: 0.7;
}

.page--error {
  display: grid;
  min-height: 100svh;
  place-items: center;
}

.page--error::before {
  height: 34%;
}

.error-hero {
  position: relative;
  z-index: 6;
  display: grid;
  width: min(42rem, calc(100% - 3rem));
  place-items: center;
  padding: 8rem 0 6rem;
  text-align: center;
}

.error-orbit {
  position: absolute;
  z-index: -1;
  width: min(58vw, 38rem);
  aspect-ratio: 1;
  border: 1px solid rgba(208, 173, 55, 0.12);
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    0 0 0 4rem rgba(255, 255, 255, 0.008),
    inset 0 0 70px rgba(10, 63, 119, 0.13),
    0 0 80px rgba(196, 154, 22, 0.045);
  animation: enter 1s 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-eyebrow {
  justify-content: center;
  margin-bottom: clamp(1.15rem, 2.4vw, 1.7rem);
}

.error-code {
  margin: 0;
  color: rgba(244, 240, 232, 0.86);
  font-family: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  font-size: clamp(7rem, 22vw, 17rem);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.72;
  -webkit-text-stroke: 0.35px rgba(224, 193, 96, 0.28);
  text-shadow:
    0 0 26px rgba(224, 193, 96, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translateY(28px);
  animation: enter 1s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-title {
  margin: clamp(1rem, 2vw, 1.4rem) 0 0;
  color: var(--ink);
  font-size: clamp(0.72rem, 0.95vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(18px);
  animation: enter 0.85s 0.48s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-copy {
  max-width: 25rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  line-height: 1.7;
  opacity: 0;
  transform: translateY(18px);
  animation: enter 0.85s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin-top: clamp(1.6rem, 3vw, 2.3rem);
  padding: 0 1.35rem;
  border: 1px solid rgba(224, 193, 96, 0.28);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 193, 96, 0.08), transparent 58%),
    rgba(255, 255, 255, 0.025);
  box-shadow:
    0 0 0 1px rgba(196, 154, 22, 0.045),
    0 0 22px rgba(196, 154, 22, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  color: var(--gold-soft);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(18px);
  transition:
    color 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  animation: enter 0.85s 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.error-button:hover,
.error-button:focus-visible {
  color: #08090d;
  outline: none;
  border-color: var(--gold-soft);
  background: var(--gold-soft);
  box-shadow: 0 0 36px rgba(196, 154, 22, 0.24);
  transform: translateY(-4px);
}

.edge-number {
  position: absolute;
  z-index: 6;
  top: 50%;
  color: rgba(255, 255, 255, 0.17);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.edge-number--left {
  left: 1.55rem;
  transform: translateY(-50%) rotate(180deg);
}

.edge-number--right {
  right: 1.55rem;
  transform: translateY(-50%);
}

footer {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 1.5rem;
  left: 0;
  padding: 0 1rem;
  text-align: center;
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.28);
  font-size: clamp(0.48rem, 0.58vw, 0.58rem);
  font-weight: 600;
  letter-spacing: 0.2em;
}

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

@keyframes portrait-enter {
  to {
    opacity: 0.96;
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 900px) {
  .page {
    min-height: 100svh;
  }

  .grid {
    background-size: 68px 68px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
    mask-image: linear-gradient(to bottom, #000, transparent 75%);
  }

  .site-header {
    top: 1.7rem;
    right: 1.6rem;
    left: 1.6rem;
  }

  .brand {
    width: 5.25rem;
    height: 3.9rem;
  }

  .header-mark span:first-child {
    width: 1.7rem;
  }

  .hero {
    min-height: 100svh;
    padding: 7.5rem 1.75rem 4.25rem;
  }

  .hero-copy {
    display: block;
    width: 100%;
    min-height: 0;
  }

  .eyebrow {
    margin-bottom: 1.15rem;
  }

  h1 {
    font-size: clamp(4.3rem, 20vw, 7.7rem);
    line-height: 0.75;
  }

  h1 .surname {
    margin-left: 8vw;
  }

  .hero-note {
    margin-top: 2.5rem;
  }

  .socials {
    position: relative;
    z-index: 3;
  }

  .portrait-stage::before {
    right: 50%;
    bottom: -4%;
    width: min(130vw, 45rem);
    transform: translateX(50%);
  }

  .portrait-ring {
    right: 50%;
    bottom: -18rem;
    width: min(150vw, 48rem);
    transform: translateX(50%);
  }

  .portrait {
    right: 50%;
    height: min(60svh, 38rem);
    max-width: 100vw;
    opacity: 0;
    transform: translate3d(calc(50% + 1rem), 1.5rem, 0);
    animation-name: portrait-enter-mobile;
  }

  .portrait-index {
    right: 2vw;
    bottom: 4rem;
    font-size: 43vw;
  }

  .edge-number {
    display: none;
  }

  footer {
    bottom: 1.15rem;
  }

  .error-hero {
    width: min(32rem, calc(100% - 2.7rem));
    padding-top: 7.8rem;
  }

  .error-orbit {
    width: min(112vw, 34rem);
  }

  .error-code {
    font-size: clamp(6.8rem, 30vw, 12rem);
  }
}

@media (max-width: 520px) {
  .page::after {
    inset: 6px;
  }

  .header-mark {
    gap: 0.55rem;
    font-size: 0.48rem;
  }

  .hero {
    padding-right: 1.35rem;
    padding-left: 1.35rem;
  }

  .eyebrow {
    letter-spacing: 0.3em;
  }

  h1 {
    font-size: clamp(3.9rem, 20.5vw, 6.2rem);
  }

  .hero-note {
    gap: 0.53rem;
    margin-top: 2rem;
    margin-left: 0;
    font-size: 0.5rem;
    letter-spacing: 0.14em;
  }

  .socials {
    gap: 0.48rem;
    margin-top: 1rem;
  }

  .social-link {
    width: min(12vw, 3rem);
    min-width: 2.6rem;
  }

  .portrait {
    height: min(57svh, 31rem);
    max-width: 94vw;
  }

  .error-title {
    letter-spacing: 0.24em;
  }

  .error-copy {
    max-width: 19rem;
  }

  .page--error .header-mark {
    display: none;
  }
}

@media (max-height: 690px) and (max-width: 900px) {
  .hero {
    padding-top: 6.3rem;
  }

  h1 {
    font-size: clamp(3.5rem, 17vw, 5.4rem);
  }

  .hero-note {
    margin-top: 1.5rem;
  }

  .portrait {
    height: 45svh;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .site-header {
    top: 1.1rem;
  }

  .hero {
    min-height: 100svh;
    padding: 5.85rem clamp(1.5rem, 4.6vw, 4rem) 3rem;
  }

  .hero-copy {
    display: flex;
    width: min(28rem, 48vw);
    min-height: calc(100svh - 8.85rem);
    justify-content: center;
  }

  .eyebrow {
    margin-bottom: 0.85rem;
    font-size: 0.5rem;
    letter-spacing: 0.28em;
  }

  h1 {
    font-size: clamp(3.25rem, 8.8vw, 5.4rem);
    line-height: 0.74;
  }

  h1 .surname {
    margin-left: 5vw;
  }

  .hero-note {
    gap: 0.58rem;
    margin-top: 1.35rem;
    font-size: 0.5rem;
    letter-spacing: 0.14em;
  }

  .socials {
    gap: 0.5rem;
    margin-top: 0.9rem;
  }

  .social-link {
    width: clamp(2.35rem, 5.7vw, 2.9rem);
  }

  .portrait-stage::before {
    right: 1%;
    bottom: -10%;
    width: min(55vw, 30rem);
    transform: none;
  }

  .portrait-ring {
    right: clamp(-8rem, -12vw, -4rem);
    bottom: -13rem;
    width: min(64vw, 35rem);
    transform: none;
  }

  .portrait {
    right: clamp(-1.8rem, -2vw, 0.6rem);
    bottom: 0;
    height: min(98svh, 59vw, 36rem);
    max-width: 59vw;
    transform: translate3d(1.2rem, 1.2rem, 0);
    animation-name: portrait-enter;
  }

  .portrait-index {
    right: 2vw;
    bottom: 2.4rem;
    font-size: min(23vw, 11rem);
  }

  footer {
    bottom: 0.8rem;
  }

  .error-hero {
    width: min(32rem, 58vw);
    padding: 5.7rem 0 3.2rem;
    place-items: start;
    text-align: left;
  }

  .error-eyebrow {
    justify-content: flex-start;
    margin-bottom: 0.8rem;
  }

  .error-orbit {
    right: -34vw;
    width: min(62vw, 25rem);
  }

  .error-code {
    font-size: clamp(5.2rem, 17vw, 8rem);
  }

  .error-title {
    margin-top: 0.85rem;
  }

  .error-copy {
    margin-top: 0.55rem;
  }

  .error-button {
    min-height: 2.65rem;
    margin-top: 1.15rem;
  }
}

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

@keyframes portrait-enter-mobile {
  to {
    opacity: 0.78;
    transform: translate3d(50%, 0, 0);
  }
}
