﻿/* jf open 粉圓 (huninn) — self-hosted for CJK logo + PWA icon */
@font-face {
  font-family: "jf-openhuninn-2.1";
  src: url("../fonts/jf-openhuninn-2.1.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* ============================================================
   Ban Leong Pawnshop: Design System
   Unified tokens + reusable components.
   Offline-safe: system font stack, no external CDN.
   Dark mode via prefers-color-scheme (tokens swap).
   ============================================================ */

:root {
  /* --- Brand palette (refined gold, heritage) --- */
  --gold: #b07d16;
  --gold-strong: #8f6310;
  --gold-deep: #6e4d06;
  --gold-soft: #f7efdd;
  --gold-tint: #fbf6ec;

  /* --- Neutral surface scale (warm-neutral, not beige-slop) --- */
  --paper: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --line: #e7e8ec;
  --line-strong: #d6d8de;

  /* --- Ink (text) --- */
  --ink: #1b1c20;
  --ink-2: #44464e;
  --muted: #5f626b;

  /* --- Semantic --- */
  --success: #1f8a5b;
  --success-soft: #e6f4ed;
  --danger: #c0392b;
  --danger-soft: #fbecea;
  --warn: #b7791f;
  --warn-soft: #fbf0db;
  --info: #2f6fb0;
  --info-soft: #e8f1fa;

  /* --- On-brand dark surfaces --- */
  --ink-bg: #16171b;
  --ink-bg-2: #1f2127;
  --ink-bg-3: #272a31;
  --line-dark: #34373f;
  --muted-dark: #9aa0ab;

  /* --- Radius --- */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* --- Elevation (tinted, no pure black) --- */
  --shadow-xs: 0 1px 2px rgba(20,21,26,.06);
  --shadow-sm: 0 2px 10px rgba(20,21,26,.07);
  --shadow-md: 0 10px 30px rgba(20,21,26,.09);
  --shadow-lg: 0 24px 60px rgba(20,21,26,.12);
  --shadow-gold: 0 16px 40px rgba(176,138,50,.28);

  /* --- Spacing scale --- */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem;

  /* --- Type scale (fluid) --- */
  --step--1: clamp(.82rem, .79rem + .1vw, .88rem);
  --step-0:  clamp(.95rem, .92rem + .15vw, 1.02rem);
  --step-1:  clamp(1.1rem, 1.02rem + .4vw, 1.3rem);
  --step-2:  clamp(1.3rem, 1.15rem + .7vw, 1.65rem);
  --step-3:  clamp(1.6rem, 1.35rem + 1.2vw, 2.1rem);
  --step-4:  clamp(2rem, 1.6rem + 2vw, 2.8rem);
  --step-5:  clamp(2.4rem, 1.8rem + 3vw, 3.5rem);
  --step-6:  clamp(2.8rem, 2rem + 4.2vw, 4.4rem);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --font-cjk: "jf-openhuninn-2.1", "Kaiti", "KaiTi", "STKaiti", "Kaiti SC", "Kaiti TC", var(--font-serif);

  --fw-regular: 400; --fw-semi: 600; --fw-bold: 700; --fw-black: 800;

  --dur-fast: .18s; --dur: .3s; --dur-slow: .5s;
  --ease: cubic-bezier(.16,1,.3,1);

  --header-h: 68px;
  --maxw: 1200px;

  --z-header: 50; --z-drawer: 60; --z-fab: 70; --z-modal: 80;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121317;
    --surface: #1b1d22;
    --surface-2: #202329;
    --line: #3a3026;
    --line-strong: #4a3d2f;
    --ink: #f3ece2;
    --ink-2: #d8cdbe;
    --muted: #a99a86;
    --gold: #e3b53f;
    --gold-strong: #f0c75e;
    --gold-deep: #f7d884;
    --gold-soft: #2a2415;
    --gold-tint: #201913;
    --success-soft: #1c2a20; --danger-soft: #2e1c17; --warn-soft: #2a2113; --info-soft: #1c2530;
    --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
    --shadow-sm: 0 2px 10px rgba(0,0,0,.45);
    --shadow-md: 0 10px 30px rgba(0,0,0,.5);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    --shadow-gold: 0 16px 40px rgba(176,138,50,.32);
  }
}

/* ===================== RESET ===================== */
*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: var(--step-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1,h2,h3,h4 { line-height: 1.12; letter-spacing: -.02em; font-weight: var(--fw-bold); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
/* Anchor offset so #sections aren't hidden under the sticky header */
:target { scroll-margin-top: calc(var(--header-h) + 1rem); }
section[id], [id].section, main [id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ===================== LAYOUT ===================== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }
.bg-soft { background: var(--surface-2); }
.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stack { display: flex; flex-direction: column; }
.flex { display: flex; }
.wrap { flex-wrap: wrap; }
.center { text-align: center; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.5rem; } .mt-6 { margin-top: 2rem; } .mt-7 { margin-top: 3rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.gold-text { color: var(--gold-strong); }

/* ===================== TYPOGRAPHY HELPERS ===================== */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--step--1); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow.lg { font-size: clamp(1.2rem, 1.15rem + .15vw, 1.32rem); letter-spacing: .1em; }
.section-head { max-width: 62ch; margin-inline: auto; }
.section-head .lead { margin-top: 1rem; }
.h1 { font-size: var(--step-6); font-weight: var(--fw-black); }
.h2 { font-size: var(--step-4); }
.h3 { font-size: var(--step-2); }
.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.55; }
.text-sm { font-size: var(--step--1); }
.divider { border: 0; border-top: 1px solid var(--line); width: 100%; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .8rem 1.3rem; border-radius: var(--r-pill);
  font-weight: var(--fw-bold); font-size: var(--step-0); line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: 1rem 1.6rem; font-size: var(--step-1); }
.btn-block { width: 100%; }

.btn-primary { background: var(--gold); color: #2a210a; box-shadow: var(--shadow-gold); }
.btn-primary:hover { background: var(--gold-strong); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-2); }
.btn-soft { background: var(--gold-soft); color: var(--gold-deep); }
.btn-soft:hover { background: color-mix(in srgb, var(--gold-soft) 70%, var(--gold)); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #157047; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ===================== CARDS ===================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur), border-color var(--dur); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.icon-tile {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--r-md); background: var(--gold-soft); color: var(--gold-deep);
  flex: none;
}
.icon-tile svg { width: 24px; height: 24px; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .75rem; border-radius: var(--r-pill);
  font-size: var(--step--1); font-weight: 700; line-height: 1;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.trust { background: var(--success-soft); color: #14663f; border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.badge.neutral { background: var(--surface-2); color: var(--ink-2); }
.badge-lg { font-size: var(--step-1); padding: .6rem 1.1rem; }
@media (prefers-color-scheme: dark) { .badge.trust { color: #5fd79b; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }

/* ===================== ALERTS ===================== */
.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1.1rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); font-size: var(--step-0);
}
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert.success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: #155e3b; }
.alert.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: #992d22; }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: #1f5288; }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: #8a5a14; }
@media (prefers-color-scheme: dark) { .alert.success { color: #7ee0a8; } .alert.error { color: #f0a79c; } .alert.info { color: #8ec3f2; } .alert.warn { color: #e6c178; } }

/* ===================== FORMS ===================== */
.field { display: flex; flex-direction: column; gap: .45rem; }
.field label { font-weight: 600; font-size: var(--step-0); color: var(--ink); }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.input, .select, textarea.input {
  width: 100%; padding: .85rem 1rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent);
}
.input::placeholder { color: var(--muted); }
.field-error { color: var(--danger); font-size: var(--step--1); font-weight: 600; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.input.num { font-variant-numeric: tabular-nums; }

/* ===================== FEATURE / CHECK LIST ===================== */
.feature-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.feature-list li { display: flex; gap: .8rem; align-items: flex-start; padding: .55rem 0; color: var(--ink-2); }
.feature-list li svg { width: 22px; height: 22px; color: var(--success); flex: none; margin-top: 2px; }

.chip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-list li { padding: .45rem .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); font-size: var(--step--1); font-weight: 600; }

/* ===================== REVEAL MOTION ===================== */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.delay-1 { transition-delay: .08s; } .delay-2 { transition-delay: .16s; } .delay-3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===================== SKIP LINK ===================== */
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 200;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm);
  transition: top var(--dur-fast);
}
.skip-link:focus { top: 1rem; }

/* ===================== SR-ONLY ===================== */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
/* ===================== UTILITY (consistency) ===================== */
.mt-1 { margin-top: var(--sp-1); }
.justify-center { justify-content: center; }
.animate-fade-up { animation: fadeUp .7s var(--ease) both; }
.animate-fade-up.delay-2 { animation-delay: .15s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .animate-fade-up { animation: none; } }
/* ===================== PHOTO / MEDIA ===================== */
/* Consistent, non-distorting image frame.
   Use class "photo" + a ratio modifier. The default ratio matches the
   supplied 800x600 store photo (4:3); override per use with .photo-16x9 etc. */
.photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
}
.photo-16x9 { aspect-ratio: 16 / 9; }
.photo-1x1  { aspect-ratio: 1 / 1; }
.photo.r-lg { border-radius: var(--r-lg); }
.photo.r-md { border-radius: var(--r-md); }
.photo.shadow-md { box-shadow: var(--shadow-md); }
.photo-top { object-position: top center; }

/* "Visit us" hero photo: enlarged, dominant beside the text.
   Text ~40%, photo ~60%, with a clean break on mobile. */
.visit-grid {
  grid-template-columns: 2fr 3fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.visit-grid .visit-media { order: 2; }
.visit-grid .visit-copy   { order: 1; }
@media (max-width: 820px) {
  .visit-grid { grid-template-columns: 1fr; }
  .visit-grid .visit-media { order: 1; }
  .visit-grid .visit-copy   { order: 2; }
}

/* "Visit us" branch photos: two labeled shop shots stacked on the right.
   Each photo sits in a figure with a caption so branches are clearly named. */
.visit-photos {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.visit-photos figure {
  margin: 0;
}
.visit-photos .photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
}
.visit-photos figcaption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--muted);
}
.visit-photos figcaption .badge {
  margin: 0;
}


