/* Xardas first-look tour viewer. Vanilla CSS, no build step, no network calls.
 * ONE file for every product tour: the source is ~/xardas-site/tools/tour-kit/tour.css,
 * copied into each tour-site by tools/tour-kit/sync.sh. Edit it there, not in the copies.
 * The product colour comes from <html data-product="...">. */

@font-face { font-family: 'Cinzel'; src: url('assets/fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'SC Gothic'; src: url('assets/fonts/sc-gothic-regular.woff2') format('woff2'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'SC Gothic'; src: url('assets/fonts/sc-gothic-bold.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }
@font-face { font-family: 'SC Mono'; src: url('assets/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #14151c;            /* night slate */
  --surface: #1a1b24;
  --panel: #232532;
  --raised: #2e3142;
  --border: #363a4e;
  --text: #f2eff8;
  --text-2: #c3c0d2;
  --muted: #8f8ca3;
  --accent: #b82a26;        /* blood red: fills and rules */
  --accent-text: #f0625a;
  --accent-ink: #fff3ec;
  --ember: #c9922e;         /* ember gold: numerals and small marks */
  --ember-hi: #e7b04a;
  --ink: #14161a;
  --pc: var(--accent);      /* the product colour */
  --ch: 18px;
  --topbar-h: 66px;
  --controls-h: 70px;
  --font: 'Century Gothic', CenturyGothic, 'SC Gothic', 'URW Gothic', 'Avant Garde', system-ui, sans-serif;
  --font-display: 'Cinzel', 'Trajan Pro', 'SC Gothic', serif;
  --font-mono: 'SC Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-product="milkware"] { --pc: #5cb8f5; }
:root[data-product="ferrystone"] { --pc: #4fd08a; }
:root[data-product="oculory"] { --pc: #35cfd2; }
:root[data-product="conclave"] { --pc: #b99af7; }

/* The stair: every plate is cut by two steps at the top right and the bottom left. */
*, *::before, *::after {
  box-sizing: border-box;
  --s: calc(var(--ch) * 0.5);
  --chamfer: polygon(0 0, calc(100% - 2 * var(--s)) 0, calc(100% - 2 * var(--s)) var(--s), calc(100% - var(--s)) var(--s), calc(100% - var(--s)) calc(2 * var(--s)), 100% calc(2 * var(--s)), 100% 100%, calc(2 * var(--s)) 100%, calc(2 * var(--s)) calc(100% - var(--s)), var(--s) calc(100% - var(--s)), var(--s) calc(100% - 2 * var(--s)), 0 calc(100% - 2 * var(--s)));
}
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) 28px 0;
  background: var(--bg); color: var(--text);
  border-bottom: 2px solid var(--accent);
}
/* The measuring rule under the bar, as on xardas.tech. */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 7px; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--ember) 0 1px, transparent 1px 60px);
  opacity: .8;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand-mark { width: 30px; height: 30px; display: block; flex: none; --ch: 7px; clip-path: var(--chamfer); }
.brand-name { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-by { color: var(--muted); font-size: 14px; margin: 0 2px; }
.brand-maker { display: inline-flex; align-items: center; }
.brand-maker img { width: 28px; height: 28px; display: block; transform: translateY(-3.7px); margin-right: -1.3px; }
.brand-maker span { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: 0.16em; }
.chapters { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: auto; align-self: stretch; }
.chapters::-webkit-scrollbar { display: none; }
.chapters button {
  flex: none; border: 0; background: transparent; color: var(--text-2);
  padding: 8px 14px; cursor: pointer; font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
}
.chapters button:hover { color: var(--text); background: var(--surface); }
.chapters button[aria-current="true"] { color: var(--text); background: var(--panel); box-shadow: inset 0 -4px 0 var(--pc); }

/* ---------------------------------------------------------------- buttons */
.btn {
  border: 0; cursor: pointer; padding: 12px 22px; font-weight: 700; font-size: 15px; line-height: 1.2;
  --ch: 11px; clip-path: var(--chamfer); transition: background .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--text); color: var(--bg); }
.btn-ghost { background: var(--raised); color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }
.btn:disabled { opacity: 0.35; cursor: default; background: var(--raised); color: var(--text); }
.btn-lg { padding: 17px 30px; font-size: 18px; }
/* The plates are clipped, so the focus ring is drawn inside them. */
.btn:focus-visible, .chapters button:focus-visible, .chapter-card:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--ember-hi); }
.hotspot:focus-visible, .notes li:focus-visible, .brand:focus-visible, .contact a:focus-visible { outline: 3px solid var(--ember-hi); outline-offset: 2px; }

