/*
  Snow Spoiled Gifts - Nord Glass design tokens
  Locked theme (2026-08-22/24) - permanently dark, ignores system light/dark preference.
  Every page/component must style itself from these tokens. If something isn't covered
  here, ask before inventing a new color/font/style - do not improvise (CLAUDE.md).
*/

:root {
  /* Nord base palette */
  --nord0: #2E3440;
  --nord1: #3B4252;
  --nord2: #434C5E;
  --nord3: #4C566A;
  --nord4: #D8DEE9;
  --nord6: #ECEFF4;

  /* Accents */
  --frost: #88C0D0;
  --green: #A3BE8C;
  --yellow: #EBCB8B;
  --red: #BF616A;
  --purple: #B48EAD;

  /* Blue-grey background wash (brand blue, added 2026-08-24) */
  --blue-wash: #1F4670;
  --blue-wash-deep: #1C2430;

  /* Glass primitive */
  --glass-bg: rgba(64, 83,110, 0.50);
  --glass-bg-strong: rgba(64, 83,110, 0.68);
  --glass-border: rgba(236, 239,244, 0.10);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.38);
  --glass-blur: 12px;
  --radius: 12px;

  /* Type */
  --font-display: 'Sora', sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

/* Site is permanently dark by design (never light mode) - tells the browser
   to render NATIVE controls (select dropdown popups, scrollbars, date
   pickers, etc.) with dark-appropriate defaults instead of a stark white
   popup our own CSS can't fully reach. */
:root { color-scheme: dark; }

select {
  color-scheme: dark;
}
select option {
  background: var(--nord0);
  color: var(--nord6);
}

body {
  background: linear-gradient(165deg, var(--blue-wash) 0%, var(--nord0) 45%, var(--blue-wash-deep) 100%);
  color: var(--nord6);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* ---------------- glass surface ---------------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

.accent-left {
  border-left-width: 4px;
  border-left-style: solid;
}

/* accent color utilities - use for category/status, per the left-border language */
.accent-frost  { border-left-color: var(--frost); }
.accent-green  { border-left-color: var(--green); }
.accent-yellow { border-left-color: var(--yellow); }
.accent-red    { border-left-color: var(--red); }
.accent-purple { border-left-color: var(--purple); }

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 11px 20px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  min-width: 0; /* let flex items shrink below their own content width instead of overflowing the row */
}
.btn-compact {
  padding: 8px 6px;
  font-size: 0.8rem;
  gap: 0;
}
.btn-primary {
  background: var(--frost);
  color: var(--nord0);
}
.btn-google {
  background: #131314;
  color: #e3e3e3;
  border-color: #8e918f;
}
.btn-google:hover {
  border-color: #a9aca9;
}
.btn-secondary {
  background: rgba(236, 239, 244, 0.06);
  color: var(--nord6);
  border-color: var(--glass-border);
}

/* ---------------- badges (status/category pills) ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-frost  { background: rgba(136, 192, 208, 0.16); color: var(--frost); }
.badge-green  { background: rgba(163, 190, 140, 0.16); color: var(--green); }
.badge-yellow { background: rgba(235, 203, 139, 0.16); color: var(--yellow); }
.badge-red    { background: rgba(191, 97, 106, 0.16);  color: var(--red); }
.badge-purple { background: rgba(180, 142, 173, 0.16); color: var(--purple); }

/* ---------------- tables ---------------- */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-body);
  font-size: 0.87rem;
}
table.data th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--nord4); /* nord3 reads as unreadable against this background - never use it for text */
  padding: 14px 14px 10px;
  font-weight: 700;
}
table.data td {
  padding: 13px 14px;
  color: var(--nord6);
  border-top: 1px solid rgba(236, 239, 244, 0.06);
}
table.data td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------------- headings ---------------- */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 600; margin: 0; }

