/* The Map of Cuisine — styles
 * Scoped under .ttw. Change the variables in the first block to restyle; nothing else needs editing.
 * Fonts: a serif display face for the title and dish names, a clean sans for everything else.
 */
.ttw {
  /* surfaces + text */
  --ttw-bg: #070708;
  --ttw-bg-2: #0c0d0f;
  --ttw-glass: rgba(255, 255, 255, .035);
  --ttw-glass-strong: rgba(18, 19, 22, .82);
  --ttw-line: rgba(255, 255, 255, .08);
  --ttw-line-strong: rgba(255, 255, 255, .16);
  --ttw-ink: #f3efe8;             /* warm white */
  --ttw-ink-2: rgba(243, 239, 232, .78);
  --ttw-ink-soft: #8e8a84;
  --ttw-ink-faint: #5c5953;
  /* accents */
  --ttw-amber: #e4a24a;
  --ttw-amber-ink: #1a1206;
  --ttw-amber-soft: rgba(228, 162, 74, .14);
  --ttw-cyan: #5cd3e6;
  --ttw-cyan-soft: rgba(92, 211, 230, .10);
  /* globe (read by the script) */
  --ttw-ocean: #0d1117;
  --ttw-land: #2a2c31;
  --ttw-land-muted: #1a1b1f;
  --ttw-land-hover: #4a4036;
  --ttw-selected: #ffffff;
  --ttw-border-line: rgba(8, 10, 14, .65);
  /* country colors, chosen so neighbors always differ; set to none for plain charcoal land */
  --ttw-palette: #ef6a4c, #f2a541, #f0cf52, #7fcc5e, #3ec4a8, #4aa3f0, #7f82f5, #bb84ea, #ef6fa6, #3fc3d8;
  --ttw-atmosphere: #4cc4dc;
  --ttw-ring: #e4a24a;
  /* type */
  --ttw-font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --ttw-font-body: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --ttw-radius: 22px;
  --ttw-radius-sm: 14px;
  --ttw-ease: cubic-bezier(.22, .7, .2, 1);

  background: var(--ttw-bg);
  color: var(--ttw-ink);
  font-family: var(--ttw-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: clamp(56px, 8vw, 112px) clamp(20px, 4vw, 56px) clamp(64px, 8vw, 112px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.ttw *, .ttw *::before, .ttw *::after { box-sizing: border-box; }
.ttw ::selection { background: var(--ttw-amber); color: var(--ttw-amber-ink); }
.ttw button, .ttw input { font-family: inherit; }

/* faint charcoal gradient so the section isn't flat black */
.ttw::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, .035), transparent 70%),
    linear-gradient(180deg, var(--ttw-bg) 0%, var(--ttw-bg-2) 60%, var(--ttw-bg) 100%);
}

/* ---------- header ---------- */
.ttw-head { max-width: 1240px; margin: 0 auto clamp(36px, 5vw, 64px); }
.ttw-overline {
  display: flex; align-items: center; gap: 14px; margin: 0 0 22px;
  font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ttw-amber);
}
.ttw-overline::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ttw-line-strong), transparent); }
.ttw-eyebrow { display: none; }
.ttw-title {
  font-family: var(--ttw-font-display); font-weight: 400;
  font-size: clamp(2.75rem, 7vw, 5.5rem); line-height: .98; letter-spacing: -.02em;
  margin: 0 0 18px; color: var(--ttw-ink); max-width: 14ch;
}
.ttw-title em { font-style: italic; color: var(--ttw-ink-2); }
.ttw-lede { margin: 0; max-width: 46ch; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.55; color: var(--ttw-ink-soft); }
.ttw-lede strong { font-weight: 500; color: var(--ttw-ink-2); }

/* ---------- layout ---------- */
.ttw-layout {
  max-width: 1240px; margin: 0 auto;
  display: grid; gap: clamp(24px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .95fr);
  grid-template-areas: "globe side";
  align-items: center;
}
.ttw-globe { grid-area: globe; }
.ttw-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 920px) {
  .ttw-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "globe" "card"; gap: 20px; }
  .ttw-side { display: contents; }
  .ttw-search { grid-area: search; }
  .ttw-card { grid-area: card; }
}

