/*
  TapChae-K website.
  One container and one type scale, with shared photo frames plus a full-bleed closing image. A soft,
  low-chroma palette (celadon, powder blue, mist) sits under deep ink text; only the route blue and
  the brand red K are saturated.
*/
@font-face {
  font-family: "Archivo Narrow";
  src: url("/assets/fonts/archivo-narrow-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #0d1b36;
  --ink-soft: #4a5673;
  --paper: #ffffff;
  --mist: #eef2f8;
  --tint: #dce6f6;
  --line: #d3dcec;
  --blue: #2757d8;
  --signal: #d63a1e;
  --celadon: #dcebe6;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(64px, 9vw, 112px);
  --radius-photo: 20px;
  --radius-ui: 12px;

  /* Content type scale: nothing below 14px, nothing above 56px. Footer fine print is a deliberate 10px exception. */
  --fs-small: 0.875rem;
  --fs-text: 1rem;
  --fs-body: 1.0625rem;
  --fs-h3: 1.25rem;
  --fs-lead: clamp(1.125rem, 1.02rem + 0.4vw, 1.3125rem);
  --fs-h2: clamp(1.75rem, 1.25rem + 1.7vw, 2.5rem);
  --fs-h1: clamp(2.25rem, 1.3rem + 3.4vw, 3.5rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo Narrow", "Arial Narrow", sans-serif;
  --leading-body: 1.65;
  --leading-heading: 1.15;
}
html[lang="ko"] {
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --leading-body: 1.75;
  --leading-heading: 1.3;
}
html[lang="ja"] {
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, "Segoe UI", Roboto, sans-serif;
  --leading-body: 1.85;
  --leading-heading: 1.3;
}
html[lang="th"] {
  --font: -apple-system, BlinkMacSystemFont, Thonburi, "Leelawadee UI", "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  --leading-body: 1.8;
  --leading-heading: 1.35;
  /* Thai glyphs read optically larger at the same size. */
  --fs-h2: clamp(1.625rem, 1.15rem + 1.6vw, 2.25rem);
  --fs-h1: clamp(2rem, 1.2rem + 3vw, 3.1rem);
}
html[lang="zh-Hant"] {
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, sans-serif;
  --leading-body: 1.8;
  --leading-heading: 1.3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--fs-body) / var(--leading-body) var(--font);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-ui);
  background: var(--ink);
  color: #ffffff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Headings and text. Balanced wrapping keeps the ragged edge tidy in every script. */
h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.02em; line-height: var(--leading-heading); text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: calc(var(--leading-heading) - 0.05); }
h1 span { display: block; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; text-wrap: pretty; }
html:not([lang="en"]) :is(h1, h2, h3) { letter-spacing: 0; font-weight: 700; }
html[lang="en"] body:not(.legal-page) :is(h1, h2, h3) { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; }
html[lang="ko"] :is(h1, h2, h3, p, li) { word-break: keep-all; overflow-wrap: break-word; }
html[lang="ja"] :is(h1, h2, h3, p, li), html[lang="zh-Hant"] :is(h1, h2, h3, p, li) { line-break: strict; overflow-wrap: break-word; }

.lead { max-width: 34rem; margin-top: 24px; color: var(--ink-soft); font-size: var(--fs-lead); line-height: 1.6; }
.note { color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.5; }
.link { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 0.25em; }

/* Brand lockup. The icon artwork is cropped tight to its glyph, so the mark simply fills its
   height and its left edge sits exactly on the container edge. */
