/* NewYear2027.org — cream paper, deep grape, gold foil. */
:root {
  --cream: #fbf4e8;
  --paper: #fffaf2;
  --plum: #2b1233;
  --plum-2: #44204f;
  --plum-3: #5d2f6b;
  --ink: #2b1233;
  --muted: #6f5a72;
  --line: #ead9c6;
  --gold: #e2a23b;
  --gold-2: #f6cf7a;
  --luck: #7aa83b;
  --love: #d23c55;
  --adventure: #e2a23b;
  --sweet: #e8577a;
  --spark: #b5179e;
  --self: #9b6bd8;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(43, 18, 51, .12);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.6 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--plum-3); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }

/* ---------- header / footer ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.15rem var(--display); color: inherit; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.top nav { display: flex; align-items: center; gap: 18px; font-size: .95rem; }
.top nav a { color: inherit; text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.lang { border: 1px solid currentColor; border-radius: 99px; padding: 2px 10px; font-size: .85rem; opacity: .85; }
.night .top, .night .top a { color: var(--cream); }
.foot { padding: 48px 0 40px; border-top: 1px solid var(--line); margin-top: 0; font-size: .95rem; color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; margin-bottom: 24px; }
.foot-cols b { display: block; color: var(--ink); margin-bottom: 6px; }
.foot-cols a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 99px; padding: 14px 26px; font: 650 1.02rem var(--body); cursor: pointer; text-decoration: none; background: var(--gold); color: var(--plum); box-shadow: 0 4px 0 #b77d1d; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b77d1d; }
.btn.plum { background: var(--plum-3); color: var(--cream); box-shadow: 0 4px 0 var(--plum); }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn.small { padding: 8px 16px; font-size: .92rem; box-shadow: 0 3px 0 #b77d1d; }
.btn.ghost.small { box-shadow: inset 0 0 0 2px currentColor; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
label { display: block; font-weight: 600; margin: 0 0 6px; }
input[type=text], textarea { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font: 1rem var(--body); background: #fff; color: var(--ink); }
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--plum-3); }
textarea { resize: vertical; min-height: 96px; }
.field { margin-bottom: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice label { margin: 0; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; cursor: pointer; font-weight: 500; line-height: 1.35; }
.choice label b { display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--plum-3); box-shadow: 0 0 0 3px rgba(93, 47, 107, .15); }
.choice label:has(input:focus-visible) { outline: 3px solid var(--gold); }
.err { color: #b3261e; font-weight: 600; min-height: 1.4em; margin: 8px 0 0; }

/* ---------- hero (night) ---------- */
.night { background: radial-gradient(1200px 600px at 75% 10%, #5d2f6b 0%, var(--plum) 55%, #1c0b22 100%); color: var(--cream); position: relative; overflow: hidden; }
.night::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 70% 20%, #fff7 50%, transparent 51%), radial-gradient(1.5px 1.5px at 85% 60%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 10% 70%, #fff6 50%, transparent 51%); pointer-events: none; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 32px; align-items: center; padding: 28px 0 64px; position: relative; }
.hero .kicker { display: inline-block; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; color: var(--gold-2); margin-bottom: 14px; }
.hero h1 em { font-style: italic; color: var(--gold-2); }
.hero .lede { font-size: 1.15rem; max-width: 36ch; opacity: .92; }
.hero-art { position: relative; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px 0 10px; }
.trust { font-size: .9rem; opacity: .8; }

/* countdown */
.countdown { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 4px; }
.countdown .unit { min-width: 70px; text-align: center; background: rgba(255, 250, 242, .09); border: 1px solid rgba(246, 207, 122, .35); border-radius: 14px; padding: 8px 10px 6px; }
.countdown .num { display: block; font: 700 1.9rem/1 var(--display); font-variant-numeric: tabular-nums; color: var(--gold-2); }
.countdown .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.countdown-note { font-size: .88rem; opacity: .8; }
.light .countdown .unit { background: #fff; border-color: var(--line); }
.light .countdown .num { color: var(--plum-3); }
.countdown.big .unit { min-width: 92px; padding: 14px 12px 10px; }
.countdown.big .num { font-size: clamp(2.2rem, 7vw, 3.4rem); }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--paper); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; padding: 0; list-style: none; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--plum-3); color: var(--cream); font: 700 1rem var(--display); margin-bottom: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.flavors { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; padding: 0; list-style: none; }
.flavors li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px 6px 8px; font-weight: 600; font-size: .95rem; }
.dot { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .15); }
.dot.luck { background: var(--luck); } .dot.love { background: var(--love); } .dot.adventure { background: var(--adventure); }
.dot.sweet { background: var(--sweet); } .dot.spark { background: var(--spark); } .dot.self { background: var(--self); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile b { display: block; font: 650 1.1rem var(--display); margin-bottom: 4px; }
.table-love { background: linear-gradient(135deg, #fff0f3, #fbe6ff); border: 1px solid #f1c7d6; }
details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 650; }
details[open] summary { margin-bottom: 8px; }
.final { text-align: center; padding: 64px 0; }
.final .btn { margin-top: 8px; }

/* create form */
.create { max-width: 560px; margin: 0 auto; }
.create h2 { text-align: center; }

/* ---------- content pages ---------- */
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: .97rem; background: #fff; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper); }
.table-scroll { overflow-x: auto; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 8px 0 20px; }
.crumbs a { color: inherit; }
.callout { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 12px; padding: 16px 18px; margin: 1.4em 0; }
.page-hero { padding: 18px 0 44px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-hero p { font-size: 1.12rem; opacity: .9; max-width: 60ch; }
.updated { font-size: .9rem; margin-top: 2em; }
.tz-list { columns: 2 240px; padding-left: 0; list-style: none; }
.tz-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; }

/* ---------- grapes ---------- */
.bunch { position: relative; width: min(420px, 100%); margin: 0 auto; }
.bunch .stem { display: block; width: 120px; margin: 0 auto -18px; position: relative; z-index: 1; }
.rows { display: flex; flex-direction: column; align-items: center; gap: 0; }
.row { display: flex; justify-content: center; margin-top: -10px; }
.row:first-child { margin-top: 0; }
.grape { --c: #fff; --size: clamp(64px, 19vw, 92px); width: var(--size); height: var(--size); margin: 0 -2px; border: 0; padding: 0; background: none; cursor: pointer; position: relative; font: inherit; color: inherit; border-radius: 50%; transition: transform .18s; }
.grape:hover:not([disabled]) { transform: translateY(-3px) scale(1.04); }
.grape:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.grape .ball { position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85) 0 7%, transparent 8%), radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000) 100%); box-shadow: inset -6px -8px 14px rgba(0, 0, 0, .18), 0 6px 14px rgba(43, 18, 51, .22); }
.grape.empty .ball { background: rgba(255, 255, 255, .55); border: 2px dashed rgba(93, 47, 107, .45); box-shadow: none; }
.night .grape.empty .ball { background: rgba(255, 250, 242, .08); border-color: rgba(246, 207, 122, .55); }
.grape.sealed { --c: #7d4a8c; }
.grape.luck { --c: var(--luck); } .grape.love { --c: var(--love); } .grape.adventure { --c: var(--adventure); }
.grape.sweet { --c: var(--sweet); } .grape.spark { --c: var(--spark); } .grape.self { --c: var(--self); }
.grape .m { position: absolute; inset: 0; display: grid; place-items: center; font: 700 .82rem/1.1 var(--body); text-transform: uppercase; letter-spacing: .04em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); pointer-events: none; text-align: center; }
.grape.empty .m { color: var(--plum-3); text-shadow: none; }
.night .grape.empty .m { color: var(--gold-2); }
.grape .seal { position: absolute; right: 6%; bottom: 6%; width: 26%; height: 26%; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: .7rem; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); }
.grape.mine .seal { background: #fff; }
.grape.eaten { opacity: .25; transform: scale(.85); }
.grape.now { animation: pulse .7s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.1); filter: drop-shadow(0 0 12px var(--gold-2)); } }
.bunch-art .grape { cursor: default; }

