/*
 * ICE CUBE v2 – base.css (foundation; page builders: read only)
 * Extension tokens, reset, typography, layout primitives, utilities.
 * Brand tokens live in tokens.css (generated from design/tokens.json); components in components.css.
 * Rule of the house: page classes go on <main>, never on <html> or <body>.
 */

/* ------------------------------------------------------------------ extension tokens
 * Derived values that tokens.json does not carry. Same light/dark pattern as tokens.css. */
:root {
  --ring: var(--focus);                       /* focus ring; .on-navy switches it to yellow */
  --hover-on-navy: rgba(255, 255, 255, 0.08);  /* ghost / icon hover on navy (DESIGN §11.1) */
  --press-on-navy: rgba(255, 255, 255, 0.14);
  --btn-2-press: #00152A;
  --toast-bg: var(--navy-deep);
  --chip-active-bg: var(--bg-3);
  --tile-border: var(--line);                 /* partner tiles: hairline in light, none in dark */
  --switch-thumb: #FFFFFF;
  --meter-this-outline: #001E38;              /* jégmérő "this item" cells, both themes */
  --table-bg: var(--bg);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23354B66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --dash-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
  --selection: rgba(46, 163, 242, 0.28);
  --header-offset: 76px;                      /* anchor offset under the sticky bar */
}
@media (min-width: 1024px) {
  :root { --header-offset: 96px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --btn-2-press: #084F8A;
    --toast-bg: var(--surface-3);
    --chip-active-bg: var(--surface-3);
    --tile-border: transparent;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B2C6DB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300152A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --dash-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300152A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
    --selection: rgba(108, 192, 248, 0.32);
  }
}
:root[data-theme="dark"] {
  --btn-2-press: #084F8A;
  --toast-bg: var(--surface-3);
  --chip-active-bg: var(--surface-3);
  --tile-border: transparent;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B2C6DB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300152A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --dash-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300152A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
  --selection: rgba(108, 192, 248, 0.32);
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; tab-size: 4; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-stretch: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
/* Zero specificity: any component class (.timeline, .route …) can set its own padding and margin. */
:where(ul[class], ol[class]) { list-style: none; margin: 0; padding: 0; }
img, picture, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button:disabled { cursor: not-allowed; }
table { border-collapse: collapse; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
summary { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
abbr[title] { text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--selection); }
[id] { scroll-margin-top: var(--header-offset); }

/* ------------------------------------------------------------------ links and focus */
a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-standard), text-decoration-color var(--dur-fast) var(--ease-standard);
}
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Navy, hero, studio and footer surfaces: white text, yellow ring, sky-soft links. */
.on-navy {
  --ring: var(--focus-on-navy);
  color: var(--on-navy);
}
.on-navy a:not([class]) { color: var(--sky-soft); }
.on-navy a:not([class]):hover { color: var(--on-navy); }
/* Light panels inside navy (dropdowns, cards on a navy band) get the normal ring back. */
.on-light {
  --ring: var(--focus);
  color: var(--text);
}
.on-light a:not([class]) { color: var(--link); }
.on-light a:not([class]):hover { color: var(--link-hover); }

/* ------------------------------------------------------------------ typography */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: inherit; text-wrap: balance; }
p, li, dd, figcaption, blockquote { text-wrap: pretty; }

h1, .display-l {
  font-family: var(--font-display);
  font-size: var(--fs-display-l); line-height: var(--lh-display-l); font-weight: 800;
  font-stretch: 75%; letter-spacing: var(--ls-display-l); text-wrap: balance;
}
.display-xl {
  font-family: var(--font-display);
  font-size: var(--fs-display-xl); line-height: var(--lh-display-xl); font-weight: 800;
  font-stretch: 75%; letter-spacing: var(--ls-display-xl); text-wrap: balance;
}
.display-xl em, .display-xl i { font-style: italic; }
h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: 800;
  font-stretch: 75%; letter-spacing: var(--ls-h2); text-wrap: balance;
}
h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700;
  font-stretch: 87.5%; letter-spacing: var(--ls-h3); text-wrap: balance;
}
h4, .h4 {
  font-family: var(--font-ui);
  font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 700;
  font-stretch: 100%; letter-spacing: 0;
}
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 520px; }
.body-s { font-size: var(--fs-body-s); line-height: var(--lh-body-s); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; letter-spacing: var(--ls-caption); }
.label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.on-navy .text-2, .on-navy .text-3 { color: var(--on-navy-2); }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.italic { font-style: italic; }
strong, b { font-weight: 700; }

