/* EVENTS365 — one idea: every event starts as a page torn off a 365-day calendar.
   The date "leaf" is the signature; everything else stays quiet. */

@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #F4F2F7;
  --card: #FFFFFF;
  --ink: #19142B;
  --muted: #625C78;
  --line: #E0DCEA;
  --accent: #D81F5A;
  --accent-deep: #A9133F;
  --sun: #FFB627;
  --ok: #0F7A56;   --ok-bg: #E2F5EC;
  --warn: #9A5200; --warn-bg: #FFF1D6;
  --bad: #B3261E;  --bad-bg: #FDE7E5;
  --display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --r: 14px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.75rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.spread { justify-content: space-between; }
.section { padding: 32px 0 56px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Demo strip + header */
.demo { background: var(--ink); color: #fff; font-size: 0.8125rem; text-align: center; padding: 7px 16px; }
.demo b { color: var(--sun); font-weight: 700; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.logo span { background: var(--accent); color: #fff; padding: 1px 7px 2px; border-radius: 6px; letter-spacing: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { font: 600 0.9375rem var(--body); color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--paper); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav form { margin: 0; }

/* Buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1rem var(--body); padding: 13px 22px; border-radius: 999px; border: 2px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { font-weight: 600; font-size: 0.9375rem; display: block; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: 400 1rem var(--body); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 48px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(25, 20, 43, .12); }
.field { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.hint { font-size: 0.8125rem; color: var(--muted); margin-top: 6px; }
.error { color: var(--bad); font-size: 0.875rem; font-weight: 600; margin-top: 6px; }
.alert { border-radius: var(--r); padding: 14px 16px; font-weight: 600; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* The calendar leaf */
.leaf { width: 62px; flex: none; background: #fff; color: var(--ink); border-radius: 10px; overflow: hidden; text-align: center; box-shadow: 0 6px 18px rgba(25, 20, 43, .22); font-family: var(--display); line-height: 1; }
.leaf b { display: block; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 5px 0 4px; }
.leaf i { display: block; font-style: normal; font-weight: 800; font-size: 1.75rem; letter-spacing: -0.03em; padding: 5px 0 1px; }
.leaf u { display: block; text-decoration: none; font-family: var(--body); font-size: 0.625rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
.leaf.big { width: 84px; }
.leaf.big i { font-size: 2.5rem; }

/* Hero */
.hero { background: var(--ink); color: #fff; padding: 40px 0 44px; position: relative; overflow: hidden; }
.hero::after { content: "365"; position: absolute; right: -0.06em; bottom: -0.3em; font: 800 clamp(9rem, 30vw, 21rem)/1 var(--display); letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .13); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 em { font-style: normal; color: var(--sun); }
.hero p { color: #CFCADF; max-width: 46ch; margin-top: 14px; font-size: 1.0625rem; }
.search { display: flex; gap: 8px; margin-top: 24px; max-width: 520px; }
.search input { border-color: transparent; }
.search .btn { flex: none; padding-inline: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 6px; margin: 0 -20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-weight: 600; font-size: 0.9375rem; text-decoration: none; padding: 9px 16px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); }
.chip:hover { border-color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Event cards */
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.event { background: var(--card); border-radius: var(--r); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; border: 1px solid var(--line); transition: transform .18s, box-shadow .18s; }
.event:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(25, 20, 43, .12); }
.poster { --h: 335; position: relative; background:
    radial-gradient(120% 90% at 100% 0%, hsl(calc(var(--h) + 45) 90% 62% / .9), transparent 60%),
    linear-gradient(140deg, hsl(var(--h) 78% 44%), hsl(calc(var(--h) - 28) 70% 22%));
  color: #fff; padding: 16px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 20px; }
.poster .tag { font-size: 0.6875rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: rgba(0, 0, 0, .28); padding: 5px 10px; border-radius: 999px; }
.event .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.price { font-family: var(--display); font-weight: 800; font-size: 1.125rem; }
.price small { font: 600 0.75rem var(--body); color: var(--muted); margin-right: 4px; }
.empty { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--r); padding: 36px 20px; text-align: center; }

/* Event page */
.event-head { --h: 335; background:
    radial-gradient(90% 120% at 100% 0%, hsl(calc(var(--h) + 45) 90% 62% / .85), transparent 60%),
    linear-gradient(140deg, hsl(var(--h) 78% 44%), hsl(calc(var(--h) - 28) 70% 20%));
  color: #fff; padding: 32px 0 36px; }
.event-head .row { align-items: flex-start; flex-wrap: nowrap; gap: 18px; }
.event-head .meta { margin-top: 10px; color: rgba(255, 255, 255, .9); font-weight: 500; }
.back { display: inline-block; font-weight: 600; font-size: 0.875rem; text-decoration: none; margin-bottom: 18px; color: rgba(255, 255, 255, .9); }
.back:hover { text-decoration: underline; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.sticky { position: sticky; top: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.tier { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tier:first-of-type { padding-top: 0; }
.tier .name { font-weight: 700; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 42px; height: 42px; border: 0; background: none; font: 700 1.25rem var(--body); cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--paper); }
.stepper input { width: 40px; min-height: 42px; border: 0; padding: 0; text-align: center; font-weight: 700; border-radius: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper input:focus { box-shadow: none; }
.pay { display: grid; gap: 8px; }
.pay label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.pay label:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.pay input { accent-color: var(--accent); width: 18px; height: 18px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-weight: 800; font-size: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font: 800 1.05rem var(--display); padding: 0; margin-bottom: 12px; }

/* Ticket */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ticket { --h: 335; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 28px rgba(25, 20, 43, .12); display: flex; flex-direction: column; }
.ticket .t-top { background: linear-gradient(140deg, hsl(var(--h) 78% 44%), hsl(calc(var(--h) - 28) 70% 22%)); color: #fff; padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.ticket .t-top h3 { font-size: 1.2rem; }
.ticket .t-top p { font-size: 0.875rem; color: rgba(255, 255, 255, .9); margin-top: 4px; }
.ticket .t-cut { position: relative; height: 22px; background: var(--card); }
.ticket .t-cut::before, .ticket .t-cut::after { content: ""; position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); }
.ticket .t-cut::before { left: -11px; } .ticket .t-cut::after { right: -11px; }
.ticket .t-cut span { position: absolute; left: 22px; right: 22px; top: 10px; border-top: 2px dashed var(--line); }
.ticket .t-body { padding: 4px 18px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ticket .qr { width: 200px; max-width: 100%; }
.ticket .qr svg { display: block; width: 100%; height: auto; }
.code { font-family: var(--mono); font-weight: 700; letter-spacing: .06em; font-size: 1rem; }
.ticket .t-row { display: flex; justify-content: space-between; width: 100%; gap: 12px; font-size: 0.875rem; text-align: left; }
.ticket .t-row b { display: block; font-size: 0.6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Verify */
.verdict { border-radius: 20px; padding: 28px 22px; text-align: center; color: #fff; }
.verdict.ok { background: var(--ok); } .verdict.warn { background: var(--warn); } .verdict.bad { background: var(--bad); }
.verdict h1 { font-size: clamp(2rem, 9vw, 3rem); }
.verdict p { margin-top: 8px; font-weight: 600; opacity: .95; }
.narrow { max-width: 520px; }

/* Organiser */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.kpi dt { font-size: 0.75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi dd { margin: 6px 0 0; font: 800 clamp(1.5rem, 5vw, 2rem)/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi.lead { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.lead dt { color: #BDB7D2; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(15, 122, 86, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(15, 122, 86, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 122, 86, 0); } }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th { text-align: left; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px 0; white-space: nowrap; }
td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; padding-right: 0; }
td a { font-weight: 700; }
.bar { height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; padding-top: 0; }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.typerow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

.foot-bar { border-top: 1px solid var(--line); padding: 22px 0; font-size: 0.875rem; color: var(--muted); }

@media (max-width: 860px) {
  .two, .dash { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 480px) {
  .search { flex-direction: column; }
  .typerow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .typerow > :first-child { grid-column: 1 / -1; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .demo, .top, .foot-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .ticket { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
}
