/* base.css: structure shared by every generated site.
   Override the tokens in styles.css. Put the app-specific look there, not here. */

:root {
  --bg: #111;
  --surface: #1c1c1c;
  --text: #fff;
  --muted: rgb(255 255 255 / .68);
  --line: rgb(255 255 255 / .1);
  --primary: #6b5bff;
  --accent: #ffcc33;
  --accent-ink: #111;
  --radius: 20px;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: var(--font-display);
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
main { flex: 1; }

/* layout */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* a11y */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* site header */
.site-header { padding-block: 18px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }

/* language switcher (plain links) */
.lang-switch { display: inline-flex; gap: 4px; font-size: 14px; }
.lang-switch a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.lang-switch a[aria-current="true"] { color: var(--text); background: var(--line); }

/* legal / support pages */
.prose { max-width: 68ch; margin-inline: auto; padding: clamp(24px, 6vw, 64px) var(--gutter) 64px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
.prose .meta { color: var(--muted); font-size: .95em; margin-bottom: 2em; }
.prose h2 { font-size: 1.3rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.08rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .95em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; white-space: nowrap; }
.prose details { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; margin-bottom: 10px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.prose summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.prose details[open] summary { margin-bottom: 4px; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 1.5em 0 2em; background: color-mix(in srgb, var(--surface) 75%, transparent); }

/* footer */
.site-footer { padding-block: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Secret Santa: Draw Names. The app's Christmas night theme (app/src/theme/occasions.scss, dark). */

@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap;
  src: url("/site/fonts/nunito-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap;
  src: url("/site/fonts/nunito-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Baloo 2"; font-weight: 400 800; font-display: swap;
  src: url("/site/fonts/baloo-2-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-weight: 400 800; font-display: swap;
  src: url("/site/fonts/baloo-2-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0c1838;
  --surface: #142449;
  --raised: #1b2e5a;
  --text: #f6efe3;
  --muted: #b9bfd2;
  --line: rgb(246 239 227 / .12);
  --primary: #f0675a;   /* the hat red */
  --accent: #f6c763;    /* the sparkle gold */
  --accent-ink: #2a1a00;
  --mint: #63c9ab;
  --radius: 24px;
  --font-display: "Baloo 2", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
:lang(ar) { --font-display: "Segoe UI", "Geeza Pro", "Noto Kufi Arabic", system-ui, sans-serif; --font-body: var(--font-display); }
:lang(ja) { --font-display: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; --font-body: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }

body { background: var(--bg); }
body.doc { background: radial-gradient(120% 50% at 50% 0%, rgb(27 46 90 / .9), transparent 70%) no-repeat, var(--bg); }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }
:lang(ar) h1, :lang(ar) h2, :lang(ja) h1, :lang(ja) h2 { letter-spacing: 0; }

/* header */
.site-header { position: relative; z-index: 5; }
.brand { font-family: var(--font-display); font-size: 1.15rem; }
.brand img { border-radius: 9px; box-shadow: 0 2px 10px rgb(0 0 0 / .35); }

.lang-menu { position: relative; font-size: 15px; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgb(20 36 73 / .55); backdrop-filter: blur(8px); color: var(--text);
  transition: border-color .18s ease, background .18s ease;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { border-color: rgb(246 239 227 / .3); }
.lang-menu summary svg { width: 18px; height: 18px; }
.lang-menu ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 20;
  margin: 0; padding: 6px; list-style: none; min-width: 180px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 40px rgb(0 0 0 / .45);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); }
.lang-menu li a:hover { background: rgb(246 239 227 / .08); color: var(--text); }
.lang-menu li a[aria-current="true"] { color: var(--accent-ink); background: var(--accent); font-weight: 700; }

/* hero */
.hero { position: relative; isolation: isolate; margin-top: -76px; padding-top: 76px; overflow: hidden; }
.scene { position: absolute; inset: 0; z-index: -2; }
.scene img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 100%; }
.scene::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgb(12 24 56 / .85) 0%, rgb(12 24 56 / .15) 30%, rgb(12 24 56 / 0) 55%, rgb(12 24 56 / .55) 85%, var(--bg) 100%),
    linear-gradient(to right, rgb(8 16 40 / .82) 0%, rgb(8 16 40 / .35) 50%, transparent 75%);
}
[dir="rtl"] .scene img { transform: scaleX(-1); }
[dir="rtl"] .scene::after {
  background:
    linear-gradient(to bottom, rgb(12 24 56 / .85) 0%, rgb(12 24 56 / .15) 30%, rgb(12 24 56 / 0) 55%, rgb(12 24 56 / .55) 85%, var(--bg) 100%),
    linear-gradient(to left, rgb(8 16 40 / .82) 0%, rgb(8 16 40 / .35) 50%, transparent 75%);
}

.hero-grid {
  min-height: min(calc(100svh - 120px), 780px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: 32px; padding-block: 48px 120px;
}
.hero-copy { max-width: 600px; }

.chip {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 7px 16px 7px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  background: rgb(20 36 73 / .7); border: 1px solid rgb(246 199 99 / .35); color: var(--text);
  backdrop-filter: blur(8px);
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(246 199 99 / .2); }

.hero h1 { font-size: clamp(3rem, 7.5vw, 5.6rem); line-height: .95; margin-bottom: .3em; text-shadow: 0 4px 30px rgb(0 0 0 / .35); }
.hero h1 .h1a, .hero h1 .h1b { display: block; }
.hero h1 .h1b {
  font-size: .62em; margin-top: .12em;
  background: linear-gradient(100deg, #ffd98a, var(--accent) 45%, #f39a4e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.25; margin-bottom: .6em; }
.lead { color: #dfe3ef; font-size: 1.08rem; max-width: 46ch; margin-bottom: 30px; }

.trust { display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0; color: #dfe3ef; font-weight: 700; font-size: 15px; }
.trust svg { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: rgb(99 201 171 / .2); color: var(--mint); }

.hero-art { position: relative; justify-self: center; width: min(100%, 340px); aspect-ratio: 1; display: grid; place-items: center; }
.icon-wrap { position: relative; width: 70%; }
.icon-wrap::before {
  content: ""; position: absolute; inset: -18%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgb(246 199 99 / .45), rgb(240 103 90 / .18) 45%, transparent 70%);
  filter: blur(10px);
}
.app-icon { width: 100%; height: auto; border-radius: 22.5%; box-shadow: 0 30px 60px rgb(0 0 0 / .5), 0 0 0 1px rgb(255 255 255 / .08); transform: rotate(-4deg); }
.gifts { position: absolute; width: 50%; height: auto; inset-inline-end: -6%; bottom: -2%; filter: drop-shadow(0 16px 24px rgb(0 0 0 / .45)); }

/* gold sparkles from the icon, floating in the sky */
.sparkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.spark { position: absolute; color: var(--accent); opacity: .55; }
.spark svg { width: 100%; height: 100%; }
.s1 { width: 22px; top: 18%; left: 6%; }
.s2 { width: 14px; top: 34%; left: 44%; opacity: .4; }
.s3 { width: 26px; top: 14%; left: 58%; }
.s4 { width: 12px; top: 58%; left: 52%; opacity: .35; }
.s5 { width: 18px; top: 72%; left: 92%; }
.s6 { width: 10px; top: 26%; left: 88%; opacity: .45; }

/* store buttons */
.store-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.store-btn {
  --btn-bg: #05070f; --btn-fg: #fff;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-width: 172px; height: 58px; padding: 0 18px 0 14px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid rgb(255 255 255 / .2); border-radius: 15px;
  text-decoration: none; line-height: 1.1; white-space: nowrap;
  box-shadow: 0 8px 24px rgb(0 0 0 / .35);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
[dir="rtl"] .store-btn { padding: 0 14px 0 18px; }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .store-top { display: block; font-size: 11px; opacity: .85; letter-spacing: .01em; font-family: -apple-system, "Segoe UI", system-ui, sans-serif; }
.store-btn .store-bottom { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-family: -apple-system, "Segoe UI", system-ui, sans-serif; }
a.store-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(0 0 0 / .45); border-color: rgb(255 255 255 / .35); }
.store-btn.is-soon { cursor: default; opacity: .8; }
.store-btn.is-soon .soon-tag {
  position: absolute; top: -10px; inset-inline-end: 10px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap;
  font-family: var(--font-body);
}

/* sections */
.features, .occasions { padding-block: clamp(48px, 8vw, 88px); }
.features { padding-top: 24px; padding-bottom: 24px; }
.features h2, .occasions h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); text-align: center; }
.section-lead { text-align: center; color: var(--muted); margin-top: -.2em; margin-bottom: 32px; }

.cards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
  position: relative; padding: 26px 24px 24px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(27 46 90 / .85), rgb(20 36 73 / .7));
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 18px 40px rgb(0 0 0 / .25);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgb(246 199 99 / .3); box-shadow: 0 1px 0 rgb(255 255 255 / .06) inset, 0 24px 50px rgb(0 0 0 / .35); }
.card img { width: auto; height: 132px; margin: 0 auto 18px; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .35)); }
.card h3 { font-size: 1.35rem; margin-bottom: .3em; }
.card p { color: #d3d8e6; margin: 0; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tiles li { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 12px 28px rgb(0 0 0 / .3); transition: transform .2s ease; }
.tiles li:hover { transform: translateY(-3px) rotate(-.4deg); }
.tiles img { width: 100%; height: auto; aspect-ratio: 480 / 262; object-fit: cover; }
.tiles span {
  position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; padding: 22px 14px 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(to top, rgb(8 16 40 / .85), transparent);
}

/* legal & support */
.doc .prose { padding-top: clamp(16px, 4vw, 40px); }
.prose h1 { color: var(--text); }
.prose h2 { color: var(--text); }
.prose p, .prose li, .prose td { color: #e4e6ee; }
.prose .meta { color: var(--muted); }
.prose ul, .prose ol { padding-left: 0; padding-inline-start: 1.25em; }
.prose th, .prose td { text-align: start; }
.prose th { color: var(--accent); }
.prose table { border: 1px solid var(--line); border-radius: 16px; background: rgb(20 36 73 / .5); }
.prose details { background: rgb(20 36 73 / .6); }
.prose details[open] { border-color: rgb(246 199 99 / .3); }
.prose summary::marker { color: var(--accent); }
.contact-card { background: linear-gradient(135deg, rgb(240 103 90 / .18), rgb(27 46 90 / .8)); border-color: rgb(240 103 90 / .35); }
.contact-card h2 { margin-top: 0; }
.contact-card p { margin: 0; font-size: 1.08rem; }
.contact-card a { font-weight: 700; }
.not-found { text-align: center; }
.not-found img { margin: 0 auto 12px; width: 200px; height: auto; }

.site-footer .wrap p { margin: 0; }

/* responsive */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 24px 88px; min-height: 0; text-align: center; }
  .hero-copy { max-width: none; justify-self: center; display: flex; flex-direction: column; align-items: center; }
  .lead { margin-inline: auto; }
  .store-buttons { justify-content: center; }
  .hero-art { order: -1; width: 220px; }
  .scene::after { background: linear-gradient(to bottom, rgb(12 24 56 / .7) 0%, rgb(12 24 56 / .45) 40%, rgb(12 24 56 / .75) 80%, var(--bg) 100%); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 420px) {
  .store-buttons { flex-direction: column; align-items: center; gap: 18px; }
  .store-btn { width: 250px; }
  .lang-menu summary span { display: none; }
  .brand span { font-size: 1.05rem; }
}

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hero-copy > :nth-child(5) { animation-delay: .24s; }
  .hero-copy > :nth-child(6) { animation-delay: .3s; }
  .app-icon { animation: bob 7s ease-in-out infinite; }
  .gifts { animation: bob 8s ease-in-out -2s infinite; }
  .spark { animation: twinkle 6s ease-in-out infinite; }
  .s2 { animation-delay: -1s; } .s3 { animation-delay: -2.5s; } .s4 { animation-delay: -3.5s; } .s5 { animation-delay: -4.2s; } .s6 { animation-delay: -5s; }
}
@keyframes rise { from { opacity: .4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -8px; rotate: 1.5deg; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: .55; } 50% { transform: scale(.7) rotate(20deg); opacity: .25; } }
