/* Copyright (c) 2026 Emirhan Balcıoğlu. All rights reserved. */
/* SPDX-License-Identifier: LicenseRef-Bosi-Proprietary */
/*
 * Colour values are copied from packages/tokens/customer.tokens.css (the customer design language).
 * Without a saved choice the page follows prefers-color-scheme; theme.js writes data-theme when the
 * visitor picks one, and that attribute wins over the media query. The dark values appear twice
 * because CSS cannot share one block between a selector and a media query. When the visual world is
 * closed (DESIGN §17) the values change in the tokens file first and are copied here again.
 */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f0f2f4;
  --surface: #fafbfc;
  --surface-2: #e2e5e9;
  --border: #d5d8dd;
  --text: #16191d;
  --text-muted: #596069;
  --text-subtle: #7b838e;
  --on-color: #fafbfc;
  --primary: #135fc3;
  --primary-ink: #125cbe;
  --primary-soft: color-mix(in srgb, #135fc3 14%, transparent);
  --warning: #f9c424;
  --warning-soft: color-mix(in srgb, #f9c424 22%, transparent);
  --warning-ink: #7e6004;
  --success-ink: #1a6f3e;
  --focus-ring: #c65906;

  /* The stage is a lit scene in the brand blue, the same in both themes; the objects on it (paper,
     printer, status panels) keep their own light colours because they are things, not page. */
  --stage-top: #3b86e8;
  --stage-mid: #135fc3;
  --stage-low: #0b3a7a;
  --object: #fafbfc;
  --object-ink: #16191d;
  --object-muted: #596069;
  --object-rule: #c9cdd3;

  --radius-small: 8px;
  --radius-control: 12px;
  --radius-container: 18px;
  --gutter: clamp(16px, 5vw, 48px);
  --measure: 1180px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0c0d0e;
  --surface: #161718;
  --surface-2: #1f2123;
  --border: #2e3033;
  --text: #f1f2f3;
  --text-muted: #989da4;
  --text-subtle: #6c727a;
  --primary: #1569d5;
  --primary-ink: #478fed;
  --primary-soft: color-mix(in srgb, #1772e8 18%, transparent);
  --warning-soft: color-mix(in srgb, #facc42 18%, transparent);
  --warning-ink: #facc42;
  --success-ink: #29ae60;
  --focus-ring: #fbbd41;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0c0d0e;
    --surface: #161718;
    --surface-2: #1f2123;
    --border: #2e3033;
    --text: #f1f2f3;
    --text-muted: #989da4;
    --text-subtle: #6c727a;
    --primary: #1569d5;
    --primary-ink: #478fed;
    --primary-soft: color-mix(in srgb, #1772e8 18%, transparent);
    --warning-soft: color-mix(in srgb, #facc42 18%, transparent);
    --warning-ink: #facc42;
    --success-ink: #29ae60;
    --focus-ring: #fbbd41;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-small);
}

.sprite {
  display: none;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout ------------------------------------------------------------------------------------- */

.masthead,
main > section,
.colophon {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead {
  padding-block: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-block;
  border-radius: var(--radius-small);
}

.brand img {
  height: 40px;
  width: auto;
}

.logo-dark {
  display: none;
}

:root[data-theme='dark'] .logo-light {
  display: none;
}

:root[data-theme='dark'] .logo-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-light {
    display: none;
  }

  :root:not([data-theme='light']) .logo-dark {
    display: block;
  }
}

/* A segmented choice: a recessed track holding three raised parts (DESIGN §10, selection). */
.theme-switch {
  display: none;
  padding: 4px;
  gap: 2px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.has-theme-switch .theme-switch {
  display: inline-flex;
}

.theme-switch button {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.theme-switch button:hover {
  color: var(--text);
}

.theme-switch button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(22 25 29 / 0.12);
}

.theme-switch .icon {
  width: 22px;
  height: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 26px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--on-color);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 140ms ease-out;
}

.button:hover {
  background: color-mix(in srgb, var(--primary) 86%, #000);
}

h2 {
  font-size: clamp(1.875rem, 1.35rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.section-lede {
  margin-top: 14px;
  max-width: 60ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Hero --------------------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 104px);
}

.hero-copy {
  display: grid;
  justify-items: center;
  text-align: center;
}

/* The pearl Bosi disappears on a light page (DESIGN §17), so it stands in a disc of the stage's
   light, which also ties it to the scene below. */
.hero-bosi {
  display: grid;
  place-items: center;
  width: clamp(148px, 16vw, 188px);
  aspect-ratio: 1;
  margin-bottom: 28px;
  border-radius: 50%;
  background:
    radial-gradient(90% 90% at 50% 15%, var(--stage-top) 0%, transparent 70%),
    linear-gradient(180deg, var(--stage-mid), var(--stage-low));
  box-shadow: 0 24px 48px -24px rgb(11 58 122 / 0.6);
}

.hero-bosi img {
  width: 70%;
  height: auto;
  filter: drop-shadow(0 14px 16px rgb(5 20 45 / 0.45));
}

.hero h1 {
  font-size: clamp(2.625rem, 1.5rem + 4.6vw, 5.25rem);
  font-weight: 700;
  /* 1.12, not tighter: the marks of İ and Ğ are clipped below that (DESIGN §6). */
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 14ch;
}

.lede {
  margin-top: 24px;
  text-wrap: pretty;
  max-width: 54ch;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}

.address {
  color: var(--text-muted);
  font-weight: 600;
}

/* Stage -------------------------------------------------------------------------------------- */

.stage {
  position: relative;
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: 56px clamp(20px, 4vw, 56px) 64px;
  border-radius: var(--radius-container);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--stage-top) 0%, transparent 60%),
    linear-gradient(180deg, var(--stage-mid), var(--stage-low));
  overflow: hidden;
  isolation: isolate;
}

/* The light the printer stands in: a soft pool on the floor of the stage. */
.stage::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -120px;
  width: 720px;
  height: 260px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.14), transparent);
}

.panel {
  justify-self: center;
  width: min(100%, 260px);
  padding: 18px 18px 20px;
  border-radius: var(--radius-control);
  background: var(--object);
  color: var(--object-ink);
  box-shadow:
    0 1px 2px rgb(5 20 45 / 0.2),
    0 24px 48px -24px rgb(5 20 45 / 0.6);
}

.panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--object-muted);
}

.panel ul {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.panel li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.panel li .icon {
  width: 22px;
  height: 22px;
  fill: var(--stage-mid);
}

.dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.dot-ok {
  color: #1a6f3e;
}

.panel-state {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-small);
  background: color-mix(in srgb, #f9c424 24%, transparent);
  color: #7e6004;
  font-weight: 600;
}

.panel-note {
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--object-muted);
}

/* Printer and ticket ------------------------------------------------------------------------- */

.printer {
  position: relative;
  width: min(340px, 78vw);
}

.printer-body {
  position: relative;
  z-index: 2;
  height: 88px;
  border-radius: 26px 26px 14px 14px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.1), transparent 40%),
    linear-gradient(180deg, #2c323a, #171a1f);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.12),
    0 20px 40px -16px rgb(0 0 0 / 0.55);
}

