:root {
  color-scheme: dark;
  --ivory: #f5f0e8;
  --ink: #181817;
  --accent: #dfb083;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  display: grid;
  place-items: center;
  background: #0d0e0d;
  color: var(--ivory);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.phone-poster {
  width: min(100%, 430px);
  height: 100svh;
  min-height: 640px;
  max-height: 932px;
  display: grid;
  grid-template-rows: 118px minmax(0, 1fr);
  overflow: hidden;
  background: #1d1e1d;
}

.identity {
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 24px 13px;
  background: #f5f0e8;
  border-bottom: 1px solid rgba(0,0,0,.14);
}

.identity img {
  display: block;
  width: min(61vw, 244px);
  height: auto;
  max-height: 86px;
  filter: none;
}

.visual-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.portrait {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(10,10,10,.02) 0%, rgba(10,10,10,.02) 34%, rgba(10,10,10,.36) 55%, rgba(10,10,10,.93) 79%, rgba(10,10,10,.98) 100%),
    linear-gradient(90deg, rgba(10,10,10,.14), transparent 62%);
}

.message {
  position: absolute;
  right: 24px;
  bottom: calc(clamp(285px, 35svh, 325px) - 22px);
  left: 24px;
}

.message h1 {
  margin: 0;
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 8.2vw, 37px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.04em;
  text-shadow: 0 2px 17px rgba(0,0,0,.5);
}

.message h1 em {
  color: var(--accent);
  font-weight: 400;
}

.message .english-note {
  position: relative;
  max-width: 310px;
  margin: 28px 0 0;
  padding-top: 14px;
  color: rgba(204,193,183,.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
  line-height: 1.42;
}

.message .english-note::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 29px;
  height: 1px;
  background: rgba(223,176,131,.68);
  content: "";
}

.message .return-note {
  margin: 12px 0 0;
  color: rgba(245,240,232,.78);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.visitor-actions {
  position: absolute;
  right: 24px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.primary-link {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 21px;
  border: 1px solid rgba(223,176,131,.46);
  background: rgba(48,47,44,.88);
  color: var(--ivory);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-decoration: none;
  text-transform: uppercase;
}

.primary-link + .primary-link {
  margin-top: 9px;
}

.primary-link svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.secondary-link {
  border-color: rgba(245,240,232,.42);
  background: rgba(16,16,16,.12);
  color: var(--ivory);
  backdrop-filter: blur(2px);
}

.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.socials a {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(245,240,232,.42);
  border-radius: 50%;
  color: var(--ivory);
  text-decoration: none;
}

.socials img {
  display: block;
  width: 14px;
  height: 14px;
}

@media (max-height: 720px) {
  .phone-poster { grid-template-rows: 96px minmax(0, 1fr); }
  .identity { padding-top: max(11px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .identity img { width: 205px; max-height: 72px; }
  .message { bottom: 230px; }
  .message h1 { font-size: 28px; }
  .message .english-note { margin-top: 18px; padding-top: 10px; font-size: 10px; }
  .message .return-note { margin-top: 6px; }
  .primary-link { min-height: 45px; }
  .primary-link + .primary-link { margin-top: 7px; }
  .socials { margin-top: 10px; }
}

@media (min-width: 431px) {
  .phone-poster { box-shadow: 0 24px 80px rgba(0,0,0,.55); }
}

@media (min-width: 700px) and (max-width: 899px) {
  .phone-poster {
    width: 100%;
    max-width: none;
    max-height: none;
    grid-template-rows: 126px minmax(0, 1fr);
    box-shadow: none;
  }

  .identity img { width: 280px; max-height: 94px; }
  .portrait { object-position: 50% 22%; }

  .message {
    left: 46px;
    right: 46px;
    bottom: 188px;
  }

  .message h1 { font-size: clamp(42px, 6vw, 54px); }

  .visitor-actions {
    right: 46px;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 46px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
  }

  .primary-link + .primary-link { margin-top: 0; }
  .socials { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  body { display: block; background: #0d0e0d; }

  .phone-poster {
    position: relative;
    width: 100%;
    max-width: none;
    height: 100svh;
    min-height: 650px;
    max-height: none;
    grid-template-columns: 56% 44%;
    grid-template-rows: 1fr;
    background: #111210;
    box-shadow: none;
  }

  .phone-poster::before { display: none; }

  .identity {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    height: clamp(145px, 19vh, 178px);
    justify-items: center;
    padding: clamp(24px, 3.5vh, 36px) clamp(40px, 5vw, 84px);
    border-bottom: 1px solid rgba(0,0,0,.14);
    background: var(--ivory);
    z-index: 3;
  }

  .identity img {
    width: min(25vw, 330px);
    max-height: 118px;
    filter: none;
  }

  .visual-stage {
    position: static;
    grid-column: 1;
    grid-row: 1;
    overflow: visible;
    isolation: auto;
  }

  .portrait {
    inset: 0 auto 0 0;
    z-index: 0;
    width: 56%;
    height: 100%;
    object-position: 50% 22%;
  }

  .shade {
    inset: 0 auto 0 0;
    z-index: 1;
    width: 56%;
    background: linear-gradient(180deg, transparent 62%, rgba(8,8,8,.28) 100%);
  }

  .message {
    top: clamp(220px, 28vh, 270px);
    right: clamp(40px, 5vw, 84px);
    bottom: auto;
    left: calc(56% + clamp(40px, 5vw, 84px));
    z-index: 3;
  }

  .message h1 {
    color: var(--ivory);
    font-size: clamp(39px, 3.5vw, 58px);
    line-height: .98;
    text-shadow: 0 2px 17px rgba(0,0,0,.35);
  }

  .message .english-note { color: rgba(204,193,183,.82); font-size: 13px; }
  .message .return-note { color: rgba(245,240,232,.72); font-size: 10px; }

  .visitor-actions {
    right: clamp(40px, 5vw, 84px);
    bottom: clamp(34px, 5.5vh, 56px);
    left: calc(56% + clamp(40px, 5vw, 84px));
    z-index: 3;
  }

  .primary-link {
    min-height: 58px;
    border-color: rgba(223,176,131,.46);
    background: rgba(48,47,44,.88);
    color: var(--ivory);
  }

  .secondary-link {
    border-color: rgba(245,240,232,.42);
    background: rgba(16,16,16,.12);
    color: var(--ivory);
  }

  .primary-link + .primary-link { margin-top: 11px; }
  .socials { justify-content: flex-start; margin-top: 18px; }
  .socials a { border-color: rgba(245,240,232,.42); }
  .socials img { filter: none; }
}