/* ---------- globe ---------- */
.ttw-globe {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  max-width: min(100%, 86vh); margin: 0 auto;
  border-radius: 50%; outline: none; touch-action: none;
}
/* restrained cyan light behind the globe */
.ttw-globe::before {
  content: ""; position: absolute; inset: -6%; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, var(--ttw-cyan-soft) 0%, rgba(92, 211, 230, .04) 40%, transparent 68%);
}
.ttw-globe__canvas { position: absolute; inset: 0; z-index: 1; cursor: grab; border-radius: 50%; }
.ttw-globe__canvas:active { cursor: grabbing; }
.ttw-globe__canvas canvas { display: block; }

.ttw-globe__status {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center;
  color: var(--ttw-ink-soft); font-size: .9rem; line-height: 1.5; border-radius: 50%; padding: 0;
  will-change: opacity, transform;
}
/* wireframe placeholder shown until the real globe is drawn */
.ttw-wire { position: absolute; inset: 6%; width: 88%; height: 88%; color: var(--ttw-cyan); opacity: .55; overflow: visible; }
.ttw-wire__sphere { transform-origin: 100px 100px; animation: ttw-wire-spin 14s linear infinite; }
.ttw-wire__dot { fill: var(--ttw-amber); transform-origin: 100px 100px; animation: ttw-wire-orbit 3.2s linear infinite; filter: drop-shadow(0 0 6px var(--ttw-amber)); }
.ttw-wire__text { position: relative; z-index: 1; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ttw-ink-soft); animation: ttw-wire-pulse 1.6s ease-in-out infinite; }
@keyframes ttw-wire-spin { to { transform: rotate(360deg); } }
@keyframes ttw-wire-orbit { to { transform: rotate(360deg); } }
@keyframes ttw-wire-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.ttw-globe:not(.is-ready)::before { opacity: .7; }
.ttw-globe.is-failed .ttw-wire { display: none; }
.ttw-globe.is-failed { aspect-ratio: auto; border-radius: var(--ttw-radius); }
.ttw-globe.is-failed::before { display: none; }
.ttw-globe.is-failed .ttw-globe__status {
  position: static; border-radius: var(--ttw-radius); padding: 28px 24px; background: var(--ttw-glass);
}
.ttw-globe.is-failed .ttw-globe__controls, .ttw-globe:not(.is-ready) .ttw-globe__controls { display: none; }

/* hovered country name */
.ttw-globe__hover {
  position: absolute; left: 50%; top: 3%; z-index: 3; transform: translate(-50%, -6px);
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ttw-glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--ttw-line-strong); color: var(--ttw-ink);
  padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-weight: 500; letter-spacing: .02em;
  pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .18s ease, transform .18s var(--ttw-ease);
}
.ttw-globe__hover::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ttw-amber); }
.ttw-globe__hover.is-on { opacity: 1; transform: translate(-50%, 0); }

/* vertical glass control pill */
.ttw-globe__controls {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--ttw-glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--ttw-line); border-radius: 999px;
}
@media (max-width: 920px) {
  .ttw-globe__controls { top: auto; right: auto; bottom: -6px; left: 50%; transform: translateX(-50%); flex-direction: row; }
}
.ttw-iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--ttw-ink-soft); cursor: pointer;
  transition: color .2s ease, background .2s ease;
}
.ttw-iconbtn svg { width: 18px; height: 18px; }
.ttw-iconbtn:hover { color: var(--ttw-ink); background: rgba(255, 255, 255, .06); }
.ttw-iconbtn[aria-pressed="true"] { color: var(--ttw-amber); }
.ttw-iconbtn .ttw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* keyboard target marker */
.ttw-globe:focus-visible { box-shadow: 0 0 0 2px var(--ttw-bg), 0 0 0 4px var(--ttw-amber); }
.ttw-globe:focus-visible::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; z-index: 3;
  margin: -10px 0 0 -10px; border: 1.5px solid var(--ttw-amber); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(228, 162, 74, .18);
}