.printer-led {
  position: absolute;
  top: 22px;
  right: 30px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ad07a;
  box-shadow: 0 0 10px 2px rgb(58 208 122 / 0.55);
}

/* The slot the paper comes out of; the ticket is clipped at its top edge. */
.printer-mouth {
  position: relative;
  margin: -10px 18px 0;
  padding-top: 10px;
  overflow: hidden;
}

.printer-mouth::before {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  height: 10px;
  border-radius: 0 0 6px 6px;
  background: #0b0d10;
}

.ticket {
  padding: 24px 22px 30px;
  background: var(--object);
  color: var(--object-ink);
  font-feature-settings: 'tnum' 1;
  /* Torn bottom edge: the last 10 px are cut into small teeth. */
  mask:
    linear-gradient(#000, #000) top / 100% calc(100% - 10px) no-repeat,
    conic-gradient(from -45deg at 50% 10px, #000 90deg, #0000 0) bottom / 12px 10px repeat-x;
}

.ticket-head {
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px dashed var(--object-rule);
}

.ticket-title {
  font-size: 1.375rem;
  font-weight: 700;
}

.ticket-meta {
  color: var(--object-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.ticket-lines {
  padding-block: 12px;
  display: grid;
  gap: 9px;
  border-bottom: 1px dashed var(--object-rule);
}

.ticket-lines li,
.ticket-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.ticket-total {
  padding-top: 12px;
  font-weight: 700;
  font-size: 1.125rem;
}

.ticket-done {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1a6f3e;
  font-weight: 600;
}

/* One orchestrated moment: the ticket prints in steps, like a thermal printer, then the order is
   confirmed. Nothing else on the page moves on its own. */
@media (prefers-reduced-motion: no-preference) {
  .ticket {
    animation: print 1600ms steps(18, end) 400ms both;
  }

  .ticket-done {
    animation: confirm 260ms ease-out 2100ms both;
  }
}

@keyframes print {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes confirm {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Claims (bento) ----------------------------------------------------------------------------- */

.claims,
.journey {
  padding-block: clamp(56px, 8vw, 104px);
}

.claims {
  padding-top: 0;
}

.bento {
  margin-top: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-container);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tile-network {
  grid-row: span 2;
}

.tile h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.tile p {
  margin-top: 10px;
  max-width: 46ch;
  color: var(--text-muted);
  line-height: 1.6;
}

/* The diagram sits in a recessed well that takes the rest of the tall tile, so the tile reads as
   one figure instead of text with a drawing pushed to its floor. */
.network-well {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 40px);
  border-radius: var(--radius-control);
  background: var(--bg);
  border: 1px solid var(--border);
}

.network {
  width: 100%;
  max-width: 460px;
  height: auto;
  overflow: visible;
}

.network .link {
  stroke: var(--border);
  stroke-width: 2;
}

.network .link-cloud {
  stroke: var(--warning);
  stroke-dasharray: 6 7;
}

.network .node rect {
  fill: var(--surface);
  stroke: var(--border);
}

.network .node use {
  fill: var(--text-muted);
}

.network .node-hub rect {
  fill: var(--primary);
  stroke: none;
}

.network .node-hub use {
  fill: var(--on-color);
}

.network .node-cloud rect {
  fill: var(--surface);
  stroke: var(--warning);
  stroke-dasharray: 4 4;
}

.network .badge rect {
  fill: var(--warning-soft);
}

.network .badge text {
  fill: var(--warning-ink);
  font:
    600 13px 'Inter',
    system-ui,
    sans-serif;
  text-anchor: middle;
}

.toggles {
  display: grid;
  gap: 2px;
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
}

.toggles li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg);
  font-weight: 600;
}

.toggles li:last-child {
  color: var(--text-subtle);
}

.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--surface-2);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(22 25 29 / 0.25);
}

.switch.is-on {
  background: var(--primary);
}

.switch.is-on::after {
  left: 21px;
  background: var(--on-color);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 8px 12px;
  border-radius: var(--radius-small);
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Journey ------------------------------------------------------------------------------------ */

.journey {
  padding-top: 0;
}

.steps {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
}

.steps li {
  position: relative;
  counter-increment: step;
}

/* The line joins the icons into one path: an order moves along it from left to right. */
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 28px;
  left: 72px;
  right: -12px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--border));
}