main { flex: 1; display: flex; min-height: 0; }
.screen { flex: 1; min-width: 0; padding: 28px; }
.eyebrow {
  margin: 0 0 10px; color: var(--pc); font-family: var(--font-display); font-weight: 700;
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow::before { content: "\2726"; margin-right: 10px; color: var(--ember); font-family: var(--font); }

/* ---------------------------------------------------------------- intro */
.intro { position: relative; display: flex; flex-direction: column; align-items: center; gap: 30px; padding-top: 6vh; padding-bottom: 44px; overflow: hidden; }
.intro::before {
  content: ""; position: absolute; width: 640px; height: 640px; right: -190px; top: -130px; pointer-events: none;
  background: url(assets/sigil.svg) center / contain no-repeat; opacity: .7;
  animation: turn 140s linear infinite;
}
@keyframes turn { to { transform: rotate(360deg); } }
.intro > * { position: relative; }
.intro-hero {
  width: 100%; max-width: 1180px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: 56px; align-items: start;
  justify-items: start; text-align: left;
}
.intro-hero .eyebrow { grid-column: 1 / -1; background: var(--panel); border-left: 4px solid var(--pc); color: var(--text); padding: 9px 18px 8px 16px; margin-bottom: 22px; }
.intro-hero .eyebrow::before { content: none; }
.intro h1 { grid-column: 1; grid-row: 2 / span 3; font-size: clamp(34px, 5vw, 66px); line-height: 1.03; margin: 0; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
.intro-hero .lead { grid-column: 2; margin: 6px 0 26px; }
.intro-hero .btn { grid-column: 2; }
.intro-hero .hint { grid-column: 2; }
.lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--text-2); margin: 0 0 26px; }
.hint { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.runes {
  width: 100%; max-width: 1180px; height: 22px; margin-top: 10px; opacity: .5;
  background: url(assets/runes.svg) left center / auto 100% no-repeat;
}
.chapter-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; width: 100%; max-width: 1180px; counter-reset: ch; }
.chapter-card {
  text-align: left; border: 0; background: var(--panel); color: var(--text); padding: 0; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; counter-increment: ch; --ch: 22px; clip-path: var(--chamfer);
  border-top: 4px solid var(--pc); transition: background .15s;
}
.chapter-card:hover { background: var(--raised); }
.chapter-card .thumb { display: block; aspect-ratio: 16 / 10; background: var(--ink) center top / cover no-repeat; }
.chapter-card .thumb.phone { background-size: 46% auto; background-position: center 18px; }
.chapter-card .body { display: block; padding: 16px 20px 20px; }
.chapter-card h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.15; letter-spacing: -0.015em; display: flex; align-items: baseline; gap: 12px; }
.chapter-card h3::before { content: counter(ch, decimal-leading-zero); font-family: var(--font-display); font-size: 17px; color: var(--ember); letter-spacing: 0.08em; }
.chapter-card p { margin: 0; color: var(--text-2); font-size: 15px; }
.chapter-card .count { display: inline-block; margin-top: 12px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--pc); }