/* bunch page */
.bunch-page { min-height: 100vh; display: flex; flex-direction: column; }
.bunch-page main { flex: 1; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; padding: 12px 0 48px; }
.board h1 { font-size: clamp(2rem, 5vw, 3rem); }
.status { display: inline-flex; gap: 8px; align-items: center; background: rgba(255, 250, 242, .1); border: 1px solid rgba(246, 207, 122, .4); border-radius: 99px; padding: 6px 14px; font-size: .92rem; margin-bottom: 14px; }
.panel { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 18px; }
.panel h2 { font-size: 1.3rem; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row input { flex: 1 1 200px; }
.friends { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.friends li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; font-size: .95rem; }
.friends button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; }
.my-bunches { margin-top: 14px; font-size: .95rem; }
.my-bunches a { color: var(--gold-2); }
.loading { padding: 80px 0; text-align: center; opacity: .8; }

/* dialog */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(520px, 100% - 24px); max-height: calc(100vh - 24px); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(28, 11, 34, .6); }
.dlg { padding: 22px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.dlg-head h2 { font-size: 1.4rem; margin: 0; }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.count { font-size: .85rem; color: var(--muted); text-align: right; margin-top: 4px; }
.ideas { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.ideas button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 10px; font: .85rem var(--body); cursor: pointer; color: var(--ink); }

/* ritual */
.ritual { position: fixed; inset: 0; z-index: 50; background: radial-gradient(900px 600px at 50% 20%, #5d2f6b, #1c0b22 70%); color: var(--cream); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px; text-align: center; overflow-y: auto; }
.ritual[hidden] { display: none; }
.ritual .chime-no { font: 700 clamp(3rem, 14vw, 6rem)/1 var(--display); color: var(--gold-2); }
.ritual .hint { opacity: .85; margin: 6px 0 14px; min-height: 1.5em; }
.ritual .wish { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 16px 18px; max-width: 420px; width: 100%; min-height: 110px; box-shadow: var(--shadow); margin: 14px 0; text-align: left; }
.ritual .wish .who { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.ritual .row { margin-top: -6px; }
.ritual .grape { --size: clamp(48px, 14vw, 72px); }
.result { max-width: 560px; width: 100%; }
.result .type { font: 700 clamp(1.8rem, 6vw, 2.6rem)/1.1 var(--display); color: var(--gold-2); margin: 6px 0 10px; }
.result ol { text-align: left; background: var(--paper); color: var(--ink); border-radius: 18px; padding: 16px 16px 16px 40px; margin: 16px 0; }
.result li { margin-bottom: 10px; }
.result li small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--plum); color: var(--cream); padding: 10px 18px; border-radius: 99px; z-index: 60; font-weight: 600; box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .hero, .two, .board { grid-template-columns: 1fr; }
  .hero { padding-top: 8px; gap: 8px; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
  .steps { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .countdown .unit { min-width: 62px; }
  .countdown.big .unit { min-width: 68px; }
  .top nav { gap: 12px; }
  .hide-xs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
[hidden] { display: none !important; }
.ritual .wish:empty { visibility: hidden; }
.ritual { justify-content: safe center; }
.ritual > * { flex-shrink: 0; }
.hero-img { display: block; width: 100%; height: auto; border-radius: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); border: 6px solid rgba(255, 250, 242, .9); transform: rotate(1.5deg); }
.art-img { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: var(--shadow); }
figure.art { margin: 1.5em auto; max-width: 520px; }
@media (max-width: 860px) { .hero-art { max-width: 380px; } .hero-img { transform: none; } }