.step-icon {
  width: 56px;
  height: 56px;
  padding: 14px;
  border-radius: 50%;
  background: var(--primary);
  fill: var(--on-color);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: -4px;
  left: 40px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.steps h3 {
  margin-top: 18px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
}

.steps p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* Status ------------------------------------------------------------------------------------- */

.status {
  padding-block: 0 clamp(56px, 8vw, 104px);
}

.status-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: var(--radius-container);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--stage-top) 0%, transparent 55%),
    linear-gradient(180deg, var(--stage-mid), var(--stage-low));
  color: var(--on-color);
}

.status-mark {
  width: clamp(80px, 11vw, 140px);
  height: auto;
  filter: drop-shadow(0 18px 24px rgb(5 20 45 / 0.45));
}

.status-copy p {
  margin-top: 14px;
  max-width: 56ch;
  line-height: 1.6;
  color: color-mix(in srgb, var(--on-color) 88%, transparent);
}

.status-copy .button {
  margin-top: 28px;
}

.button-on-color {
  background: var(--on-color);
  color: #125cbe;
}

.button-on-color:hover {
  background: color-mix(in srgb, var(--on-color) 88%, #135fc3);
}

.status :focus-visible {
  outline-color: var(--on-color);
}

/* Footer ------------------------------------------------------------------------------------- */

.colophon {
  padding-block: 32px 48px;
  /* The rule spans the content column, not the gutters, so it lines up with the sections above. */
  background: linear-gradient(var(--border), var(--border)) top center /
    calc(100% - 2 * var(--gutter)) 1px no-repeat;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* The smallest size in the system (DESIGN §6 label): the credit is required by the icon licence,
   not something a visitor needs to read. */
.colophon .credits {
  flex-basis: 100%;
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/* Narrow screens ----------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding-top: 40px;
  }

  .printer {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .steps li {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 20px;
  }

  .steps li .step-icon {
    grid-row: span 2;
  }

  .steps h3 {
    margin-top: 4px;
  }

  .steps li:not(:last-child)::after {
    top: 64px;
    bottom: -24px;
    left: 27px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--primary), var(--border));
  }
}

@media (max-width: 820px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
  }

  .tile-network {
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 32px 16px 40px;
  }

  .panel {
    width: 100%;
  }

  .status-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .button {
    width: 100%;
  }
}
