:root {
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", "Source Serif 4", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-cjk: "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-hello: "Inter", "Noto Sans CJK SC", "Noto Sans CJK JP", "Noto Sans CJK KR",
    "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic",
    "Noto Sans Devanagari", "Noto Sans Hebrew", "Noto Sans", system-ui, sans-serif;
  --radius: 14px;
}

/* Morning & afternoon (05:00–16:59 visitor time) */
:root[data-theme="light"] {
  --bg: #fafaf7;
  --text: #0a0a0a;
  --text-muted: rgba(10, 10, 10, 0.68);
  --text-faint: rgba(10, 10, 10, 0.45);
  --surface: #ededea;
  --line: rgba(10, 10, 10, 0.09);
  --surface-hover: #e3e3df;
  --logo-filter: invert(1) brightness(0.15);
  --photo-a: #d8d4cc;
  --photo-b: #b9b3a8;
}

/* Evening & night (17:00–04:59) */
:root[data-theme="dark"] {
  --bg: #000;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.45);
  --surface: #1c1c1c;
  --line: rgba(255, 255, 255, 0.09);
  --surface-hover: #262626;
  --logo-filter: none;
  --photo-a: #2a2a2a;
  --photo-b: #161616;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1s ease, color 1s ease;
}

.page {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo {
  width: 70px;
  height: auto;
  filter: var(--logo-filter);
}

.tagline {
  margin: 12px 0 0;
  font-family: var(--font-cjk), var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.headline-wrap {
  /* Widest first line is a reserved hello (e.g. 안녕하세요) + ", I'm Nick." */
  --headline-size: min(64px, calc((min(100vw, 720px) - 32px) / 12.4));
  position: relative;
  width: 100%;
}

html[lang="ru"] .headline-wrap {
  --headline-size: min(64px, calc((min(100vw, 720px) - 32px) / 12.8));
}

.headline {
  margin: 22px 0 16px;
  font-size: var(--headline-size);
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.is-intro .page > * { visibility: hidden; }

.headline .line-mask {
  display: block;
  overflow: hidden;
  padding: 0.14em 0 0.2em;
  margin: -0.14em 0 -0.2em;
}
.headline .line { display: inline-block; text-align: center; }
.headline.is-revealed .line-mask { overflow: visible; }

.headline .hello {
  display: inline-block;
  unicode-bidi: isolate;
  font-family: var(--font-hello);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.pill:hover { background: var(--surface-hover); }
.pill img, .pill svg { width: 22px; height: 22px; display: block; color: currentColor; filter: var(--logo-filter); }

.about {
  width: 100%;
  max-width: 480px;
  margin: 28px 0 40px;
  text-align: left;
}

.about-lead {
  margin: 0;
  text-wrap: pretty;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.about-lead em {
  font-family: var(--font-serif);
  font-size: 1.22em;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}

.places {
  width: 100%;
  max-width: 640px;
  margin: 0 0 48px;
}

.places-card {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px;
  background: var(--photo-b);
  text-align: left;
  touch-action: pan-y;
  outline: none;
}

.places-stage {
  position: absolute;
  inset: -6% 0;
  height: 112%;
  will-change: transform;
}

.places-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.places-img.is-current { opacity: 1; }

.places-card figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  pointer-events: none;
}

.places-caption { display: inline-block; }

.places-dots {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.places-dots button {
  width: 16px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: #fff;
  opacity: 0.38;
  cursor: pointer;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.places-dots button[aria-selected="true"] {
  opacity: 1;
  width: 22px;
}

.langs {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.langs-title,
.langs-latest {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.lang-list {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 0 0 36px;
  padding: 0;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lang-list li[lang="zh-Hans"] {
  font-family: var(--font-cjk), var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.lang-list li[lang="ru"] {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
}

.lang-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 16px;
}

.lang-links li { display: flex; align-items: center; }
.lang-links li + li::before {
  content: "·";
  margin: 0 12px;
  color: var(--text-faint);
}

.lang-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.lang-links a:hover { border-bottom-color: currentColor; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.footer {
  margin-top: 48px;
  font-size: 15px;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}

.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer-sep { margin: 0 6px; }

@media (max-width: 640px) {
  .socials { flex-wrap: nowrap; gap: 6px; }
  .pill {
    height: 36px;
    gap: 5px;
    padding: 0 9px 0 7px;
    font-size: clamp(11px, 3vw, 15px);
    letter-spacing: 0;
  }
  .pill img, .pill svg { width: 17px; height: 17px; }

  .places { max-width: 100%; }
  .lang-list { gap: 6px 22px; }
  .lang-links { font-size: 15px; }
  .lang-links li + li::before { margin: 0 10px; }
}

@media (max-width: 480px) {
  .page { padding-top: 64px; }
  .about-lead { font-size: 18px; }
  .tagline { font-size: 14px; letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .is-intro .page > * { visibility: visible; }
  .places-stage { inset: 0; height: 100%; transform: none !important; }
  .places-img { transition: none; }
}
