/* Varu design tokens: every colour, radius, space, font, shadow and motion
   value. Light on :root; dark follows the device, or the theme chosen on this
   device (data-theme on <html>, set by js/theme.js and js/shell.js).
   Components use these names only, never a literal value. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/InterTight-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Surfaces */
  --surface-base: #ffffff;
  --surface-alt: #f5f5f7;
  --fill-tile: #f5f5f7;          /* a tile on a base section */
  --fill-tile-on-alt: #ffffff;   /* a tile on an alternate section */
  --fill-raised: #f5f5f7;
  --fill-on-tile: #ffffff;       /* a list or field on a tile */
  --fill-floating: #ffffffe8;
  --bar-nav: #fbfbfd;
  --bar-tab: #f9f9f9f0;
  --fill-control: #7676801f;
  --control-selected: #ffffff;
  --shadow-segment: 0 1px 3px #0000001f;

  /* Text */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;      /* large text only (24 px and up) */
  --text-on-accent: #ffffff;

  /* Accent: green for links, CTAs and eyebrows; red for 112 and emergencies only */
  --green-text: #0a6b50;
  --green-fill: #0a6b50;
  --green-fill-hover: #085c45;
  --green-fill-pressed: #064d3a;
  --green-halo: #0a6b5029;
  --green-tint: #0a6b5014;
  --red-fill: #c8261c;
  --red-fill-hover: #b32219;
  --red-fill-pressed: #9c1d15;
  --red-text: #c8261c;

  /* Lines and glyphs */
  --separator: #d2d2d7;
  --separator-list: #d9d9de;
  --glyph-tertiary: #c4c4c7;
  --glyph-clear: #aeaeb2;
  --glyph-secondary: #8e8e93;
  --hairline-floating: #0000001a;
  --hairline-tab: #0000001f;

  /* Effects */
  --shadow-floating: 0 0 0 0.5px var(--hairline-floating), 0 10px 30px #00000024;
  --shadow-thumb: 0 2px 4px #00000026;
  --blur-floating: 24px;
  --blur-bar: 20px;
  --focus-color: var(--green-text);
  --focus-width: 2px;
  --focus-offset: 2px;
  --focus-halo: 0 0 0 4px #0a6b501f;

  /* Switch (switch.jsx) */
  --switch-off: #e3e3e8;
  --switch-on: var(--green-fill);
  --switch-thumb: #ffffff;
  --switch-width: 44px;
  --switch-height: 26px;
  --switch-thumb-size: 22px;
  --switch-inset: 2px;

  /* Loading */
  --skeleton-strong: #7676801f;
  --skeleton-soft: #7676801a;

  /* Icon colour discs (map layers, library books) */
  --disc-shelter: #5b3a29;
  --disc-hospital: #d23b2f;
  --disc-pharmacy: #2e8b3e;
  --disc-water: #1f6fd1;
  --disc-fuel: #d9730d;
  --disc-grocery: #7b3fb5;
  --disc-police: #24306b;
  --disc-rescue: #b01e5a;
  --disc-vikipeedia: #1f4d3f;
  --disc-wikimed: var(--red-fill);

  /* The start page's map picture */
  --map-land: #e8e6e1;
  --map-water: #a9d6e8;
  --map-park: #cde6cf;
  --map-road: #ffffff;
  --map-pin: var(--green-fill);
  --lift: 0%;

  /* Type */
  --font-body: -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", system-ui, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Inter Tight", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --size-h1: 56px;
  --line-h1: 1.04;
  --track-h1: -1.4px;
  --size-h2: 40px;
  --line-h2: 1.1;
  --track-h2: -0.9px;
  --size-h3: 24px;
  --line-h3: 1.2;
  --track-h3: -0.4px;
  --size-large-title: 34px;
  --track-large-title: -0.6px;
  --size-body: 17px;
  --line-body: 25px;
  --size-small: 15px;
  --line-small: 21px;
  --size-caption: 13px;
  --line-caption: 18px;
  --size-micro: 12px;
  --line-micro: 16px;

  /* Shape */
  --radius-tile: 28px;
  --radius-card: 20px;
  --radius-list: 14px;
  --radius-chip: 14px;
  --radius-button: 12px;
  --radius-field: 10px;
  --radius-icon: 7px;
  --radius-pill: 980px;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
  --gap-tile: 20px;
  --gap-section: 120px;
  --page-margin: 80px;
  --content-max: 1120px;
  --target-min: 44px;
  --nav-global-height: 44px;
  --nav-local-height: 52px;
  --tabbar-height: 50px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
}

