/*
Theme Name: Gloss Thai Dictionary
Theme URI: https://gloss.thai
Author: Gloss
Description: Marketing site for Gloss — Thai Dictionary. Lacquer, ivory, and gold, matching the iOS app.
Version: 1.6.0
License: GNU General Public License v2 or later
Text Domain: gloss-thai
*/

:root {
  --bg: #f4ecd8;
  --surface: #fbf6e8;
  --elevated: #fffbf2;
  --border: #d2b878;
  --border-subtle: #e6d6b4;
  --text: #14110c;
  --text-2: #3f382c;
  --muted: #5e5548;
  --accent: #6b4a0e;
  --accent-soft: #f3e6c4;
  --gold: #f3d57a;
  --gold-ink: #1a1408;
  --dark: #100e0a;
  --dark-text: #fff8ee;
  --shadow: 0 22px 40px rgba(20, 17, 12, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
code { font-size: 0.88em; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  width: min(1120px, calc(100% - 32px));
  margin: 12px auto 0;
  border-radius: 22px;
  background: rgba(255, 250, 238, 0.9);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 10px 28px rgba(16, 14, 10, 0.12);
  transition: transform 0.32s ease;
  will-change: transform;
}
.site-header.is-away {
  transform: translateY(calc(-100% - 28px));
  pointer-events: none;
}
.device[data-motion='zoom'] {
  transform-origin: 50% 80%;
}
.site-header::before,
.site-header::after {
  display: none;
}
.header-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  min-height: 72px;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  color: var(--text);
  text-decoration: none;
  z-index: 2;
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand strong {
  font-family: Fraunces, "Iowan Old Style", Palatino, serif;
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.85rem, 2.6vw, 2.35rem);
  letter-spacing: -0.04em;
  color: #120e09;
}
.brand span {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #5a3d12;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 6px 4px;
  align-items: center;
  flex-wrap: wrap;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.nav a {
  color: #120e09;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover { color: var(--accent); }

.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.nav-burger span,
.nav-burger span::before,
.nav-burger span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-burger span::before,
.nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 44px;
}
.btn-primary {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: #c6a24a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 6px 16px rgba(107, 74, 14, 0.18);
  letter-spacing: 0.01em;
}
.nav .btn-primary {
  color: var(--gold-ink);
  font-size: 1.02rem;
  font-weight: 700;
  padding: 12px 22px;
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.05); color: var(--gold-ink); }

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.store-badge img { height: 44px; width: auto; }
.store-badge.play img { height: 64px; margin: -10px -8px; }

.hero-band {
  position: relative;
  overflow: visible;
  margin-top: -76px;
  padding: 104px 0 64px;
  min-height: 92vh;
  background: #100e0a;
}
.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("lacquer-field.jpg") center / cover no-repeat;
  pointer-events: none;
}
.hero-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(16, 14, 10, 0.58) 0%,
    rgba(16, 14, 10, 0.22) 46%,
    rgba(16, 14, 10, 0.1) 100%
  );
  pointer-events: none;
}
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  align-items: center;
}
.hero-copy {
  background: rgba(251, 246, 232, 0.8);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgba(243, 213, 122, 0.5);
  border-radius: 22px;
  padding: 28px 26px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, var(--shadow);
}
.kicker {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 16px;
  font-weight: 600;
}
.lead {
  font-size: 1.12rem;
  color: var(--text-2);
  max-width: 34rem;
  margin: 0 0 18px;
}
.store-note { color: var(--muted); font-size: 0.92rem; margin-top: 10px; max-width: 32rem; }
.sell-points {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-width: 34rem;
}
.sell-points li {
  position: relative;
  padding-left: 1.15em;
  color: var(--text-2);
  font-size: 1.02rem;
}
.sell-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--accent);
}

.collage {
  position: relative;
  min-height: 520px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  padding: 28px 8px 8px;
  overflow: visible;
}
.collage .device { width: min(250px, 48%); }
.collage .device:first-child { margin-right: -28px; z-index: 1; }
.collage .device:last-child { z-index: 2; }
.collage .device figcaption { display: none; }
.collage.pair {
  gap: 12px;
  align-items: flex-start;
  padding-top: 12px;
}
.collage.pair .device { width: min(240px, 47%); margin: 0; }
.collage.pair .device:last-child { margin-top: 36px; }

