/* Version C — "Medlemskortet". A private club's wallet: each service is an embossed leather card. */
:root {
  /* Semantic */
  --ground: #14110f;            /* night leather */
  --ground-2: #1c1815;
  --rule: #352d26;
  --foil: #d6b274;              /* gold foil, marks and the primary action */
  --ink: #efe8dc;               /* card cream */
  --muted: #b7aa95;
  --go: #7fcf96;
  --stop: #e07a6a;
  --serif: 'Bodoni Moda', 'Didot', serif;
  --ui: 'Albert Sans', system-ui, sans-serif;

  /* Leathers */
  --cognac: #5a3219;   --cognac-deep: #2c170a;
  --oxblood: #5b1d22;  --oxblood-deep: #2a0b0e;
  --tobacco: #3a2f27;  --tobacco-deep: #171210;
  --green: #22402f;    --green-deep: #0e1d15;

  /* Grain: authored noise, blended over each leather */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --tabs-h: 4rem;
  --bar-h: 3.5rem;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 1.25rem;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html {
  background: var(--ground); color: var(--ink);
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none; scrollbar-color: var(--rule) transparent;
}
body { font: 400 1rem/1.55 var(--ui); }
::selection { background: var(--foil); color: var(--ground); }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--foil); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.3rem; height: 1.3rem; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a, button, [role="button"], summary { touch-action: manipulation; }
.tabs a, .book, .pill, .brand, .pager, .card, summary { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.print { font: 600 0.6875rem/1 var(--ui); letter-spacing: 0.2em; text-transform: uppercase; }

/* App shell */
.app {
  position: relative; height: 100dvh; max-width: 480px; margin-inline: auto;
  background: var(--ground); overflow: hidden; container-type: inline-size;
  display: grid; grid-template-rows: calc(var(--bar-h) + var(--safe-t)) 1fr;
}
@media (min-width: 560px) {
  body {
    display: grid; place-items: center;
    background: var(--grain) 0 0 / 220px, radial-gradient(120% 80% at 50% 0%, #241d18, #0c0a09 70%);
  }
  .app { height: min(100dvh - 3rem, 900px); width: 430px; border-radius: 34px; box-shadow: 0 0 0 1px #2e2721, 0 40px 90px -30px rgb(0 0 0 / 0.95); }
}

.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: var(--safe-t) var(--gutter) 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font: 500 1.125rem/1 var(--serif); letter-spacing: 0.01em; }
.brand .mark { width: 2rem; height: auto; color: var(--foil); }
.pill { margin: 0; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.8rem; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--rule); font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.pill [data-status-label] { color: var(--ink); }
.dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--stop); }
.pill.is-open .dot { background: var(--go); }