/* ---------- search ---------- */
.ttw-search { display: flex; gap: 10px; }
.ttw-search__field { position: relative; flex: 1; min-width: 0; }
.ttw-search__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--ttw-ink-soft); pointer-events: none; display: flex; }
.ttw-search__input {
  width: 100%; height: 52px; padding: 0 18px 0 48px; border-radius: 999px;
  border: 1px solid var(--ttw-line); background: var(--ttw-glass); color: var(--ttw-ink);
  font-size: .95rem; transition: border-color .2s ease, background .2s ease;
}
.ttw-search__input::placeholder { color: var(--ttw-ink-soft); }
.ttw-search__input:focus { outline: none; border-color: var(--ttw-line-strong); background: rgba(255, 255, 255, .05); }
.ttw-search__input:focus-visible { box-shadow: 0 0 0 2px var(--ttw-bg), 0 0 0 4px var(--ttw-amber); }
.ttw-search__input:disabled { opacity: .5; cursor: not-allowed; }
.ttw-search__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 320px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--ttw-glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--ttw-line-strong); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); display: none;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.ttw-search__list.is-open { display: block; }
.ttw-search__opt, .ttw-search__none {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 14px; border-radius: 12px; cursor: pointer; font-size: .92rem;
}
.ttw-search__none { color: var(--ttw-ink-soft); cursor: default; }
.ttw-search__opt.is-active, .ttw-search__opt:hover { background: rgba(255, 255, 255, .07); }
.ttw-search__opt.is-active { box-shadow: inset 2px 0 0 var(--ttw-amber); }
.ttw-search__count { color: var(--ttw-ink-soft); font-size: .75rem; letter-spacing: .04em; white-space: nowrap; }
.ttw-search__opt.is-nodata { color: var(--ttw-ink-soft); }

/* ---------- buttons ---------- */
.ttw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--ttw-line-strong); background: transparent; color: var(--ttw-ink);
  font-weight: 500; font-size: .92rem; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.ttw-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); }
.ttw-btn:disabled { opacity: .4; cursor: not-allowed; }
.ttw-btn--accent { background: var(--ttw-amber); border-color: var(--ttw-amber); color: var(--ttw-amber-ink); }
.ttw-btn--accent:hover:not(:disabled) { background: #f0b45f; border-color: #f0b45f; }
.ttw-btn__icon { display: inline-flex; }
.ttw-btn__icon svg { width: 16px; height: 16px; }
.ttw :focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ttw-bg), 0 0 0 4px var(--ttw-amber); }
.ttw a:focus-visible { border-radius: 3px; }