/* ---------------- item thumbnails (real photo, or a placeholder tile) ---------------- */
.item-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--glass-border);
  background: linear-gradient(150deg, rgba(136,192,208,0.35), rgba(46,52,64,0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nord6);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* quantity count overlaid on the thumbnail, instead of a third element crowding
   the button row - red + white ring like .cart-badge, so it stays readable over
   any photo instead of blending in the way the old frost-blue version could */
.item-qty-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 20px;
  height: 20px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  border-radius: 999px;
  border: 2px solid var(--nord0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

/* cart item count - the standard red notification-badge convention, deliberately
   not using the theme's usual palette so it stands out the way a cart count should */
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.item-thumb-sm {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  background: linear-gradient(150deg, rgba(136,192,208,0.35), rgba(46,52,64,0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nord6);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
}
.item-thumb-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* size-proportional variants - lets the box preview visually read as S/M/L, not just a text label */
.item-thumb-sm.size-S { width: 30px; height: 30px; font-size: 0.62rem; }
.item-thumb-sm.size-M { width: 44px; height: 44px; font-size: 0.86rem; }
.item-thumb-sm.size-L { width: 60px; height: 60px; font-size: 1.1rem; }

/* base items get a distinct frame in the box preview - locked/included, not something the customer chose */
.item-thumb-sm.is-base { border: 2px solid var(--purple); }

/* click-to-enlarge lightbox */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox-overlay img {
  max-width: min(90vw, 480px); max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ---------------- box preview + item-drop animation ---------------- */
.box-preview {
  position: relative;
  width: fit-content;   /* hugs its actual content horizontally - a flex/block box otherwise
                            fills its full parent width regardless of how little is inside it */
  max-width: 100%;       /* still wraps onto new rows instead of overflowing once it's genuinely full */
  min-width: 30px;
  min-height: 30px;
  border: 2px solid var(--frost);
  border-radius: 10px;
  background: rgba(136,192,208,0.06);
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-end;
  gap: 8px;
  transition: border-color 0.3s ease;
}
.box-preview.is-full {
  border-color: var(--green);
}
.box-preview::before {
  content: "";
  position: absolute;
  top: -14px; left: -6px; right: -6px; height: 14px;
  border-radius: 8px 8px 0 0;
  background: rgba(136,192,208,0.14);
  border: 2px solid var(--frost);
  border-bottom: none;
}
@media (prefers-reduced-motion: no-preference) {
  .box-item-enter { animation: box-item-drop 0.35s ease-out; }
  .box-item-leave { animation: box-item-pop-out 0.2s ease-in forwards; }
}
@keyframes box-item-drop {
  0%   { transform: translateY(-24px) scale(0.7); opacity: 0; }
  60%  { transform: translateY(2px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes box-item-pop-out {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0; }
}

/* one-shot attention pop for the "Box is full" label, triggered by JS only on
   the moment capacity is reached - not on every render while already full */
@media (prefers-reduced-motion: no-preference) {
  .capacity-pop { animation: capacity-full-pop 0.5s ease; }
}
@keyframes capacity-full-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.25); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ---------------- decorative, LOOPING box-fill animation for the Gift Boxes
   entry card - separate from box-item-enter/leave above, which are one-shot
   and drive the real builder's actual add/remove, not a repeating demo ----
   Each .mini-box sets --box-cycle (duration) and --box-color (accent) inline,
   so the same rules drive several boxes side by side with different timing
   and color without duplicating CSS. */
.card-box-item { opacity: 1; } /* static fallback so reduced-motion users still see the items */
@media (prefers-reduced-motion: no-preference) {
  .card-box-item {
    animation: card-box-cycle var(--box-cycle, 3.2s) ease-in-out infinite;
  }
  .card-box-item:nth-child(1) { animation-delay: 0s; }
  .card-box-item:nth-child(2) { animation-delay: .15s; }
  .card-box-item:nth-child(3) { animation-delay: .3s; }
  .card-box-item:nth-child(4) { animation-delay: .45s; }
}
@keyframes card-box-cycle {
  0%   { transform: translateY(-18px) scale(0.7); opacity: 0; }
  15%  { transform: translateY(0) scale(1); opacity: 1; }
  80%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-4px) scale(0.85); opacity: 0; }
}

.mini-box {
  position: relative;
}
.mini-box-outline {
  position: absolute;
  bottom: 0;
  left: 0;
  border: 2px solid var(--box-color, var(--frost));
  border-radius: 8px;
  background: color-mix(in srgb, var(--box-color, var(--frost)) 8%, transparent);
  width: 100%;
  height: 100%;
}
.mini-box-items {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
/* the lid: a flap that swings shut over the box opening once the items have
   dropped in, then lifts back open as the loop resets for the next cycle */
.mini-box-lid {
  position: absolute;
  top: -3px;
  left: -2px;
  right: -2px;
  height: 8px;
  border: 2px solid var(--box-color, var(--frost));
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--box-color, var(--frost)) 22%, var(--nord0));
  transform-origin: left center;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .mini-box-lid { animation: mini-box-lid-cycle var(--box-cycle, 3.2s) ease-in-out infinite; }
}
@keyframes mini-box-lid-cycle {
  0%, 18%   { transform: translateY(-8px) rotate(-10deg); opacity: 0; }
  32%, 76%  { transform: translateY(0) rotate(0deg); opacity: 1; }
  92%, 100% { transform: translateY(-8px) rotate(-10deg); opacity: 0; }
}

/* ---------------- decorative loops for the 3D Printing & Custom card and its
   three sub-cards - same lightweight approach as .mini-box: small, subtle,
   looping, respects prefers-reduced-motion. ---- */

/* mini 3D printer - layers build up while the nozzle sweeps overhead */
.mini-printer { position: relative; width: 84px; height: 52px; }
.mini-printer-bed {
  position: absolute;
  bottom: 2px; left: 6px;
  width: 50px; height: 3px;
  border-radius: 2px;
  background: var(--yellow);
  opacity: 0.5;
}
.mini-printer-layers {
  position: absolute;
  bottom: 5px; left: 16px;
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}
.printer-layer {
  width: 36px; height: 6px;
  border-radius: 2px;
  background: rgba(235,203,139,0.4);
  border: 1px solid var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
}
.mini-printer-nozzle {
  position: absolute;
  top: 2px; left: 16px;
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--yellow);
  box-shadow: 0 0 5px rgba(235,203,139,0.6);
}
@media (prefers-reduced-motion: no-preference) {
  .printer-layer { animation: printer-layer-cycle 3.4s ease-in-out infinite; }
  .printer-layer:nth-child(1) { animation-delay: 0s; }
  .printer-layer:nth-child(2) { animation-delay: .32s; }
  .printer-layer:nth-child(3) { animation-delay: .64s; }
  .mini-printer-nozzle { animation: printer-nozzle-sweep 0.9s ease-in-out infinite; }
}
@keyframes printer-layer-cycle {
  0%, 8%    { transform: scaleX(0); opacity: 0; }
  22%, 75%  { transform: scaleX(1); opacity: 1; }
  90%, 100% { transform: scaleX(0); opacity: 0; }
}
@keyframes printer-nozzle-sweep {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(28px); }
}