/* Views */
.views { position: relative; min-height: 0; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.scroller {
  height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 0.75rem var(--gutter) calc(var(--tabs-h) + var(--safe-b) + 6.5rem);
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }

.title { margin: 0.5rem 0 0.35rem; font: 400 clamp(2.25rem, 9vw, 2.75rem)/1 var(--serif); letter-spacing: -0.01em; }
.lede { margin: 0 0 1.25rem; color: var(--muted); max-width: 32ch; }
.h { margin: 2.75rem 0 1rem; font: 400 1.625rem/1.1 var(--serif); }

/* ---- Wallet ---- */
.wallet {
  margin-inline: calc(var(--gutter) * -1); padding: 0.5rem 12cqi 1.25rem;
  display: grid; grid-auto-flow: column; grid-auto-columns: 76cqi; gap: 0.6rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain; scrollbar-width: none; outline-offset: -4px;
}
.wallet::-webkit-scrollbar { display: none; }

/* The card: leather lit from top left (leather.svg is a lit height map), a thread stitch, a stamped monogram */
.card {
  --a: var(--cognac); --b: var(--cognac-deep);
  position: relative; isolation: isolate; overflow: hidden;
  scroll-snap-align: center; scroll-snap-stop: always;
  min-height: clamp(23rem, 56dvh, 29rem);
  display: flex; flex-direction: column; padding: 1.5rem 1.45rem 1.35rem;
  border-radius: 20px; color: var(--ink);
  background: url(leather.svg) 0 0 / 300px, radial-gradient(140% 95% at 18% 0%, var(--a), var(--b) 78%);
  background-blend-mode: soft-light, normal;
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--b) 55%, #000), inset 0 2px 0 rgb(255 255 255 / 0.07), inset 0 -3px 0 rgb(0 0 0 / 0.3),
    0 1px 0 rgb(0 0 0 / 0.6), 0 3px 0 -1px color-mix(in srgb, var(--b) 70%, #000),
    0 26px 40px -18px rgb(0 0 0 / 0.85);
  transform-origin: center;
}
.card[data-leather="oxblood"] { --a: var(--oxblood); --b: var(--oxblood-deep); background-position: 137px 61px, 0 0; }
.card[data-leather="tobacco"] { --a: var(--tobacco); --b: var(--tobacco-deep); background-position: 52px 203px, 0 0; }
.card[data-leather="green"] { --a: var(--green); --b: var(--green-deep); background-position: 241px 148px, 0 0; }

/* Saddle stitch: a pressed groove, needle holes, and short waxed stitches seated in it.
   Geometry is set as attributes from main.js so WebKit draws it. */
.stitch { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); overflow: visible; pointer-events: none; z-index: 0; }
.stitch rect, .stitch path { fill: none; }
.stitch .groove { stroke: rgb(0 0 0 / 0.42); stroke-width: 4.5; filter: drop-shadow(0.8px 1.2px 0 rgb(255 255 255 / 0.1)); }
.stitch .holes { stroke: rgb(0 0 0 / 0.75); stroke-width: 1.9; stroke-linecap: round; }
.stitch .thread {
  stroke: color-mix(in srgb, var(--foil) 72%, var(--b)); stroke-width: 2.1; stroke-linecap: round;
  filter: drop-shadow(0.5px 1px 0 rgb(0 0 0 / 0.6));
}
.card > :not(.stitch) { position: relative; z-index: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: color-mix(in srgb, var(--ink) 78%, var(--a)); }