.mark { --size: 36px; display: block; flex: none; height: var(--size); }
.mark img { display: block; width: auto; height: 100%; max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 1.25rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand__name { display: flex; align-items: center; gap: 0.4em; padding-top: 0.06em; }
.brand__ko, .brand__extra { letter-spacing: 0; }
.brand__en { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; }
.brand__ko { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; }
.brand__extra[lang="zh-Hant"] { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.brand__extra[lang="ja"] { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif; }
.brand__k { color: var(--signal); }

/* Header */
.site-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.header-row { display: flex; min-height: 68px; align-items: center; gap: 24px; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { color: var(--ink); font-size: var(--fs-small); font-weight: 650; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.header-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-back { margin-left: auto; font-size: var(--fs-small); font-weight: 650; text-underline-offset: 0.3em; }

.language-menu { position: relative; }
.language-menu summary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  font-size: var(--fs-small);
  font-weight: 650;
  list-style: none;
  user-select: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; content: ""; transform: translateY(-2px) rotate(45deg); }
.language-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.language-options { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; display: grid; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius-ui); background: #ffffff; box-shadow: 0 12px 32px rgba(13, 27, 54, 0.14); }
.language-options a { padding: 10px 12px; border-radius: 8px; font-size: var(--fs-small); font-weight: 650; text-decoration: none; }
.language-options a:hover { background: var(--mist); }
.language-options a[aria-current="page"] { background: var(--ink); color: #ffffff; }


/* Sections and the two-column split every section shares */
.section { padding-block: var(--section); scroll-margin-top: 68px; }
.section--mist { background: var(--mist); }
.section--celadon { background: var(--celadon); }
.split { display: grid; align-items: center; gap: clamp(32px, 6vw, 96px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.copy > p { max-width: 34rem; margin-top: 20px; color: var(--ink-soft); }
.copy > h2 + p { margin-top: 24px; }
.copy > p + p { margin-top: 16px; }

.photo { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-photo); background: var(--tint); aspect-ratio: var(--ratio, 4 / 3); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, center); }
.photo--hero { --ratio: 4 / 5; --focus: 80% center; }
.photo--landscape { --ratio: 4 / 3; }
.photo--journey { --ratio: 4 / 3; --focus: 12% center; }
.photo--portrait { --ratio: 4 / 5; }
.photo--portrait-wide { --ratio: 3 / 2; }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 88px) var(--section); }
.hero__actions { margin-top: 32px; }

/* Google Play badge. Google's artwork has built-in padding that differs by locale, so it is compensated with margins and never altered. */
.play-badge { --badge-h: 60px; display: inline-block; line-height: 0; border-radius: 8px; }
.play-badge img { display: block; width: auto; height: calc(var(--badge-h) * 250 / 192); margin-block: calc(var(--badge-h) * -29 / 192); }
.play-badge--en img { height: calc(var(--badge-h) * 250 / 168); margin: calc(var(--badge-h) * -41 / 168); }

/* Hero footnotes */
.fn { margin-left: 1px; font-size: 0.65em; line-height: 0; }
.fn a { color: var(--blue); font-weight: 700; text-decoration: none; }
.notes { display: grid; max-width: 34rem; margin: 20px 0 0; padding: 0; gap: 6px; list-style: none; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.5; }
.notes li { display: grid; gap: 8px; grid-template-columns: 0.9em minmax(0, 1fr); }
.notes li:target { color: var(--ink); }

/* Route line: one idiom used for the supported cards (horizontal) and the scan steps (vertical) */
.route { --dot: 16px; --route: var(--blue); --route-fill: #ffffff; margin: 18px 0 0; padding: 0; display: grid; list-style: none; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.route li { position: relative; padding-top: calc(var(--dot) + 14px); padding-right: 16px; }
.route li::before { position: absolute; z-index: 1; top: 0; left: 0; width: var(--dot); height: var(--dot); box-sizing: border-box; border: 3px solid var(--route); border-radius: 50%; background: var(--route-fill); content: ""; }
.route li:not(:last-child)::after { position: absolute; top: calc(var(--dot) / 2 - 1.5px); left: calc(var(--dot) / 2); width: 100%; height: 3px; background: var(--route); content: ""; }
.route__name { display: block; font-size: var(--fs-body); font-weight: 700; line-height: 1.3; }
.route__sub { display: block; margin-top: 2px; color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.4; }

.route--vertical { --gap: 28px; margin-top: 40px; grid-template-columns: 1fr; row-gap: var(--gap); }
.route--vertical li { padding: 0 0 0 calc(var(--dot) + 20px); }
.route--vertical li::before { top: 0.45em; }
.route--vertical li:not(:last-child)::after { top: calc(0.45em + var(--dot) / 2); bottom: calc(-1 * (var(--gap) + 0.45em + var(--dot) / 2)); left: calc(var(--dot) / 2 - 1.5px); width: 3px; height: auto; }
.route__title { font-size: var(--fs-h3); }
.route--vertical p { max-width: 28rem; margin-top: 6px; }

/* Journey features */
.features { display: grid; margin: 40px 0 0; padding: 0; gap: 28px 32px; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.features li { display: grid; align-items: start; gap: 14px; grid-template-columns: 24px minmax(0, 1fr); }
.features svg { display: block; width: 24px; height: 24px; margin-top: 2px; color: var(--blue); }
.features h3 { font-size: var(--fs-body); line-height: 1.3; }
.features p { margin-top: 4px; color: var(--ink-soft); font-size: var(--fs-text); line-height: 1.55; }

/* Closing call to action: full-bleed photography under a light pastel wash. */
.cta {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(560px, 55vw, 760px);
  align-items: center;
  overflow: hidden;
  background: var(--tint);
}
.cta::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(249, 251, 255, 0.98) 0%, rgba(239, 245, 255, 0.94) 30%, rgba(226, 237, 249, 0.66) 52%, rgba(220, 235, 230, 0.16) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(220, 230, 246, 0.18));
  content: "";
}
.cta__media { position: absolute; z-index: -2; inset: 0; margin: 0; overflow: hidden; }
.cta__media picture, .cta__media img { display: block; width: 100%; height: 100%; }
.cta__media img { object-fit: cover; object-position: 58% center; }
.cta__content { padding-block: var(--section); }
.cta__copy { max-width: min(34rem, 46%); }
.cta__actions { margin-top: 32px; }
/* Company history line under the closing Play badge: small supporting text, not a second CTA. */
.copy > p.cta__history { margin-top: 16px; font-size: var(--fs-small); line-height: 1.5; }
/* Italic only in English: ko, ja, zh-Hant and Thai fonts have no true italic, and a synthetic slant reads as broken. */
html[lang="en"] .copy > p.cta__history { font-style: italic; }

/* Footer */
.site-footer { padding: 48px 0 32px; background: var(--mist); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { font-size: var(--fs-small); font-weight: 650; text-underline-offset: 0.3em; }
.footer-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 40px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--fs-small); line-height: 1.5; }
.footer-legal { max-width: 46rem; }
.footer-legal p { margin: 0; }
.footer-legal p + p { margin-top: 8px; }
.footer-legal a { text-underline-offset: 0.25em; }
.fineprint { margin: 0; color: #5f6b84; font-size: 0.625rem; letter-spacing: 0.06em; line-height: 1.6; text-transform: uppercase; }
.footer-legal .fineprint { margin-top: 10px; }
.footer-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; max-width: 18rem; text-align: right; }
.company-logo { display: block; line-height: 0; }
.company-logo img { display: block; width: auto; height: 26px; }

/* Legal pages (also fetched by the Android app, which reads only #legal-content) */
.legal-page { background: var(--paper); }
.legal-main { width: min(100% - 2 * var(--gutter), 760px); margin: 0 auto; padding-block: clamp(48px, 7vw, 96px); }
.legal-card h1 { font-size: var(--fs-h1); }
.legal-card h2 { margin: 2.5rem 0 0.75rem; font-size: 1.5rem; line-height: 1.25; }
.legal-card p, .legal-card ul { margin: 1rem 0 0; }
.legal-card ul { padding-left: 1.4rem; }
.legal-card li + li { margin-top: 0.5rem; }
.legal-card .meta { margin: 16px 0 40px; color: var(--ink-soft); font-size: var(--fs-small); }
.legal-card a { color: var(--blue); }

@media (min-width: 901px) {
  .split--reverse .split__media { order: -1; }
  .site-nav { margin-left: auto; }
  .site-nav + .header-tools { margin-left: 0; }
}

@media (max-width: 900px) {
  .site-nav { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .photo--hero { --ratio: 1 / 1; --focus: 82% 30%; }
  .photo--portrait { --ratio: 4 / 5; max-width: 480px; }
  .photo--portrait-wide { --ratio: 3 / 2; }
  .cta { min-height: 700px; align-items: start; }
  .cta::after {
    background:
      linear-gradient(180deg, rgba(249, 251, 255, 0.99) 0%, rgba(239, 245, 255, 0.96) 32%, rgba(226, 237, 249, 0.68) 53%, rgba(220, 235, 230, 0.12) 82%),
      linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(220, 230, 246, 0.08));
  }
  .cta__media { top: 360px; }
  .cta__media img { object-position: 84% center; }
  .cta__content { padding-block: 56px 340px; }
  .cta__copy { max-width: 34rem; }
}

@media (max-width: 720px) {
  .header-row { min-height: 60px; gap: 12px; }
  .brand { gap: 8px; font-size: 1.1rem; }
  .brand__name { gap: 0.25em; }
  .language-menu summary { padding-inline: 12px; }
  .section { scroll-margin-top: 60px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .footer-top, .footer-meta { align-items: flex-start; flex-direction: column; }
  .footer-aside { align-items: flex-start; max-width: none; text-align: left; }
}

@media (max-width: 380px) {
  .header-row { gap: 8px; }
  .mark { --size: 30px; }
  .brand { gap: 6px; font-size: 0.95rem; }
  .brand__name { gap: 0.2em; }
  .language-menu summary { gap: 6px; padding-inline: 10px; }
}


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
