/* Entry screens follow supplied mockups 1 and 3. Real controls stay above the artwork. */
@layer onboarding {
  html[lang="ko"] .destination-intro h1 {
    font-size: clamp(18px, 4.5vw, 28px);
    word-break: keep-all;
  }
  .flag-art {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #00000008;
  }
  body[data-page="welcome"],
  body[data-page="destinations"] {
    padding: 0;
  }
  .welcome-screen {
    width: 100%;
    max-width: 620px;
    min-height: 100svh;
    margin: 0 auto;
    padding: 24px 22px max(28px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    text-align: center;
    background: #fff url("/assets/welcome-background.webp") center / 100% 100%
      no-repeat;
    color: #12110f;
  }
  .welcome-identity {
    position: relative;
    z-index: 1;
  }
  .welcome-emblem {
    display: block;
    width: min(53vw, 25svh, 265px);
    height: auto;
    margin: 0 auto -2px;
    object-fit: contain;
  }
  .welcome-wordmark {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 8.5vw, 54px);
    letter-spacing: 0.065em;
    line-height: 1.2;
    white-space: nowrap;
  }
  .welcome-tagline {
    font-size: clamp(8px, 2.1vw, 12px);
    letter-spacing: 0.27em;
    margin: 5px 0 8px;
  }
  .welcome-signature {
    display: inline-block;
    color: #92641d;
    font-family: "Snell Roundhand", "Brush Script MT", "Segoe Script", cursive;
    font-size: clamp(25px, 7vw, 42px);
    font-weight: 400;
    font-style: italic;
    transform: rotate(-7deg);
    border-bottom: 1px solid #a6762c;
    line-height: 1.25;
    padding: 0 9px 4px;
    margin: 3px 0 24px;
  }
  .welcome-choices {
    position: relative;
    z-index: 2;
    width: min(100%, 340px);
    margin: 0 auto;
  }
  .welcome-choices h1 {
    font-size: clamp(22px, 5.8vw, 30px);
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.3;
  }
  .welcome-choices > p:not(.entry-error) {
    font-size: 12px;
    letter-spacing: 0.15em;
    margin: 7px 0 17px;
    color: #484541;
  }
  .welcome-languages {
    width: 87%;
    margin: auto;
    display: grid;
    gap: 8px;
  }
  .welcome-languages button {
    width: 100%;
    display: grid;
    grid-template-columns: 33px 1fr 19px;
    align-items: center;
    gap: 17px;
    min-height: 51px;
    border-radius: 40px;
    padding: 8px 18px;
    background: #fffffff2;
    border: 1px solid #b38a51;
    color: #111;
    text-align: left;
    box-shadow: 0 6px 15px #967a3210;
    font-size: 17px;
    font-weight: 500;
    transition:
      background 0.18s,
      transform 0.18s;
  }
  .language-flag {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    font-size: 27px;
    line-height: 1;
    overflow: hidden;
  }
  .welcome-languages .icon {
    width: 19px;
    height: 19px;
    stroke-width: 1.4;
  }
  .welcome-languages button:active {
    transform: scale(0.98);
    background: #fcf4e6;
  }
  .welcome-languages button:disabled {
    opacity: 0.65;
    cursor: wait;
  }
  .welcome-footer {
    font-size: 10px;
    letter-spacing: 0.28em;
    line-height: 1.8;
    margin: auto 0 0;
    padding-top: 28px;
    min-height: 100px;
  }
  .welcome-footer > span,
  .destination-motto > span {
    display: block;
    height: 1px;
    width: 32px;
    background: #a17b35;
    margin: 14px auto 0;
  }
  .welcome-margin {
    position: absolute;
    top: 52px;
    font-size: 6px;
    letter-spacing: 0.22em;
    line-height: 2.65;
    z-index: 0;
  }
  .welcome-margin.left {
    left: 16px;
    text-align: left;
  }
  .welcome-margin.right {
    right: 16px;
    text-align: right;
  }
  .welcome-margin span {
    display: block;
    width: 22px;
    height: 1px;
    background: #ad823c;
    margin: 15px 0;
  }
  .welcome-margin.right span {
    margin-left: auto;
  }
  .entry-back {
    position: absolute;
    left: 12px;
    top: 4px;
    z-index: 4;
  }
  .entry-back .icon,
  .destination-top > button:first-child .icon {
    transform: rotate(180deg);
  }
  .entry-error {
    min-height: 0;
    color: #a0291a;
    font-size: 12px;
  }
  .entry-error:not(:empty) {
    margin: 10px 0;
    padding: 8px;
    background: white;
  }
  .destination-screen {
    position: relative;
    isolation: isolate;
    color: #181612;
    width: 100%;
    max-width: 720px;
    min-height: 100svh;
    margin: 0 auto;
    padding: 12px 24px 36px;
    background: #fffdfa;
  }
  .destination-screen::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
      linear-gradient(#fffefdf5 10%, #fffefdea 65%, #fffefdb0),
      url("/assets/welcome-background.webp") center bottom / cover no-repeat;
    opacity: 0.95;
  }
  .destination-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 35px;
  }
  .destination-top .icon-button {
    color: #24201a;
  }
  .destination-language {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px;
    color: #725323;
    min-height: 40px;
    font-size: 12px;
  }
  .destination-language .icon {
    width: 16px;
    height: 16px;
  }
  .destination-intro {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 15px;
    align-items: center;
    padding: 7px 0 42px;
  }
  .destination-brand {
    text-align: center;
  }
  .destination-brand img {
    display: block;
    width: 115px;
    height: 115px;
    margin: auto;
    object-fit: contain;
  }
  .destination-brand > div {
    font-family: Georgia, serif;
    letter-spacing: 0.08em;
    font-size: 19px;
    white-space: nowrap;
  }
  .destination-brand small {
    font-size: 5px;
    letter-spacing: 0.22em;
    display: block;
    margin-top: 3px;
  }
  .destination-brand i {
    display: block;
    font-family: "Snell Roundhand", "Brush Script MT", "Segoe Script", cursive;
    font-size: 19px;
    color: #98702b;
    margin: 11px -10px 0;
    transform: rotate(-7deg);
  }
  .destination-intro h1 {
    font-size: clamp(23px, 5.8vw, 34px);
    font-weight: 500;
    line-height: 1.5;
    white-space: pre-line;
    color: #211e19;
    letter-spacing: -0.04em;
  }
  .destination-intro p {
    font-size: 10px;
    line-height: 1.65;
    margin-top: 8px;
    color: #716b60;
  }
  .destination-search {
    display: flex;
    gap: 10px;
    align-items: center;
    border: 1px solid #cebd98;
    border-radius: 40px;
    background: #ffffffed;
    box-shadow: inset 0 0 16px #ddbf8119;
    min-height: 48px;
    padding: 0 16px;
  }
  .destination-search label {
    display: flex;
  }
  .destination-search .icon {
    width: 21px;
    height: 21px;
  }
  .destination-search input {
    background: transparent;
    color: #211e19;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    min-height: 46px;
    font-size: 13px;
  }
  .destination-search input::placeholder {
    color: #827b70;
    opacity: 1;
  }
  .destination-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid #e7e0d5;
    margin: 14px 0;
  }
  .destination-tabs button {
    color: #787065;
    position: relative;
    padding: 13px 3px;
    min-height: 47px;
    font-size: 12px;
  }
  .destination-tabs button[aria-selected="true"] {
    color: #926820;
  }
  .destination-tabs button[aria-selected="true"]::after {
    content: "";
    height: 2px;
    background: #ad813a;
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    border-radius: 5px;
  }
  .destination-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .destination-card {
    aspect-ratio: 0.87;
    position: relative;
    border: 1px solid #e3d9c8;
    box-shadow: 0 5px 16px #6751230c;
    border-radius: 11px;
    overflow: hidden;
    color: white;
    text-align: left;
    isolation: isolate;
    background: #192437;
  }
  .destination-card[hidden] {
    display: none;
  }
  .city-art {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url("/assets/destination-cities.webp") 0 0 / 300% 200%;
  }
  .city-art-JP {
    background-position: 50% 0;
  }
  .city-art-TH {
    background-position: 100% 0;
  }
  .city-art-VN {
    background-position: 0 100%;
  }
  .city-art-US {
    background-position: 50% 100%;
  }
  .city-art-SG {
    background-position: 100% 100%;
  }
  .destination-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(transparent 38%, #000c 80%);
  }
  .destination-card-label {
    position: absolute;
    bottom: 9px;
    left: 9px;
    right: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
  }
  .destination-card-label > span:first-child {
    min-width: 0;
  }
  .destination-card strong {
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    display: block;
  }
  .destination-card small {
    display: block;
    font-size: 10px;
    color: #e5e3e0;
    margin-top: 3px;
  }
  .destination-card .language-flag {
    width: 23px;
    height: 23px;
    font-size: 21px;
    flex-shrink: 0;
  }
  .destination-world {
    margin: 19px auto 0;
    width: 85%;
    border: 1px solid #e0c995;
    border-radius: 40px;
    color: #725323;
    background: #ffffffd9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 48px;
    font-size: 13px;
  }
  .destination-world .icon {
    width: 20px;
    height: 20px;
  }
  .destination-motto {
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.27em;
    line-height: 1.9;
    padding-top: 31px;
    padding-bottom: 32px;
  }
  .destination-empty {
    color: #756c5c;
    padding: 28px 12px;
    font-size: 13px;
    text-align: center;
  }
  .welcome-screen button:focus-visible,
  .destination-screen button:focus-visible {
    outline: 3px solid #c1994d;
    outline-offset: 4px;
  }
  .destination-search:focus-within {
    outline: 2px solid #eed89e;
    outline-offset: 3px;
  }
  @media (min-width: 620px) {
    .welcome-screen {
      padding-top: 45px;
    }
    .welcome-margin {
      font-size: 9px;
    }
    .welcome-margin.left {
      left: 28px;
    }
    .welcome-margin.right {
      right: 28px;
    }
    .welcome-choices {
      margin-top: 10px;
    }
    .welcome-languages button {
      min-height: 56px;
    }
    .destination-screen {
      padding: 22px 42px 40px;
    }
    .destination-intro {
      padding-bottom: 60px;
    }
    .destination-brand img {
      width: 170px;
      height: 170px;
    }
    .destination-brand > div {
      font-size: 29px;
    }
    .destination-intro p {
      font-size: 15px;
    }
    .destination-card strong {
      font-size: 19px;
    }
    .destination-card small {
      font-size: 14px;
    }
    .destination-card .language-flag {
      width: 34px;
      height: 34px;
      font-size: 30px;
    }
  }
  @media (max-width: 360px) {
    .welcome-screen {
      padding: 22px 14px 25px;
    }
    .welcome-margin {
      font-size: 5px;
    }
    .welcome-languages {
      width: 84%;
    }
    .welcome-signature {
      margin-bottom: 21px;
    }
    .destination-screen {
      padding-left: 15px;
      padding-right: 15px;
    }
    .destination-intro {
      gap: 12px;
    }
    .destination-intro h1 {
      font-size: 22px;
    }
    .destination-brand > div {
      font-size: 17px;
    }
    .destination-card-label {
      left: 6px;
    }
    .destination-card strong {
      font-size: 11px;
    }
  }
  @media (max-height: 760px) and (max-width: 619px) {
    .welcome-screen {
      padding-top: 18px;
    }
    .welcome-emblem {
      width: min(46vw, 18svh);
    }
    .welcome-signature {
      margin-bottom: 15px;
      font-size: 26px;
    }
    .welcome-choices > p:not(.entry-error) {
      margin-bottom: 12px;
    }
    .welcome-languages {
      gap: 6px;
    }
    .welcome-languages button {
      min-height: 47px;
      padding-top: 6px;
      padding-bottom: 6px;
    }
    .welcome-footer {
      min-height: 70px;
      padding-top: 18px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .welcome-languages button {
      transition: none;
    }
  }
}
