/* ============ Hạt Cải — landing page ============ */
:root {
  --parchment: #F3ECDF;
  --paper: #FBF8F2;
  --ink: #1F1A16;
  --ink-soft: #5E554C;
  --line: #E0D5C2;
  --marian: #22406F;
  --marian-deep: #132744;
  --gold: #A8823A;
  --gold-soft: #EADBB8;
  --wine: #7A1F2B;
  --accent: #5B2A86;          /* đổi theo mùa phụng vụ (app.js) */
  --accent-soft: #EDE4F4;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(31,26,22,.04), 0 18px 40px -22px rgba(31,26,22,.35);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
  --arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100V38A60 60 0 0 1 50 0A60 60 0 0 1 100 38V100Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--parchment); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.serif { font-family: var(--serif); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ''; width: 26px; height: 1.5px; background: currentColor; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(36px, 4.6vw, 58px); }
h3 { font-size: 26px; }
p { margin: 0; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-soft); }

/* layer-line texture — the 3D-print signature */
.layers {
  background-image: repeating-linear-gradient(0deg, rgba(31,26,22,.035) 0 1px, transparent 1px 5px);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--marian-deep); border-color: var(--marian-deep); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- header ---------- */
.topbar {
  background: var(--accent); color: #fff; font-size: 14px; text-align: center; padding: 8px 16px;
  transition: background .6s ease;
}
.topbar strong { font-weight: 600; }
header.site {
  position: sticky; top: 0; z-index: 40; background: rgba(243,236,223,.86);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-name { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1; }
.logo-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.menu { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.menu a { text-decoration: none; color: var(--ink-soft); }
.menu a:hover { color: var(--ink); }
.season-chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 8px; background: var(--paper);
}
.season-chip i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 64px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(46px, 6.4vw, 88px); margin: 18px 0 22px; }
.hero h1 em { font-style: italic; color: var(--accent); transition: color .6s ease; }
.hero .lead { max-width: 33em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: 14px; color: var(--ink-soft); }
.hero-notes span { display: inline-flex; align-items: center; gap: 8px; }
.hero-notes span::before { content: '✝'; color: var(--gold); font-size: 12px; }
.hero-art { position: relative; aspect-ratio: 1 / 1.05; }
.rose { position: absolute; inset: -8% -16% auto auto; width: 116%; opacity: .22; }
.rose svg { width: 100%; height: auto; animation: turn 240s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.hero-lamp { position: absolute; left: 50%; bottom: 0; width: 70%; transform: translateX(-50%); }
.hero-tag {
  position: absolute; right: 2%; bottom: 14%; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.35;
}
.hero-tag b { display: block; font-family: var(--serif); font-size: 22px; }

/* ---------- section scaffolding ---------- */
section { padding: 96px 0; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 48px; }
.sec-head h2 { margin-top: 14px; }
.divider { display: flex; align-items: center; gap: 18px; color: var(--gold); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- collection ---------- */
.collection { background: var(--paper); border-block: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { display: flex; flex-direction: column; }
.card-art {
  position: relative; aspect-ratio: 4 / 4.3; background: var(--parchment);
  -webkit-mask: var(--arch) center / 100% 100% no-repeat; mask: var(--arch) center / 100% 100% no-repeat;
  display: grid; place-items: center; padding: 18% 14% 10%;
}
.card-art.blue { background: #E3E9F2; }
.card-art.wine { background: #F1E2E0; }
.card-art.gold { background: #F2E8D2; }
.card-art.green { background: #E3ECE5; }
.card-art svg { width: 100%; height: 100%; }
.card-body { padding: 20px 4px 0; }
.card-body h3 { margin-bottom: 6px; }
.card-body p { color: var(--ink-soft); font-size: 15.5px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 15px; }
.price { font-weight: 600; }
.price small { font-weight: 400; color: var(--ink-soft); }
.tag {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}

/* ---------- personalizer ---------- */
.studio-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 56px; align-items: start; }
.stage {
  position: sticky; top: 100px; border-radius: 28px; padding: 30px 36px 26px;
  background: radial-gradient(110% 80% at 50% 30%, #4A3826 0%, #2A2018 60%, #1C1510 100%);
  border: 1px solid #3A2D20; color: #E9DCC6; transition: background .5s ease;
}
.stage.dark { background: radial-gradient(110% 80% at 50% 30%, #2E241A 0%, #1C1510 70%); }
.stage-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #CDB894; }
.light-btn { border: 1px solid #6B5638; background: rgba(255,255,255,.06); color: #F3E3C2; border-radius: 999px; padding: 7px 16px; font-size: 14px; cursor: pointer; }
.light-btn:hover { background: rgba(255,255,255,.12); }
.stage svg { width: min(380px, 100%); margin: 0 auto; }
.stage-note { margin-top: 14px; text-align: center; font-size: 13px; color: #BFAF96; }
.form { display: grid; gap: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swatches, .shapes { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch, .shape {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px 7px 8px;
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px;
}
.swatch[aria-pressed="true"], .shape[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch i { width: 22px; height: 22px; border-radius: 50%; display: block; position: relative; overflow: hidden; }
.swatch i::after { content: ''; position: absolute; inset: 50% 0 0 0; background: var(--b); }
.swatch i.glass::after { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ink); }
.shape { padding: 7px 14px; }

/* ---------- parish (B2B) ---------- */
.parish { background: var(--marian-deep); color: #F4EFE6; position: relative; overflow: hidden; }
.parish .eyebrow { color: var(--gold-soft); }
.parish .lead { color: #C9D2E1; }
.parish-glass { position: absolute; right: -180px; top: -120px; width: 620px; opacity: .16; pointer-events: none; }
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.offer { border: 1px solid rgba(234,219,184,.25); border-radius: var(--radius); padding: 26px; background: rgba(255,255,255,.03); }
.offer h3 { color: #fff; margin: 14px 0 8px; }
.offer p { color: #C9D2E1; font-size: 15.5px; }
.offer .num { font-family: var(--serif); font-size: 15px; color: var(--gold-soft); letter-spacing: .1em; }
.offer .price { color: var(--gold-soft); margin-top: 14px; display: block; }
.parish-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 40px; }
.parish .btn { border-color: var(--gold-soft); color: var(--gold-soft); }
.parish .btn-primary { background: var(--gold-soft); color: var(--marian-deep); }

/* ---------- process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.step { padding: 28px 24px 8px 0; border-right: 1px solid var(--line); }
.step + .step { padding-left: 24px; }
.step:last-child { border-right: 0; }
.step .roman { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--accent); transition: color .6s ease; }
.step h3 { font-size: 23px; margin: 14px 0 8px; }
.step p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- promises ---------- */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.promise { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.promise svg { width: 34px; height: 34px; color: var(--gold); margin-bottom: 14px; }
.promise h3 { font-size: 22px; margin-bottom: 6px; }
.promise p { color: var(--ink-soft); font-size: 15.5px; }

/* ---------- faq ---------- */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; font-weight: 600; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--serif); font-size: 28px; line-height: .8; color: var(--accent); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 12px; color: var(--ink-soft); }

/* ---------- order ---------- */
.order { background: var(--paper); border-top: 1px solid var(--line); }
.order-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.countdown { display: flex; align-items: baseline; gap: 12px; margin-top: 26px; }
.countdown b { font-family: var(--serif); font-size: 64px; line-height: 1; color: var(--accent); }
.order-card { background: var(--parchment); border: 1px solid var(--line); border-radius: 24px; padding: 30px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.notice { font-size: 14px; color: var(--ink-soft); background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; transition: transform .3s ease, visibility .3s; z-index: 60; visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- footer ---------- */
footer { background: var(--ink); color: #CFC6BA; padding: 64px 0 40px; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
footer .logo-name { color: #fff; }
footer h4 { color: #fff; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 14px; }
footer a { text-decoration: none; }
footer a:hover { color: #fff; }
.motto { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--gold-soft); margin-top: 18px; }
.foot-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid #3A322B; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .studio-grid, .order-grid, .sec-head { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .hero-art { max-width: 520px; margin: 0 auto; width: 100%; }
  .cards, .offers, .promises { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(3) { padding-left: 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  section { padding: 72px 0; }
  .menu { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start;
          gap: 18px; padding: 22px 20px 26px; background: var(--parchment); border-bottom: 1px solid var(--line); }
  .menu.open { display: flex; }
  .menu-toggle { display: block; }
  .cards, .offers, .promises, .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 24px 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .row2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-tag { display: none; }
  .stage { padding: 24px 18px; }
  .order-card { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rose svg { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- chibi collection & 3D studio ---------- */
.hero-fig { position: absolute; bottom: 2%; width: 46%; filter: drop-shadow(0 24px 28px rgba(31,26,22,.25)); }
.hero-fig-a { left: 6%; z-index: 2; }
.hero-fig-b { right: 4%; bottom: 6%; width: 43%; z-index: 1; }
.card-art img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(31,26,22,.18)); }
.card-art.duo { display: flex; align-items: flex-end; justify-content: center; gap: 0; padding: 20% 6% 8%; }
.card-art.duo img { width: 50%; }
.card-art.duo img + img { margin-left: -6%; }
.card-art.glow { background: radial-gradient(60% 50% at 50% 82%, #FFE2A6 0%, #F6D79A 30%, #2E2419 75%); }
.card-art.glow img { filter: drop-shadow(0 0 18px rgba(255,210,130,.75)); max-height: 92%; }
a.tag { text-decoration: none; }
a.tag:hover { filter: brightness(.95); }
.canvas3d { position: relative; width: 100%; aspect-ratio: 4 / 4.6; border-radius: 18px; overflow: hidden; cursor: grab;
  background: radial-gradient(90% 70% at 50% 35%, #FFFDF8 0%, #EFE6D6 100%); transition: background .5s ease; }
.canvas3d:active { cursor: grabbing; }
.canvas3d canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.stage.night .canvas3d { background: radial-gradient(80% 60% at 50% 70%, #4A3826 0%, #241B14 60%, #17110C 100%); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: #8C7A66; pointer-events: none; }
@media (max-width: 760px) {
  .hero-fig { width: 50%; }
}
.opt-rows { display: grid; gap: 10px; }
.opt-row { display: grid; gap: 6px; }
.opt-sub { font-size: 13px; color: var(--ink-soft); }
.swatch i[style] { border: 1px solid rgba(0,0,0,.15); }
.swatch i[style]::after { display: none; }
.card-art:not(.duo):not(.glow) img { max-height: 88%; align-self: flex-end; }
.card-art { overflow: hidden; }
.card-art.glow img { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); height: 84%; width: auto; max-height: none; max-width: none; }
/* màn hình hẹp: khung 3D dính trên đầu khi cuộn qua các lựa chọn, để thấy mẫu đổi ngay */
@media (max-width: 980px) {
  .stage { position: sticky; top: 73px; z-index: 5; padding: 12px 14px; border-radius: 20px; box-shadow: 0 10px 24px rgba(31,26,22,.18); }
  .stage .stage-note { display: none; }
  .stage .canvas3d { aspect-ratio: auto; height: min(40vh, 380px); }
  .stage-bar { font-size: 12px; }
  .stage-bar .light-btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
  .stage-bar > span:first-child { letter-spacing: .06em; font-size: 11px; }
}
.card-art img, img.hero-fig { height: auto; }
