/*

Main concepts by creating css styles

- When nested class used, keep the original class as a separate element, and create a duplicated element with nested elements
- When allowed, use simple html hierarchy, and dont add extra classes and ids.
- To separate contents, use data-label="XXXXXX" instead of a classname.
- Use ID only when there is a hash, or 100% sure, that only one element will have this ID.
- Use form elements instead of a or buttons.

Site foundation: tokens, reset, typography, shared primitives, default section type.
Section-specific layout stays in source/templates/{family}/{index}/{family}.css — override the --sec-*
or --text-* variables on the section root, or write unique selectors there.

*/

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato/lato-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("../fonts/lato/lato-300-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lato/lato-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lato/lato-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/lato/lato-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/lato/lato-700-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/lato/lato-900-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url("../fonts/material-symbols/material-symbols-outlined.woff2?v=20261006") format("woff2");
}

:root {
  /* Breakpoint reference: M1 ≤767 / T1 768–1199 / D1 ≥1200 */
  --page-max: 1200px;
  --page-gutter: clamp(1rem, 4vw, 2.5rem);

  --color-bg: #ffffff;
  --color-bg-soft: #f7f7f7;
  --color-surface: #f3f3f3;
  --color-surface-white: #ffffff;
  --color-ink: #1a1a2e;
  --color-ink-muted: #5a5a6e;
  --color-on-dark: #ffffff;
  --color-text-muted: #b0b0c0;
  --color-text-soft: #c5c0e8;
  --color-text-brand: #a8a0d0;
  --color-border: #555555;
  --color-border-strong: #333333;
  --color-elevated: #0a0a0a;
  --color-elevated-border: #222222;
  --color-media-placeholder: #222222;
  --color-about-title: #6b7fd7;
  --color-about-border: #3a4a7a;
  --color-about-head: #9aa6c8;
  --color-about-body: #c5c5d0;
  --color-about-muted: #8a90a8;
  --color-support-title: #c5c0e8;
  --color-support-item: #b8b4d8;
  --color-blue: #1da1d8;
  --color-green: #a2c947;
  --color-orange: #f28122;
  --color-pink: #d9006b;
  --color-yellow: #ffd700;
  --color-purple: #7b3f8d;
  --color-purple-deep: #3d2450;
  --color-red: #e61d2e;
  --color-navy: #1e2a5a;
  --color-placeholder: #8d8d8d;

  --radius-card: 1.5rem;
  --radius-pill: 999px;
  --radius-tile: 1rem;

  --font-sans: "Lato", system-ui, sans-serif;
  --font-script: "Caveat", cursive;

  /* Heading */
  --text-heading: clamp(1.45rem, 2.8vw, 2.1rem);
  --text-heading-line: 1.2;
  --text-heading-weight: 900;

  /* Subheading */
  --text-subheading: clamp(1.1rem, 2vw, 1.4rem);
  --text-subheading-line: 1.3;
  --text-subheading-weight: 700;

  /* Script title */
  --text-script: clamp(1.35rem, 2.6vw, 1.85rem);
  --text-script-line: 0.95;
  --text-script-weight: 600;

  /* Paragraph — 5 sizes */
  --text-p-biggest: 1.5rem;
  --text-p-bigger: 1.25rem;
  --text-p: 1.05rem;
  --text-p-smaller: 0.9rem;
  --text-p-smallest: 0.78rem;
  --text-p-line: 1.5;
  --text-p-weight: 400;

  --header-h: 4.5rem;
  --transition: 0.25s ease;

  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #000000;
  --color-bg-soft: #111111;
  --color-ink: #ffffff;
}

html[data-theme="light"] {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-bg-soft: #f7f7f7;
  --color-surface: #ffffff;
  --color-surface-white: #ffffff;
  --color-ink: #1a1a22;
  --color-ink-muted: #5c5c6e;
  --color-on-dark: #1a1a22;
  --color-text-muted: #5a5a6a;
  --color-text-soft: #4a3a7a;
  --color-text-brand: #5a4a9a;
  --color-border: #c4c4d0;
  --color-border-strong: #d0d0d8;
  --color-elevated: #ffffff;
  --color-elevated-border: #e2e2ea;
  --color-media-placeholder: #d8d8e0;
  --color-about-title: #3d4fb8;
  --color-about-border: #c5cce8;
  --color-about-head: #3a4568;
  --color-about-body: #3a3a48;
  --color-about-muted: #5a6078;
  --color-support-title: #4a3a7a;
  --color-support-item: #4a4a5a;
  --color-navy: #1a2450;
  --color-purple: #6b3a7a;
  --color-purple-deep: #4a2a58;
}