/* Monogram, pressed into the empty upper half; the press filter (in the SVG) seats it under the same light as the grain */
.monogram { width: 44%; height: auto; margin: auto auto 0; overflow: visible; }
.stamp text { stroke: none; }
/* Open: foil, a broad metal ramp whose highlight travels as the card turns (--foil is that card's gradient) */
.app.is-open .stamp { fill: var(--foil); stroke: var(--foil); }
/* Closed: blind press. Same stamp, no foil: the leather itself, a quarter darker */
.app:not(.is-open) .stamp { fill: color-mix(in srgb, var(--a) 72%, #000); stroke: color-mix(in srgb, var(--a) 72%, #000); }

.name { margin: auto 0 0.5rem; font: 400 clamp(2.05rem, 9vw, 2.6rem)/0.98 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
.line { margin: 0 0 1.3rem; color: color-mix(in srgb, var(--ink) 84%, var(--a)); max-width: 28ch; font-size: 0.9375rem; line-height: 1.45; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1.75rem; padding-top: 0.9rem; border-top: 1px solid rgb(214 178 116 / 0.3); }
.facts div { display: grid; gap: 0.35rem; }
.facts dt { font: 600 0.6875rem/1 var(--ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--foil); }
.facts dd { margin: 0; font: 400 1.5rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.valid { margin: 1rem 0 0; display: grid; gap: 0.2rem; font-size: 0.75rem; line-height: 1.35; color: color-mix(in srgb, var(--ink) 78%, var(--a)); }
.valid .live { margin-top: 0.35rem; color: var(--ink); font-weight: 600; }
.app:not(.is-open) .facts dt { color: color-mix(in srgb, var(--ink) 66%, var(--a)); }

.pager { display: flex; justify-content: center; gap: 0.3rem; margin-top: -0.25rem; }
.pager button {
  appearance: none; border: 0; padding: 0; background: none; cursor: pointer;
  width: 2rem; height: 1.75rem; display: grid; place-items: center;
}
.pager button::after { content: ''; width: 1.1rem; height: 2px; border-radius: 2px; background: var(--rule); transition: background-color 200ms ease, width 260ms var(--ease-out); }
.pager button[aria-current="true"]::after { width: 1.6rem; background: var(--foil); }

/* Visit */
.visit { list-style: none; margin: 0; padding: 0; }
.visit li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.95rem 0; border-top: 1px solid var(--rule); }
.visit li:last-child { border-bottom: 1px solid var(--rule); }
.visit span { font: italic 400 1.25rem/1.2 var(--serif); color: var(--foil); }
.visit p { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* Reviews */
.rating { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0 0 1.25rem; color: var(--muted); }
.rating .icon { color: var(--foil); width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; }
.rating strong { color: var(--ink); font-weight: 600; }
.quotes { list-style: none; margin: 0; padding: 0; }
.quotes li { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.quotes blockquote { margin: 0; font: italic 400 1.5rem/1.25 var(--serif); }
.quotes blockquote::before { content: '”'; color: var(--foil); margin-right: 0.15em; }
.quotes p { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--muted); }

/* ---- Register ---- */
.register { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.register li { display: grid; grid-template-columns: 3.75rem 1fr auto; align-items: center; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.register li:last-child { border-bottom: 1px solid var(--rule); }
.face { width: 3.75rem; height: 3.75rem; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgb(214 178 116 / 0.4), 0 0 0 4px var(--ground), 0 0 0 5px var(--rule); }
.face-initial { display: grid; place-items: center; font: 400 1.75rem/1 var(--serif); color: var(--foil); background: url(leather.svg) 0 0 / 360px, radial-gradient(circle at 30% 20%, var(--tobacco), var(--tobacco-deep)); background-blend-mode: overlay, normal; }
.who h3 { margin: 0; font: 400 1.5rem/1.1 var(--serif); }
.who p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.875rem; }
.score { margin: 0; display: grid; justify-items: end; gap: 0.1rem; font: 400 1.25rem/1 var(--serif); font-variant-numeric: lining-nums; }
.score span { font: 400 0.75rem/1.2 var(--ui); color: var(--muted); }

/* ---- Reels ---- */
.reels { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { margin: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; background: var(--ground); }
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; }
.reel::after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgb(12 10 9 / 0.85)); pointer-events: none; }
.reel figcaption { position: absolute; z-index: 1; left: var(--gutter); bottom: calc(var(--tabs-h) + var(--safe-b) + 6.25rem); font: italic 400 2rem/1 var(--serif); }

/* ---- Back of the card ---- */
.card-back { background-position: 88px 19px, 0 0; min-height: 0; padding: 0 0 1.35rem; margin-top: 0.75rem; --a: var(--tobacco); --b: var(--tobacco-deep); }
.stripe { height: 3.25rem; margin-top: 1.5rem; background: linear-gradient(#4a3f36, #2a231e 45%, #3b322b 100%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), inset 0 -1px 0 rgb(0 0 0 / 0.5); }
.panel { margin: 1.1rem 1.45rem 0.4rem; }
/* Signature panel: plain card cream with the name as microprint, like the back of a real card */
.sign {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 0.9rem 1rem; border-radius: 4px;
  text-decoration: none; color: #2a2119;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='118' height='9'%3E%3Ctext x='0' y='7' font-family='Arial' font-size='6' letter-spacing='.6' fill='%23e0d5c0'%3EBR%C3%96DERNA NAHI %C2%B7 %3C/text%3E%3C/svg%3E") 0 0 / 118px 9px, #eee5d4;
  transition: transform var(--dur-press) var(--ease-out);
}
.sign strong { display: block; font: 400 1.375rem/1.1 var(--serif); }
.sign > span:first-child > span { font-size: 0.875rem; }
.sign .go { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.sign .go .icon { width: 1rem; height: 1rem; }
.sign:active { transform: scale(0.98); }
.hours { width: calc(100% - 2.9rem); margin: 0.75rem 1.45rem 0; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.hours th, .hours td { padding: 0.6rem 0; border-bottom: 1px solid rgb(214 178 116 / 0.2); font-weight: 400; text-align: left; }
.hours td { text-align: right; font: 400 1.125rem/1 var(--serif); }
.hours tr[data-closed] td, .hours tr[data-closed] th { color: color-mix(in srgb, var(--ink) 66%, var(--a)); }
.hours tr.today th, .hours tr.today td { color: var(--foil); }
.hours .print { margin-left: 0.5rem; font-size: 0.6875rem; }
.back-contact { list-style: none; margin: 0.9rem 1.45rem 0; padding: 0; display: grid; gap: 0; }
.back-contact a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.9rem; border-bottom: 1px solid rgb(214 178 116 / 0.2); text-decoration: none; font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.back-contact .print { font-size: 0.6875rem; color: var(--foil); }
.back-print { margin: 1.1rem 1.45rem 0; font: 600 0.625rem/1 var(--ui); letter-spacing: 0.2em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 66%, var(--a)); }
/* Arriving at Hitta hit turns the card over */
.card-back .stitch { z-index: 2; }
#hitta.is-entering .card-back { animation: turnOver 520ms var(--ease-out) both; }
@keyframes turnOver { from { transform: perspective(1100px) rotateY(-75deg); opacity: 0.2; } }

.lines { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.lines a { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 0.8rem; min-height: 3.5rem; border-top: 1px solid var(--rule); text-decoration: none; transition: background-color var(--dur-press) ease; }
.lines li:last-child a { border-bottom: 1px solid var(--rule); }
.lines .icon { color: var(--foil); }
.lines .val { text-align: right; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lines a:active { background: var(--ground-2); }

.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 3.5rem; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--foil); transition: transform var(--dur-ui) var(--ease-out); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq p { margin: 0 0 1.1rem; color: var(--muted); max-width: 60ch; }
.fine { margin: 2.25rem 0 0; color: var(--muted); font-size: 0.8125rem; }

/* ---- Primary action ---- */
/* Content fades out under the action instead of showing through behind it */
.views::after {
  content: ''; position: absolute; z-index: 4; inset: auto 0 0; pointer-events: none;
  height: calc(var(--tabs-h) + var(--safe-b) + 6rem);
  background: linear-gradient(transparent, var(--ground) 42%);
}
.app[data-view="klipp"] .views::after { display: none; }
.book {
  position: absolute; z-index: 5; left: var(--gutter); right: var(--gutter); bottom: calc(var(--tabs-h) + var(--safe-b) + 0.75rem);
  display: grid; place-items: center; align-content: center; gap: 0.1rem; min-height: 3.75rem; border-radius: 16px;
  background: linear-gradient(100deg, #b8955c, #d6b274 30%, #ecd4a4 48%, #d6b274 66%, #b08c55); color: #1d1610; text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 245 220 / 0.45), inset 0 -1px 0 rgb(0 0 0 / 0.25), 0 14px 26px -12px rgb(0 0 0 / 0.9);
  transition: transform var(--dur-press) var(--ease-out), filter var(--dur-press) ease;
}
.book span { font-weight: 600; font-size: 1.0625rem; line-height: 1.1; }
.book small { font-size: 0.75rem; color: #2e2316; }
.book:active { transform: scale(0.97); filter: brightness(1.06); }

.tabs {
  position: absolute; z-index: 6; inset: auto 0 0; height: calc(var(--tabs-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--ground); box-shadow: 0 -1px 0 var(--rule);
}
.tabs a { display: grid; place-items: center; align-content: center; gap: 0.2rem; text-decoration: none; color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; transition: color var(--dur-press) ease; }
.tabs .icon { transition: transform var(--dur-press) var(--ease-out); }
.tabs a:active .icon { transform: scale(0.88); }
.tabs a[aria-current="page"] { color: var(--foil); }

@media (hover: hover) and (pointer: fine) {
  .tabs a:hover { color: var(--ink); }
  .lines a:hover { background: var(--ground-2); }
  .book:hover { filter: brightness(1.06); }
  .sign:hover .go { text-decoration: underline; text-underline-offset: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  #hitta.is-entering .card-back { animation: none; }
}