@media (max-width: 1023px) { :root { --page-margin: 40px; --gap-section: 100px; } }
@media (max-width: 599px) { :root { --page-margin: 16px; --gap-section: 88px; --size-h1: 46px; --size-h2: 34px; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-base: #000000;
    --surface-alt: #101011;
    --fill-tile: #1c1c1e;
    --fill-tile-on-alt: #1c1c1e;
    --fill-raised: #2c2c2e;
    --fill-on-tile: #2c2c2e;
    --fill-floating: #2c2c2ee6;
    --bar-nav: #161617;
    --bar-tab: #161617f0;
    --fill-control: #7676803d;
    --control-selected: #636366;
    --shadow-segment: none;

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #8e8e93;

    --green-text: #3dbe8b;
    --green-fill: #0c7a5b;
    --green-fill-hover: #0a6b50;
    --green-fill-pressed: #095c45;
    --green-halo: #3dbe8b33;
    --green-tint: #3dbe8b26;
    --red-fill: #d12f25;
    --red-fill-hover: #b9281f;
    --red-fill-pressed: #a02119;
    --red-text: #ff6b5e;

    --separator: #38383a;
    --separator-list: #38383a;
    --glyph-tertiary: #636366;
    --glyph-clear: #636366;
    --glyph-secondary: #8e8e93;
    --hairline-floating: #ffffff26;
    --hairline-tab: #ffffff26;

    --shadow-floating: 0 0 0 1px var(--hairline-floating), 0 10px 30px #00000066;
    --focus-halo: 0 0 0 4px #3dbe8b40;

    --switch-off: #39393d;

    --disc-shelter: #93603f;
    --disc-grocery: #9459d1;
    --disc-police: #4a5fc4;
    --disc-rescue: #c9306e;
    --disc-vikipeedia: #2f7a62;
  
    --map-land: #1e1e20;
    --map-water: #12343c;
    --map-park: #18402f;
    --map-road: #3a3a3c;
    --lift: 45%;
  }
}

:root[data-theme="dark"] {
  --surface-base: #000000;
  --surface-alt: #101011;
  --fill-tile: #1c1c1e;
  --fill-tile-on-alt: #1c1c1e;
  --fill-raised: #2c2c2e;
  --fill-on-tile: #2c2c2e;
  --fill-floating: #2c2c2ee6;
  --bar-nav: #161617;
  --bar-tab: #161617f0;
  --fill-control: #7676803d;
  --control-selected: #636366;
  --shadow-segment: none;

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;

  --green-text: #3dbe8b;
  --green-fill: #0c7a5b;
  --green-fill-hover: #0a6b50;
  --green-fill-pressed: #095c45;
  --green-halo: #3dbe8b33;
  --green-tint: #3dbe8b26;
  --red-fill: #d12f25;
  --red-fill-hover: #b9281f;
  --red-fill-pressed: #a02119;
  --red-text: #ff6b5e;

  --separator: #38383a;
  --separator-list: #38383a;
  --glyph-tertiary: #636366;
  --glyph-clear: #636366;
  --glyph-secondary: #8e8e93;
  --hairline-floating: #ffffff26;
  --hairline-tab: #ffffff26;

  --shadow-floating: 0 0 0 1px var(--hairline-floating), 0 10px 30px #00000066;
  --focus-halo: 0 0 0 4px #3dbe8b40;

  --switch-off: #39393d;

  --disc-shelter: #93603f;
  --disc-grocery: #9459d1;
  --disc-police: #4a5fc4;
  --disc-rescue: #c9306e;
  --disc-vikipeedia: #2f7a62;

  --map-land: #1e1e20;
  --map-water: #12343c;
  --map-park: #18402f;
  --map-road: #3a3a3c;
  --lift: 45%;
  color-scheme: dark;
}

:root[data-theme="light"] { color-scheme: light; }

/* An alternate section: its tiles take the other fill. */
.band-alt { --fill-tile: var(--fill-tile-on-alt); background: var(--surface-alt); }