/* Main styles - Default */

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

html {
  scroll-behavior: smooth;
}

/* Mode / layout restore: jump instantly, then smooth resumes */
html[data-scroll="0"] {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.page-shell {
  min-height: 100vh;
  container-type: inline-size;
  container-name: page;
}

.anchor-reference {
  position: relative;
  top: var(--anchor-offset, 0px);
  width: 0;
  height: 0;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Typography styles - Default */

[data-template] {
  --sec-heading: var(--text-heading);
  --sec-heading-line: var(--text-heading-line);
  --sec-heading-weight: var(--text-heading-weight);
  --sec-subheading: var(--text-subheading);
  --sec-subheading-line: var(--text-subheading-line);
  --sec-subheading-weight: var(--text-subheading-weight);
  --sec-script: var(--text-script);
  --sec-script-line: var(--text-script-line);
  --sec-script-weight: var(--text-script-weight);
  --sec-p: var(--text-p);
  --sec-p-line: var(--text-p-line);
  --sec-p-weight: var(--text-p-weight);
}

.page-shell {
  h1,
  h2,
  .heading,
  .title {
    font-size: var(--sec-heading, var(--text-heading));
    line-height: var(--sec-heading-line, var(--text-heading-line));
    font-weight: var(--sec-heading-weight, var(--text-heading-weight));
    font-weight: normal;
  }

  h3,
  .subheading,
  .subtitle {
    font-size: var(--sec-subheading, var(--text-subheading));
    line-height: var(--sec-subheading-line, var(--text-subheading-line));
    font-weight: var(--sec-subheading-weight, var(--text-subheading-weight));
  }

  p {
    font-size: var(--sec-p, var(--text-p));
    line-height: var(--sec-p-line, var(--text-p-line));
    font-weight: var(--sec-p-weight, var(--text-p-weight));
  }
}

h2.script-title,
h3.script-title {
  font-family: var(--font-script);
  font-size: var(--sec-script, var(--text-script));
  line-height: var(--sec-script-line, var(--text-script-line));
  font-weight: var(--sec-script-weight, var(--text-script-weight));
}

.biggest p { font-size: var(--text-p-biggest); }
.bigger p { font-size: var(--text-p-bigger); }
.smaller p { font-size: var(--text-p-smaller); }
.smallest p { font-size: var(--text-p-smallest); }

p {
  &.biggest { font-size: var(--text-p-biggest); }
  &.bigger { font-size: var(--text-p-bigger); }
  &.smaller { font-size: var(--text-p-smaller); }
  &.smallest { font-size: var(--text-p-smallest); }
}

.flow-t {
  display: inline-block;
}

/* Header and footer styles - Default
   Unique header/footer layout lives in source/templates/header/{n} and footer/{n}.
*/

/* Main content styles - Default */

.flow-shape {
  position: relative;
  isolation: isolate;
}

.flow-shape__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateZ(0);
}

[data-accent="gray"] > .flow-shape__bg {
  background: var(--color-placeholder);
}

.flow-shape__bg > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: auto;
}

.flow-shape__content {
  position: relative;
  z-index: 1;
}

.flow-shape[data-span="2x1"] { grid-column: span 2; aspect-ratio: auto; }
.flow-shape[data-span="3x1"] { grid-column: span 3; aspect-ratio: auto; }
.flow-shape[data-span="4x1"] { grid-column: span 4; aspect-ratio: auto; }
.flow-shape[data-span="1x2"] { grid-row: span 2; aspect-ratio: auto; }
.flow-shape[data-span="1x3"] { grid-row: span 3; aspect-ratio: auto; }
.flow-shape[data-span="1x4"] { grid-row: span 4; aspect-ratio: auto; }