/* ---------------------------------------------------------------- step */
.step {
  display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 28px; align-items: start;
  padding: 26px 28px 22px;
}
.stage { display: flex; justify-content: center; min-width: 0; }
/* tour.js sizes .shot so the screenshot fits the space left on screen. */
.frame { position: relative; max-width: 100%; }
.shot { position: relative; width: 100%; aspect-ratio: var(--ar, 1.6); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* window (office) and browser (portal) frames: a dark mount with the stair cut.
   The padding equals one step, so the cut never touches the screenshot. */
.frame.window, .frame.browser { background: var(--panel); padding: 12px; --ch: 24px; clip-path: var(--chamfer); }
.frame-bar { display: none; }
.frame.window .frame-bar, .frame.browser .frame-bar {
  display: flex; align-items: center; gap: 12px; height: 30px; padding: 0 30px 8px 2px;
}
.dots { display: flex; gap: 6px; }
.dots i { width: 9px; height: 9px; background: var(--border); display: block; }
.dots i:first-child { background: var(--accent); }
.dots i:nth-child(2) { background: var(--ember); }
.dots i:last-child { background: var(--pc); }
.frame-label { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame.browser .frame-label { background: var(--bg); padding: 2px 12px; min-width: 40%; }

/* phone (driver) frame */
.frame.phone { padding: 12px; background: #0c0d12; border: 1px solid var(--border); border-radius: 44px; box-shadow: 0 18px 44px rgba(0,0,0,.45); }
.frame.phone .shot { border-radius: 32px; overflow: hidden; }
.frame.phone .shot img { border-radius: 32px; }

/* document (invoice PDF) frame */
.frame.document { background: #fff; box-shadow: 0 0 0 1px var(--border), 0 18px 44px rgba(0,0,0,.45); }

/* ---------------------------------------------------------------- hotspots */
.hotspots { position: absolute; inset: 0; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; padding: 0;
  background: var(--accent); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 24px;
  cursor: pointer; z-index: 3; box-shadow: 0 2px 8px rgba(11,12,18,.5);
}
.hotspot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--accent); animation: pulse 2s ease-out infinite; pointer-events: none;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hotspot::after { animation: none; opacity: 0; } .intro::before { animation: none; } .btn { transition: none; } }
.hotspot.active { background: var(--bg); color: var(--ember-hi); border-color: var(--ember-hi); }
.hotspot.active::after { animation: none; opacity: 0; }
.target {
  position: absolute; border: 2px solid var(--accent); z-index: 2;
  background: rgba(184, 42, 38, .09); pointer-events: none; opacity: 0; transition: opacity .15s;
}
.target.show { opacity: 1; }
.tip {
  position: absolute; z-index: 4; width: 270px; max-width: 70%;
  background: var(--bg); color: var(--text); border-left: 4px solid var(--ember); padding: 11px 14px 12px;
  font-size: 14px; line-height: 1.4; box-shadow: 0 10px 28px rgba(0,0,0,.5); pointer-events: none;
}
.tip b { color: var(--ember-hi); margin-right: 8px; font-family: var(--font-display); }

/* ---------------------------------------------------------------- side panel */
.panel {
  background: var(--panel); border-top: 4px solid var(--pc); padding: 22px 22px 12px;
  position: sticky; top: calc(var(--topbar-h) + 26px); --ch: 22px; clip-path: var(--chamfer);
}
.panel h2 { margin: 0 0 10px; font-size: 27px; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.caption { margin: 0 0 16px; color: var(--text-2); }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li {
  display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: baseline;
  padding: 10px 10px 10px 8px; margin: 0 -10px 0 -8px; cursor: pointer; font-size: 15px;
  border-left: 3px solid transparent; color: var(--text-2);
}
.notes li:hover, .notes li.active { background: var(--raised); color: var(--text); border-left-color: var(--ember); }
.notes .num { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ember); letter-spacing: 0.04em; }
.notes .num::before { content: "0"; }
.notes li.active .num { color: var(--ember-hi); }

/* ---------------------------------------------------------------- outro */
.outro { display: flex; justify-content: center; align-items: flex-start; padding-top: 8vh; }
.outro-card { width: 100%; max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); column-gap: 56px; align-items: start; justify-items: start; text-align: left; }
.outro-card .eyebrow, .outro h1, .outro-card .lead { grid-column: 1; }
.outro h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -0.03em; text-wrap: balance; }
.contact { grid-column: 2; grid-row: 1 / span 3; width: 100%; background: var(--panel); border-left: 4px solid var(--ember); padding: 24px 28px; --ch: 22px; clip-path: var(--chamfer); }
.outro-card > .btn { grid-column: 1; }
.contact p { margin: 0; }
.contact .who { margin-bottom: 16px; font-size: 20px; line-height: 1.3; }
.contact .who span { color: var(--text-2); font-size: 15px; }
.contact .line { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.contact .k { width: 64px; color: var(--ember); font-family: var(--font-display); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.contact .v { font-weight: 700; font-size: 16px; user-select: all; overflow-wrap: anywhere; }
.contact .mini { color: var(--accent-text); font-size: 14px; font-weight: 700; }
.contact .mini:hover { color: var(--text); }

/* ---------------------------------------------------------------- controls */
.controls {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  min-height: var(--controls-h); padding: 12px 28px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(20, 21, 28, .95); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
}
.progress { flex: 1; display: flex; align-items: center; gap: 16px; max-width: 680px; }
.progress-text { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); white-space: nowrap; min-width: 118px; }
.progress-track { flex: 1; height: 6px; background: var(--raised); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: var(--pc); transition: width .25s ease; }

.compare-slot { min-height: 40vh; }
.noscript { padding: 24px; text-align: center; }

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1100px) {
  .step { grid-template-columns: 1fr; }
  .panel { position: static; }
}
@media (max-width: 900px) {
  .intro-hero, .outro-card { grid-template-columns: 1fr; }
  .intro h1, .intro-hero .lead, .intro-hero .btn, .intro-hero .hint, .contact, .outro-card > .btn { grid-column: 1; grid-row: auto; }
  .intro h1 { margin-bottom: 16px; }
  .contact { margin-bottom: 24px; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 54px; --controls-h: 62px; }
  .topbar { flex-wrap: wrap; gap: 0 12px; padding: env(safe-area-inset-top, 0px) 16px 0; }
  .brand { min-height: var(--topbar-h); gap: 8px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-name { font-size: 19px; }
  .brand-maker img { width: 24px; height: 24px; transform: translateY(-3.2px); }
  .brand-maker span { font-size: 15px; }
  .chapters { margin-left: 0; width: 100%; align-self: auto; }
  .chapters button { padding: 8px 10px 10px; font-size: 13px; }
  .screen { padding: 16px; }
  .step { padding: 20px 16px 14px; gap: 16px; }
  .chapter-cards { grid-template-columns: 1fr; }
  .intro { padding-top: 28px; gap: 24px; }
  .intro::before { width: 420px; height: 420px; right: -200px; top: -120px; }
  .runes { height: 16px; }
  .btn-lg { padding: 15px 24px; font-size: 17px; }
  /* Phones: the screenshot is scaled to fit, the numbers stay on it, and the
     explanations are the list below instead of tooltips over the picture. */
  .frame.window, .frame.browser { padding: 8px; --ch: 16px; }
  .frame.window .frame-bar, .frame.browser .frame-bar { height: 24px; padding: 0 20px 6px 2px; }
  .frame.phone { padding: 8px; border-radius: 30px; }
  .frame.phone .shot, .frame.phone .shot img { border-radius: 24px; }
  .hotspot { width: 20px; height: 20px; font-size: 11px; line-height: 16px; border-width: 2px; }
  .hotspot::after { animation-duration: 2.6s; }
  .tip { display: none; }
  .panel { padding: 16px 16px 6px; }
  .panel h2 { font-size: 22px; }
  .outro { padding-top: 24px; }
  .contact { padding: 18px 18px; }
  .controls { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .controls .btn { padding: 10px 14px; }
  .progress-text { min-width: 0; font-size: 12px; }
}