/* ---------- dish panel ---------- */
.ttw-card {
  position: relative; outline: none;
  background: var(--ttw-glass); border: 1px solid var(--ttw-line); border-radius: var(--ttw-radius);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding: clamp(26px, 3.2vw, 40px); min-height: 380px;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 30%);
  transition: opacity .28s ease, transform .28s var(--ttw-ease);
}
.ttw-card--leaving { opacity: 0; transform: translateY(6px); }
.ttw-card--empty { min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.ttw-card--enter .ttw-card__stagger { animation: ttw-rise .6s var(--ttw-ease) both; }
.ttw-card--enter .ttw-card__stagger:nth-child(2) { animation-delay: .05s; }
.ttw-card--enter .ttw-card__stagger:nth-child(3) { animation-delay: .10s; }
.ttw-card--enter .ttw-card__stagger:nth-child(4) { animation-delay: .15s; }
.ttw-card--enter .ttw-card__stagger:nth-child(5) { animation-delay: .20s; }
.ttw-card--enter .ttw-card__stagger:nth-child(n+6) { animation-delay: .25s; }
@keyframes ttw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.ttw-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.ttw-card__eyebrow { margin: 0; font-size: .74rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ttw-amber); }
.ttw-card__dots { display: flex; gap: 5px; }
.ttw-card__dots i { width: 14px; height: 2px; border-radius: 2px; background: var(--ttw-line-strong); transition: background .3s ease; }
.ttw-card__dots i.is-on { background: var(--ttw-amber); }
.ttw-card__title {
  font-family: var(--ttw-font-display); font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.05; letter-spacing: -.015em; margin: 0; color: var(--ttw-ink);
}
.ttw-card--empty .ttw-card__title { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.ttw-card__local { margin: 8px 0 0; font-family: var(--ttw-font-display); font-style: italic; font-size: 1.1rem; color: var(--ttw-ink-soft); }
.ttw-card__note {
  display: flex; gap: 10px; align-items: baseline; margin: 18px 0 0; padding: 10px 14px;
  border-left: 2px solid var(--ttw-amber); background: var(--ttw-amber-soft); border-radius: 0 10px 10px 0;
  font-size: .84rem; color: var(--ttw-ink-2); line-height: 1.5;
}
.ttw-card__note-icon { display: none; }
.ttw-card__h {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 8px;
  font-size: .72rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ttw-ink-soft);
}
.ttw-card__h::after { content: ""; flex: 1; height: 1px; background: var(--ttw-line); }
.ttw-card__body { margin: 0; line-height: 1.65; font-size: 1rem; color: var(--ttw-ink-2); max-width: 60ch; }
.ttw-card--empty .ttw-card__body { margin-top: 10px; color: var(--ttw-ink-soft); font-size: .95rem; }
.ttw-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.ttw-card__count { color: var(--ttw-ink-soft); font-size: .78rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ttw-card__sources { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--ttw-line); font-size: .76rem; color: var(--ttw-ink-soft); line-height: 1.6; }
.ttw-card__sources a { color: var(--ttw-ink-soft); text-decoration: none; border-bottom: 1px solid var(--ttw-line-strong); transition: color .2s ease, border-color .2s ease; }
.ttw-card__sources a:hover { color: var(--ttw-ink); border-color: var(--ttw-ink); }
.ttw-card__related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; color: var(--ttw-ink-soft); font-size: .88rem; }
.ttw-chip { min-height: 40px; border: 1px solid var(--ttw-line-strong); background: transparent; color: var(--ttw-ink); border-radius: 999px; padding: 8px 16px; font-size: .86rem; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.ttw-chip:hover { border-color: var(--ttw-amber); background: var(--ttw-amber-soft); }

.ttw-help { max-width: 1240px; margin: 28px auto 0; text-align: center; font-size: .76rem; color: var(--ttw-ink-faint); letter-spacing: .02em; }
.ttw-help kbd { font-family: inherit; color: var(--ttw-ink-soft); }

@media (max-width: 540px) {
  .ttw-search { flex-direction: column; }
  .ttw-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ttw *, .ttw *::before, .ttw *::after { animation: none !important; transition: none !important; }
}

/* ---------- dish tags ---------- */
.ttw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ttw-tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ttw-line); background: transparent;
  color: var(--ttw-ink-soft); font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- photo ---------- */
.ttw-media {
  position: relative; margin: 0 0 22px; border-radius: var(--ttw-radius-sm); overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--ttw-bg-2); border: 1px solid var(--ttw-line);
}
.ttw-media img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.ttw-media--loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%);
  background-size: 200% 100%; animation: ttw-shimmer 1.4s linear infinite;
}
@keyframes ttw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ttw-media__credit {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .7));
  font-size: .68rem; color: rgba(243, 239, 232, .7); letter-spacing: .02em; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ttw-media__credit a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.ttw-media__credit a:hover { color: #fff; border-color: #fff; }

/* ---------- selection flash + breathing glow ---------- */
.ttw-globe { --ttw-glow: 1; }
.ttw-globe::before { transform: scale(var(--ttw-glow)); }
.ttw-globe__flash {
  position: absolute; inset: -4%; border-radius: 50%; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(228, 162, 74, .22) 0%, rgba(228, 162, 74, .08) 45%, transparent 70%);
}
.ttw-word { display: inline-block; }
.ttw-title em .ttw-word { font-style: italic; }
