/* Kenangan — shared host styles. Ivory, ink and gold. Mobile first. */
:root {
  --paper: #f7f2ea;
  --paper-2: #efe7da;
  --card: #fffdf9;
  --ink: #1b1815;
  --ink-2: #4f463d;
  --ink-3: #8a7f73;
  --line: #e3d8c6;
  --accent: #9c7a3c;      /* deep gold: readable on ivory and under white text */
  --accent-ink: #fff;
  --accent-2: #d2b07a;    /* light gold */
  --gold-3: #f1e3c2;
  --ok: #2f7a4c;
  --danger: #b3321c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.03), 0 14px 34px -18px rgba(60, 40, 10, 0.3);
  --font: 'Jost', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.4em; letter-spacing: -0.005em; font-family: var(--serif); }
h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); font-weight: 500; }
h2 { font-size: 1.65rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }

/* --- top bar --- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1080px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.5rem/1 var(--serif); letter-spacing: 0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(210, 176, 122, 0.35) inset; }
.brand-mark svg { width: 23px; height: 23px; }
.topbar nav { display: flex; gap: 8px; align-items: center; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(27, 24, 21, 0.28);
  background: var(--card); color: var(--ink); font-weight: 500; letter-spacing: 0.02em; text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--gold-3); box-shadow: 0 0 0 1px rgba(210, 176, 122, 0.55) inset; }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(232, 205, 150, 0.95) inset; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* --- cards & forms --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

label.field { display: block; }
.field > span { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.field > small { display: block; color: var(--ink-3); margin-top: 6px; font-size: 0.82rem; }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; outline: none; font-size: 16px; /* 16px stops iOS zoom */
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 146, 79, 0.2); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--paper-2); color: var(--ink-2); font-size: 0.85rem; white-space: nowrap; }
.input-prefix > .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--mono); text-transform: uppercase; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.switch input { width: 46px; height: 28px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background 0.15s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.5em; }

/* --- pills / badges --- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.pill.ok { background: #dff1e3; color: var(--ok); }
.pill.warn { background: #fff0c7; color: #8a5a00; }
.pill.hot { background: #f4e6c9; color: #7a5a22; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- toast --- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 1000; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind='error'] { background: var(--danger); color: #fff; }

/* --- landing --- */
.hero { padding: 32px 0 48px; display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.1fr 0.9fr; padding: 64px 0; } }
.hero .eyebrow { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); font-weight: 700; }
.hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.camera-illus { width: min(360px, 90%); margin: 0 auto; filter: drop-shadow(0 30px 40px rgba(60, 30, 0, 0.25)); transform: rotate(-6deg); }
.steps { display: grid; gap: 16px; padding: 24px 0 64px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step .num { font-family: var(--mono); font-weight: 700; color: var(--accent); }
footer.site { padding: 32px 16px 48px; text-align: center; color: var(--ink-3); font-size: 0.85rem; }

/* --- dashboard --- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 16px 0 24px; }
.event-list { display: grid; gap: 16px; }
@media (min-width: 640px) { .event-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.event-card { display: block; text-decoration: none; overflow: hidden; padding: 0; transition: transform 0.15s ease; }
.event-card:hover { transform: translateY(-2px); }
.event-card .cover { aspect-ratio: 16 / 9; background: var(--ink) center / cover no-repeat; position: relative; }
.event-card .cover .pill { position: absolute; top: 12px; left: 12px; }
.event-card .body { padding: 16px 18px 18px; }
.event-card .meta { display: flex; gap: 14px; color: var(--ink-2); font-size: 0.88rem; }
.empty { text-align: center; padding: 48px 20px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-2); }

/* --- event manage page --- */
.manage { display: grid; gap: 20px; padding-bottom: 64px; grid-template-columns: minmax(0, 1fr); }
.manage > * { min-width: 0; }
@media (min-width: 900px) { .manage { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } .manage aside { position: sticky; top: 16px; } }
.qr-box { background: #fff; border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--line); }
.qr-box { max-width: 320px; margin: 0 auto; width: 100%; }
.qr-box img { width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.link-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--paper-2); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.85rem; overflow: hidden; }
.link-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat b { display: block; font-size: 2.1rem; font-family: var(--serif); font-weight: 600; line-height: 1.1; }
.stat span { color: var(--ink-2); font-size: 0.85rem; }
table.simple { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.simple th, table.simple td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
table.simple th { color: var(--ink-3); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bar { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.cover-hero { border-radius: var(--radius); aspect-ratio: 21 / 9; background: var(--ink) center / cover no-repeat; margin-bottom: 16px; }

/* --- photo grid & lightbox --- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
@media (min-width: 1000px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo-grid .ph { position: relative; aspect-ratio: 3 / 4; background: var(--paper-2); border-radius: 6px; overflow: hidden; cursor: zoom-in; border: 0; padding: 0; }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph .by { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 0.72rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-grid .ph .del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-grid .ph .del svg { width: 16px; height: 16px; }

.lightbox { position: fixed; inset: 0; background: #0b0907; z-index: 900; display: flex; flex-direction: column; color: #fff; }
.lightbox .lb-top, .lightbox .lb-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.lightbox .lb-top { padding-top: calc(12px + env(safe-area-inset-top)); }
.lightbox .lb-bottom { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.lightbox .lb-stage { flex: 1; display: grid; place-items: center; min-height: 0; position: relative; touch-action: pan-y; }
.lightbox .lb-stage img { position: absolute; inset: 0; margin: auto; max-width: calc(100% - 16px); max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox .icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.lightbox .icon-btn svg { width: 20px; height: 20px; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .nav.prev { left: 12px; } .lightbox .nav.next { right: 12px; }
@media (max-width: 640px) { .lightbox .nav { display: none; } }

/* --- developing (pre-reveal) --- */
.developing { text-align: center; padding: 40px 20px; }
.developing .canister { width: 120px; margin: 0 auto 20px; animation: wobble 3s ease-in-out infinite; }
.countdown { font-family: var(--serif); font-size: clamp(2rem, 8vw, 2.9rem); font-weight: 600; letter-spacing: -0.02em; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.dialog-backdrop { position: fixed; inset: 0; background: rgba(20, 15, 10, 0.5); display: grid; place-items: center; padding: 16px; z-index: 950; }
.dialog { width: 100%; max-width: 440px; }
