:root {
  --paper: #fff2e2;
  --ink: #291a16;
  --orange: #ff603e;
  --line: #291a164a;
  --screen: 100vh;
  --turn-travel: clamp(860px, 152vh, 1360px);
  --gutter: clamp(22px, 6.2vw, 112px);
  --header-pad: clamp(24px, 5vh, 54px);
  --bar-height: 66px;
  --portrait-size: clamp(110px, min(31vw, 49vh), 330px);
  --portrait-cap: clamp(28px, 14vh, 122px);
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

@supports (height: 100svh) {
  :root {
    --screen: 100svh;
    --turn-travel: clamp(860px, 152svh, 1360px);
    --header-pad: clamp(24px, 5svh, 54px);
    --portrait-size: clamp(110px, min(31vw, 49svh), 330px);
    --portrait-cap: clamp(28px, 14svh, 122px);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: clip;
}

.face {
  display: grid;
  min-height: var(--screen);
  overflow: hidden;
}

.profile {
  grid-template-columns: minmax(0, 1fr) var(--portrait-size);
  background: var(--paper);
}

.contact {
  background: var(--orange);
}

.face-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 4vh, 42px);
  min-width: 0;
  padding: var(--header-pad) var(--gutter);
}

.profile .face-copy {
  padding-right: clamp(12px, 2vw, 36px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 13px ui-monospace, monospace;
  letter-spacing: -.02em;
}

.brand-mark {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.contact .brand-mark {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}

.identity,
.contact-content {
  margin-block: auto;
}

h1,
h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.044em;
}

h1 {
  font-size: clamp(3.5rem, min(12.8vw, 22vh), 11rem);
  line-height: .87;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(3.5rem, min(13.2vw, 23vh), 11rem);
  line-height: .95;
}

.profession {
  margin: clamp(12px, 2.5vh, 22px) 0 0;
  font-size: clamp(1.2rem, 2.45vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -.026em;
}

.portrait {
  position: relative;
  align-self: end;
  display: grid;
  align-items: end;
  height: calc(var(--portrait-size) + var(--portrait-cap));
  margin: 0;
  overflow: hidden;
  border-top-left-radius: 100% 57%;
  background: var(--orange);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .opening .portrait {
    animation: arch-rises 860ms cubic-bezier(.21, .84, .25, 1) backwards;
    transform-origin: bottom right;
  }

  .opening .portrait::after {
    position: absolute;
    inset: 0;
    background: var(--orange);
    content: "";
    transform: scaleY(0);
    transform-origin: top;
    animation: portrait-unfolds 740ms cubic-bezier(.65, .05, .28, 1) 230ms backwards;
    pointer-events: none;
  }

  .opening .identity h1 span {
    animation: name-rises 560ms cubic-bezier(.21, .84, .25, 1) 120ms backwards;
  }

  .opening .identity h1 span + span {
    animation-delay: 205ms;
  }

  .opening .profession {
    animation: name-rises 480ms ease-out 360ms backwards;
  }
}

@keyframes arch-rises {
  from { transform: translate3d(8%, 76%, 0) scale(.82); }
  to { transform: none; }
}

@keyframes portrait-unfolds {
  from { transform: scaleY(1); }
  to { transform: scaleY(0); }
}

@keyframes name-rises {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to { opacity: 1; transform: none; }
}

.contact-content {
  display: grid;
  gap: clamp(24px, 5vh, 52px);
  width: 100%;
}

.contact-links {
  display: grid;
  width: min(100%, 35rem);
  border-top: 1px solid var(--line);
}

.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: clamp(52px, 8vh, 70px);
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  font-size: clamp(1.14rem, 2.3vw, 1.75rem);
  font-weight: 650;
  text-decoration: none;
}

.link-arrow {
  flex: none;
  width: clamp(21px, 2.3vw, 26px);
  height: auto;
}

.contact-links a:hover .link-label {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.turn-wash,
.turn-bar[hidden] {
  display: none;
}

.turn-bar {
  position: relative;
  z-index: 1;
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--bar-height);
  padding-inline: var(--gutter);
  border-top: 1px solid var(--line);
}

.turn-progress {
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
  pointer-events: none;
}

.side-number {
  font: 600 12px ui-monospace, monospace;
  letter-spacing: .08em;
}

.turn-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 0 0 10px;
  border: 0;
  color: inherit;
  background: transparent;
  font: 650 15px "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
}

.turn-arrow {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.business-card[data-side="back"] .turn-arrow svg {
  transform: rotate(180deg);
}

.turn-button:hover .turn-label {
  text-decoration: underline;
  text-underline-offset: 4px;
}

:where(a, button):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.flip-enabled .story {
  min-height: calc(var(--screen) + var(--turn-travel));
}

.flip-enabled .stage {
  position: sticky;
  top: 0;
  min-height: var(--screen);
  overflow: clip;
}

.flip-enabled .story[data-side="back"] {
  background: var(--orange);
}

.flip-enabled .business-card {
  position: relative;
  display: grid;
  isolation: isolate;
  grid-template-areas: "faces" "footer";
  background: var(--paper);
}

.flip-enabled .turn-wash {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: block;
  background: var(--orange);
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

.flip-enabled .card-faces {
  grid-area: faces;
  display: grid;
}

.flip-enabled .face {
  grid-area: 1 / 1;
  min-height: calc(var(--screen) - var(--bar-height));
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

.flip-enabled .face[inert] {
  visibility: hidden;
}

@media (max-width: 660px) and (orientation: portrait) {
  :root {
    --gutter: clamp(22px, 7vw, 45px);
    --bar-height: 60px;
    --portrait-size: clamp(104px, min(45vw, 27vh), 215px);
    --portrait-cap: clamp(38px, 12vh, 100px);
  }

  @supports (height: 100svh) {
    :root {
      --portrait-size: clamp(104px, min(45vw, 27svh), 215px);
      --portrait-cap: clamp(38px, 12svh, 100px);
    }
  }

  .profile {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .profile .face-copy {
    gap: clamp(20px, 4.4vh, 38px);
    padding: var(--header-pad) var(--gutter) 0;
  }

  .profile .identity {
    margin-block: auto 0;
  }

  .portrait {
    justify-self: end;
    width: var(--portrait-size);
    margin-top: clamp(12px, 3vh, 25px);
  }

  h1 {
    font-size: clamp(3rem, min(17.5vw, 13vh), 6rem);
  }

  h2 {
    font-size: clamp(3.7rem, min(19.5vw, 14vh), 6.6rem);
    line-height: 1.04;
  }

  h2 span {
    display: block;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  :root {
    --header-pad: 16px;
    --bar-height: 52px;
    --portrait-cap: clamp(21px, 8vh, 38px);
  }

  .face-copy {
    gap: 14px;
  }

  .contact-content {
    gap: 16px;
  }

  .contact-links a {
    min-height: 43px;
  }
}