/* cake topper - the actual product: a name/message on two prongs, typed out
   letter by letter and held, then reset - echoes the "preview it live" pitch */
.mini-topper-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mini-topper-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--yellow);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.mini-topper-stick {
  display: flex;
  gap: 12px;
}
.mini-topper-stick::before,
.mini-topper-stick::after {
  content: "";
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--yellow);
  opacity: 0.6;
}
@media (prefers-reduced-motion: no-preference) {
  .mini-topper-text { animation: mini-topper-type 3.6s steps(11, end) infinite; }
}
@keyframes mini-topper-type {
  0%        { clip-path: inset(0 100% 0 0); }
  35%       { clip-path: inset(0 0 0 0); }
  85%       { clip-path: inset(0 0 0 0); }
  95%, 100% { clip-path: inset(0 100% 0 0); }
}

/* cookie cutter - stamps down onto the dough strip, which squashes on impact */
.mini-dough {
  position: absolute;
  bottom: 4px; left: 6px;
  width: 46px; height: 8px;
  border-radius: 4px;
  background: rgba(136,192,208,0.18);
  border: 1px solid var(--frost);
  transform-origin: center;
}
.mini-cutter {
  position: absolute;
  left: 14px; top: 0;
  font-size: 1.2rem;
}
@media (prefers-reduced-motion: no-preference) {
  .mini-cutter { animation: mini-cutter-stamp 2.4s ease-in-out infinite; }
  .mini-dough { animation: mini-dough-squash 2.4s ease-in-out infinite; }
}
@keyframes mini-cutter-stamp {
  0%, 20%  { transform: translateY(0); }
  38%, 50% { transform: translateY(18px); }
  68%, 100% { transform: translateY(0); }
}
@keyframes mini-dough-squash {
  0%, 34%   { transform: scaleX(1); }
  40%, 50%  { transform: scaleX(1.14); }
  60%, 100% { transform: scaleX(1); }
}