.device { margin: 0; will-change: transform; }
.device img,
.shot-slot {
  width: 100%;
  border-radius: 28px;
  border: 8px solid #1a140c;
  box-shadow: var(--shadow);
  background: #1a140c;
}
.device img { aspect-ratio: 1206 / 2622; object-fit: cover; object-position: top; }
.device-tablet img { aspect-ratio: 2064 / 2752; }
.shot-slot {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 24px 18px;
  background: repeating-linear-gradient(-45deg, #fbf6e8, #fbf6e8 12px, #f3e6c4 12px, #f3e6c4 24px);
  border: 2px dashed var(--accent);
  color: var(--text);
  text-align: center;
}
.shot-slot strong { font-size: 1.05rem; }
.shot-slot span, .shot-slot em { color: var(--muted); font-size: 0.9rem; font-style: normal; }
.device figcaption {
  margin-top: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.feature-zig,
.pitch {
  display: grid;
  grid-template-columns: 1fr min(280px, 36%);
  gap: 40px;
  align-items: center;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border-subtle);
}
.pitch {
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  align-items: start;
}
.pitch.flip { grid-template-columns: minmax(280px, 1.1fr) minmax(0, 0.9fr); }
.pitch.flip .zig-copy { order: 2; }
.pair {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}
.pair .device { width: min(230px, 48%); margin: 0; }
.pair .device:nth-child(2) { margin-top: 32px; }
.feature-zig.flip { grid-template-columns: min(280px, 36%) 1fr; }
.feature-zig:has(.device-tablet) { grid-template-columns: 1fr min(400px, 48%); }
.feature-zig.flip:has(.device-tablet) { grid-template-columns: min(400px, 48%) 1fr; }
.feature-zig.flip .zig-copy { order: 2; }
.zig-copy h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  margin: 0 0 12px;
}
.zig-copy p { color: var(--text-2); margin: 0 0 10px; }

.phone-row { padding: 12px 0 48px; }
.phone-row h2 { margin: 0 0 8px; font-size: 1.8rem; }
.phone-row .sub { color: var(--text-2); max-width: 40rem; margin: 0 0 22px; }
.phones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 18px 16px;
}
.phones .device-phone { width: min(190px, 18%); }
.phones .device-tablet { width: min(340px, 36%); }
.phones .device:nth-child(2) { margin-bottom: 18px; }
.phones .device:nth-child(3) { margin-bottom: 8px; }

.about-block {
  padding: 12px 0 36px;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}
.about-block h2 { margin: 0 0 12px; font-size: 1.8rem; }
.about-block p { color: var(--text-2); }

.download {
  margin: 8px 0 16px;
  background: var(--dark);
  color: var(--dark-text);
  border-radius: 24px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: center;
}
.download h2 { color: var(--gold); margin: 0 0 10px; }
.download p { color: #e6dcc8; }
.download .store-badge img { filter: none; }
.pro-aside { margin: 0; color: #c2b6a0; font-size: 0.95rem; }
.legal-line {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 0 56px;
}

.page-body { padding: 48px 0 80px; max-width: 720px; }
.page-body h1 { font-size: 2.4rem; margin-top: 0; }
.page-body p, .page-body li { color: var(--text-2); }
.news-list { display: grid; gap: 16px; }
.news-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px 22px;
}
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero, .feature-zig, .feature-zig.flip, .pitch, .pitch.flip, .download, .phones { grid-template-columns: 1fr; }
  .feature-zig.flip .zig-copy,
  .pitch.flip .zig-copy { order: 0; }
  .hero { gap: 20px; }
  .collage {
    min-height: 0;
    order: -1;
    padding: 8px 0 12px;
  }
  .collage .device { width: 46%; }
  .phones { display: grid; grid-template-columns: 1fr 1fr; }
  .phones .device-phone,
  .phones .device-tablet { width: 100%; }
  .phones .device { margin: 0 !important; }
  .nav-burger { display: flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    background: rgba(255, 250, 238, 0.96);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    border-bottom: 1px solid rgba(243, 213, 122, 0.4);
    padding: 12px 16px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .nav a { padding: 10px 4px; }
  .nav .btn-primary { align-self: stretch; text-align: center; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .download { padding: 24px; }
}

@media (max-width: 480px) {
  .brand strong { font-size: 1.7rem; }
  .hero h1 { font-size: 2rem; }
  .device img, .shot-slot { border-width: 6px; border-radius: 22px; }
  .shot-slot { min-height: 280px; }
  .pair .device,
  .collage.pair .device { width: 48%; }
  .pair { gap: 8px; }
  .pair .device:nth-child(2),
  .collage.pair .device:last-child { margin-top: 28px; }
  .sell-points li { font-size: 0.98rem; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .pitch,
  .pitch.flip { grid-template-columns: 1fr; }
  .pitch.flip .zig-copy { order: 0; }
  .pair .device { width: min(260px, 46%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device { will-change: auto; }
  .site-header { transition: none; }
  .site-header.is-away { transform: none; pointer-events: auto; }
}