.btn-pill {
  --btn-pill-pad: 0.35rem;
  --btn-pill-icon-size: 2rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: calc(var(--btn-pill-icon-size) + 2 * var(--btn-pill-pad));
  padding: var(--btn-pill-pad);
  padding-inline: calc(var(--btn-pill-icon-size) + 2 * var(--btn-pill-pad));
  background: #fff;
  color: #333;
  border-radius: var(--radius-pill);
  border: 0;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-pill__icon {
  position: absolute;
  left: var(--btn-pill-pad);
  top: 50%;
  transform: translateY(-50%);
  width: var(--btn-pill-icon-size);
  height: var(--btn-pill-icon-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}

.btn-pill__icon .material-symbols-outlined {
  font-size: 1.15rem;
}

.btn-pill__label {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.2;
}

.flow-check,
.flow-radio {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: calc(0.8rem - 1px);
  line-height: 1.35;
  color: var(--color-ink);
}

.flow-radio {
  align-items: center;
}

.flow-check input,
.flow-radio input {
  position: absolute;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  pointer-events: none;
}

.flow-check i,
.flow-radio i {
  position: relative;
  flex: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.05rem;
  box-sizing: border-box;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-elevated);
  color: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}

.flow-radio i {
  margin-top: 0;
  border-radius: 50%;
  width: calc(1.15rem - 3.5px);
  height: calc(1.15rem - 3.5px);
  flex-basis: calc(1.15rem - 3.5px);
}

.flow-radio i::after {
  content: "";
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: transparent;
  transition: background 0.12s;
}

.flow-check i .material-symbols-outlined {
  font-size: 0.95rem;
  line-height: 1;
  width: auto;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.12s, transform 0.12s;
  font-variation-settings: "FILL" 1, "wght" 700, "GRAD" 0, "opsz" 20;
  font-weight: 700;
}

.flow-check em,
.flow-radio em {
  font-style: normal;
  font-weight: 400;
  min-width: 0;
}

.flow-check:hover i,
.flow-radio:hover i {
  border-color: var(--color-text-muted);
}

.flow-check input:focus-visible ~ i,
.flow-radio input:focus-visible ~ i {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-blue) 35%, transparent);
}

.flow-check input:checked ~ i {
  border-color: var(--color-blue);
  background-color: var(--color-blue);
  color: #fff;
}

.flow-check input:checked ~ i .material-symbols-outlined {
  opacity: 1;
  transform: scale(1);
  color: #fff;
}

.flow-radio input:checked ~ i {
  border-color: var(--color-blue);
}

.flow-radio input:checked ~ i::after {
  background: var(--color-blue);
}

/* Section styles - Default
   Type scale: override --sec-heading / --sec-script / --sec-p on the section.
   Unique layout, color, clip stays in the template CSS.
*/

/* Block styles - Default */

.block-handle {
  display: none;
}

/* Page-width type + overflow: M1 ≤767 / T1 768–1199 (container, not viewport) */
.page-shell > [data-template] :is(h1, h2, h3, h4, p, li, label, em, strong) {
  overflow-wrap: break-word;
}

@container page (max-width: 767px) {
  .page-shell h1,
  .page-shell h2,
  .page-shell .heading,
  .page-shell .title {
    font-size: clamp(1.12rem, 5.8cqi, 1.5rem);
  }

  .page-shell h3,
  .page-shell .subheading,
  .page-shell .subtitle {
    font-size: clamp(0.95rem, 4.6cqi, 1.18rem);
  }

  .page-shell p {
    font-size: clamp(0.88rem, 3.8cqi, 1.02rem);
  }

  h2.script-title,
  h3.script-title {
    font-size: clamp(1.15rem, 6.2cqi, 1.55rem);
  }
}

@container page (min-width: 768px) and (max-width: 1199px) {
  .page-shell h1,
  .page-shell h2,
  .page-shell .heading,
  .page-shell .title {
    font-size: clamp(1.25rem, 3.5cqi, 1.85rem);
  }

  .page-shell h3,
  .page-shell .subheading,
  .page-shell .subtitle {
    font-size: clamp(1.02rem, 2.8cqi, 1.28rem);
  }

  h2.script-title,
  h3.script-title {
    font-size: clamp(1.25rem, 3.8cqi, 1.7rem);
  }
}