/* Prices: tabular, condensed, "Ft" at 0.6 em / 700 on the same baseline (DESIGN §6). */
.price {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: 0;
  font-family: var(--font-ui); font-weight: 800; font-stretch: 87.5%;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: inherit; margin: 0;
}
.price__cur, .price__vat { font-size: 0.6em; font-weight: 700; }
.price__vat { margin-left: 0.3em; }
.price--xl { font-size: var(--fs-price-xl); line-height: var(--lh-price-xl); letter-spacing: var(--ls-price-xl); }
.price--l { font-size: var(--fs-price-l); line-height: var(--lh-price-l); letter-spacing: var(--ls-price-l); }
.price--m { font-size: var(--fs-price-m); line-height: var(--lh-price-m); }
.price--s { font-size: 18px; line-height: 1.1; }

/* Running text */
.prose { max-width: var(--text-max); }
.prose > * + * { margin-top: 16px; }
.prose > h2, .prose > h3 { margin-top: 40px; }
.prose > h4 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--text-3); }

/* Vertical rhythm helpers: paragraphs 16, blocks 32 (DESIGN §7.2). */
.stack > * + * { margin-top: var(--stack-gap, 16px); }
.stack--s { --stack-gap: 8px; }
.stack--m { --stack-gap: 24px; }
.stack--l { --stack-gap: 32px; }
.stack--xl { --stack-gap: 48px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, 12px); }

/* ------------------------------------------------------------------ layout */
.wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.wrap--text { max-width: calc(var(--text-max) + 2 * 40px); }

/* 12 / 8 / 4 column grid (DESIGN §7.1). Children span the full row unless a span class says otherwise. */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid > * { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 20px; }
  .md-span-2 { grid-column: span 2; } .md-span-3 { grid-column: span 3; } .md-span-4 { grid-column: span 4; }
  .md-span-5 { grid-column: span 5; } .md-span-6 { grid-column: span 6; } .md-span-8 { grid-column: span 8; }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
  .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
  .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
  .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: 1 / -1; }
}

/* Two-part splits on the 12-column grid; stacked below 1024 px. */
.split { display: grid; gap: 32px; }
@media (min-width: 1024px) {
  .split { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
  .split > * { min-width: 0; }
  .split--7-5 > :first-child { grid-column: 1 / 8; }  .split--7-5 > :last-child { grid-column: 8 / 13; }
  .split--5-7 > :first-child { grid-column: 1 / 6; }  .split--5-7 > :last-child { grid-column: 6 / 13; }
  .split--8-4 > :first-child { grid-column: 1 / 9; }  .split--8-4 > :last-child { grid-column: 9 / 13; }
  .split--4-8 > :first-child { grid-column: 1 / 5; }  .split--4-8 > :last-child { grid-column: 5 / 13; }
  .split--6-6 > :first-child { grid-column: 1 / 7; }  .split--6-6 > :last-child { grid-column: 7 / 13; }
  .split--center { align-items: center; }
  .split--end { align-items: end; }
}

/* ------------------------------------------------------------------ sections (DESIGN §7.3) */
.section { padding-block: var(--section-y); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }
.section--tint { background: var(--bg-2); --table-bg: var(--bg-2); }
.section--navy, .section--studio, .section--hero { color: var(--on-navy); --ring: var(--focus-on-navy); }
.section--navy { background: var(--navy); }
.section--studio { background: var(--navy-deep); }
.section--hero { background: var(--hero-gradient); }
.section--yellow { background: var(--band-yellow); color: var(--on-yellow); --ring: var(--on-yellow); }

/* H2 in columns 1–7, the lead in 8–12 aligned to the H2's bottom; stacked on mobile. No eyebrows. */
.section-header { display: grid; gap: 16px; margin-bottom: 32px; }
.section-header__lead { color: var(--text-2); font-size: var(--fs-lead); line-height: var(--lh-lead); max-width: 520px; }
.on-navy .section-header__lead, .section--navy .section-header__lead, .section--studio .section-header__lead,
.section--hero .section-header__lead { color: var(--on-navy-2); }
.section-header__aside > * + * { margin-top: 12px; }
@media (min-width: 1024px) {
  .section-header { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: end; margin-bottom: 40px; }
  .section-header > :first-child { grid-column: 1 / 8; }
  .section-header > :nth-child(2) { grid-column: 8 / 13; }
}

/* ------------------------------------------------------------------ utilities */
.sr-only, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.full-bleed { width: 100%; }

/* ------------------------------------------------------------------ motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