/* custom design request - a twinkling sparkle, suggesting "something new/made up" */
.mini-sparkle {
  display: inline-flex;
  font-size: 1.3rem;
}
@media (prefers-reduced-motion: no-preference) {
  .mini-sparkle { animation: mini-sparkle-twinkle 2.2s ease-in-out infinite; }
}
@keyframes mini-sparkle-twinkle {
  0%, 100% { transform: scale(0.85) rotate(-8deg); opacity: 0.55; }
  50%      { transform: scale(1.15) rotate(8deg); opacity: 1; }
}

/* ---------------- homepage entry cards ----------------
   .home-entry-link wraps each of the two top-level entry cards (Gift Boxes / 3D
   Printing & Custom). The grid uses align-items:start (see index.html) so each
   card's HEIGHT sizes to its own content - Gift Boxes doesn't stretch/grow when
   3D Printing's collapsible sub-options open. flex:1 here only fills the grid
   column's WIDTH (the flex main axis) - it doesn't re-introduce height
   stretching, since align-items:start already caps the row at content height. */
.home-entry-link {
  display: flex;
  text-decoration: none;
}
.home-entry-link .glass {
  flex: 1;
}

.card-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--yellow);
  cursor: pointer;
}
.card-toggle-chevron { transition: transform 0.25s ease; }
.card-toggle-btn[aria-expanded="true"] .card-toggle-chevron { transform: rotate(180deg); }

.card-sub-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.card-sub-options.is-open { max-height: 600px; }
.card-sub-options-inner {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sub-option-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------------- bottom nav (mobile PWA) ---------------- */
.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 6px 8px;
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--nord4); /* nord3 is too low-contrast against this background for actual readable labels */
  font-size: 0.64rem;
  font-family: var(--font-body);
  font-weight: 600;
  flex: 1;
  position: relative;
  text-decoration: none;
}
.bottom-nav .nav-item svg { width: 20px; height: 20px; stroke: var(--nord4); fill: none; stroke-width: 1.7; }
.bottom-nav .nav-item.active { color: var(--frost); }
.bottom-nav .nav-item.active svg { stroke: var(--frost); }
.bottom-nav .nav-item.active::before {
  content: "";
  position: absolute;
  top: -9px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--frost);
  box-shadow: 0 0 6px var(--frost);
}

/* ---------------- desktop header ---------------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
}
.top-links {
  display: flex;
  gap: 26px;
  font-size: 0.88rem;
  color: var(--nord4);
  align-items: center;
}
.top-links a {
  text-decoration: none;
  color: var(--nord4);
  transition: color 0.15s ease;
}
.top-links a:hover { color: var(--nord6); }
.top-links a.active { color: var(--frost); font-weight: 600; }
@media (min-width: 860px) {
  .bottom-nav { display: none; }
}
@media (max-width: 859px) {
  header.site-header nav.top-links { display: none; }
  body { padding-bottom: 84px; } /* room for the fixed bottom nav */
}
