/* ==========================================================================
   OptiFormula site styles
   Quiet neutrals, large tight headlines and one interactive colour (the corporate orange).
   Corporate orange (#ED682B) is used for buttons and focus; --of-accent (a darker shade of it) is only
   used for small labels such as the edition flag and the hero kicker.
   ========================================================================== */

/* Inter (SIL OFL 1.1, public/fonts/inter/OFL.txt), served from the site. One variable file per
   script covers weights 400-700; the browser fetches a file only when the page uses its characters. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter/inter-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand */
  --of-logo-orange: #ed682b;
  --of-accent: #bc4610; /* #ed682b darkened for text: 5.22:1 on white, 4.80:1 on #f5f5f7 */
  --of-accent-hover: #a03c0e;
  --of-accent-tint: #fdeee7;

  /* Interactive */
  --of-link: var(--of-accent); /* corporate orange, 5.22:1 on white, 4.80:1 on #f5f5f7 */
  --of-link-hover: var(--of-accent-hover);
  --of-button: var(--of-logo-orange); /* the logo's orange */
  --of-button-hover: #e25413;
  --of-link-on-dark: #f18756; /* 8.34:1 on black */

  /* Neutrals */
  --of-ink: #1d1d1f;
  --of-text: #1d1d1f;
  --of-text-muted: #6e6e73; /* 5.07:1 on white, 4.66:1 on #f5f5f7 */
  --of-line: #d2d2d7;
  --of-line-soft: #e8e8ed;
  --of-line-strong: #86868b; /* 3.6:1 on white, for input borders */
  --of-bg: #ffffff;
  --of-bg-soft: #fbfbfd;
  --of-bg-alt: #f5f5f7;
  --of-bg-dark: #000000;
  --of-bg-dark-alt: #1d1d1f;
  --of-text-on-dark: #f5f5f7;
  --of-text-on-dark-muted: #a1a1a6; /* 8.16:1 on black */
  --of-accent-on-dark: #f18756;
  --of-focus: var(--of-logo-orange);

  /* Legacy aliases still referenced by subpage styles */
  --of-orange: var(--of-accent);
  --of-orange-tint: var(--of-accent-tint);
  --of-carbon: var(--of-ink);
  --of-charcoal: var(--of-text);
  --of-slate: var(--of-text-muted);
  --of-muted: var(--of-text-muted);
  --of-border: var(--of-line);
  --of-border-strong: var(--of-line);
  --of-ivory: var(--of-bg-alt);
  --of-stone: var(--of-bg-alt);
  --of-white: var(--of-bg);
  --of-green: #15803d;

  /* Type: the platform's own UI face where there is one (Apple systems), Inter elsewhere. */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;

  --text-caption: 0.75rem; /* 12px */
  --text-small: 0.875rem; /* 14px */
  --text-body: 1.0625rem; /* 17px */
  --text-lede: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem); /* 19–24px */
  --text-h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); /* 20–24px */
  --text-h2: clamp(2rem, 1.3rem + 3vw, 3.5rem); /* 32–56px */
  --text-h1: clamp(2.5rem, 1.4rem + 5vw, 5rem); /* 40–80px */
  --text-display: clamp(2.75rem, 1.2rem + 6.4vw, 6rem); /* 44–96px */

  --tracking-display: -0.015em;
  --tracking-tight: -0.022em;

  /* Space */
  --space-section: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  --radius: 12px;
  --radius-tile: 28px;
  --nav-height: 120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1200px) {
  :root {
    --nav-height: 88px;
  }
}

/* Tracking breaks joined scripts and adds nothing to these others. */
html:lang(ar) *,
html:lang(ur) *,
html:lang(hi) *,
html:lang(th) *,
html:lang(zh) * {
  letter-spacing: 0 !important;
}

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

html {
  font-family: var(--font-sans);
  color: var(--of-text);
  background-color: var(--of-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--nav-height) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--of-text);
  background-color: var(--of-bg);
}

img {
  max-width: 100%;
}

/* Long single words, such as German compounds, must not push headings off narrow screens. */
h1,
h2,
h3 {
  overflow-wrap: break-word;
  hyphens: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
}

a {
  color: var(--of-link);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

@media (hover: hover) {
  a:hover {
    text-decoration: underline;
  }
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--of-focus);
  outline-offset: 3px;
}

.of-on-dark {
  --of-focus: #ffffff;
}

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

.of-skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 2000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--of-ink);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.of-skip-link:focus {
  top: 8px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.of-container {
  width: 100%;
  max-width: 1068px;
  margin: 0 auto;
  padding-inline: 22px;
}

.of-container--wide {
  max-width: 1440px;
}

@media (max-width: 640px) {
  .of-container {
    padding-inline: 16px;
  }
}

.of-section {
  padding-block: var(--space-section);
}

.of-section--alt {
  background-color: var(--of-bg-alt);
}

.of-section--dark {
  background-color: var(--of-bg-dark);
  color: var(--of-text-on-dark);
}

.of-section-header {
  max-width: 980px;
  margin: 0 0 3rem;
}

.of-section-header--center {
  margin-inline: auto;
  text-align: center;
}

.of-section-title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: var(--tracking-display);
  color: var(--of-ink);
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.of-section--dark .of-section-title {
  color: var(--of-text-on-dark);
}

.of-section-subtitle {
  font-size: var(--text-lede);
  line-height: 1.38;
  color: var(--of-text-muted);
  margin: 0;
  text-wrap: pretty;
}

.of-section--dark .of-section-subtitle {
  color: var(--of-text-on-dark-muted);
}

/* ==========================================================================
   Buttons and links
   ========================================================================== */

.of-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .of-btn {
    transition-property: background-color, border-color, color;
    transition-duration: 200ms;
    transition-timing-function: ease-out;
  }
}

.of-btn--primary {
  background-color: var(--of-button);
  color: #ffffff;
}

.of-btn--secondary {
  background-color: transparent;
  color: var(--of-link);
  border-color: var(--of-link);
}

.of-btn--sm {
  min-height: 36px;
  padding: 7px 16px;
  font-size: var(--text-small);
}

@media (hover: hover) {
  .of-btn:hover {
    text-decoration: none;
  }

  .of-btn--primary:hover {
    background-color: var(--of-button-hover);
    color: #ffffff;
  }

  .of-btn--secondary:hover {
    background-color: var(--of-link);
    color: #ffffff;
  }
}

.of-on-dark .of-btn--secondary {
  color: var(--of-link-on-dark);
  border-color: var(--of-link-on-dark);
}

@media (hover: hover) {
  .of-on-dark .of-btn--secondary:hover {
    background-color: var(--of-link-on-dark);
    color: #000000;
  }
}

/* Text link with a chevron, used for "learn more" style links */
.of-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2em;
  font-weight: 400;
  color: var(--of-link);
  text-decoration: none;
}

.of-link::after {
  content: '\203A';
  font-size: 1.15em;
  line-height: 1;
}

[dir='rtl'] .of-link::after {
  content: '\2039';
}

.of-on-dark .of-link,
.of-on-dark a:not(.of-btn) {
  color: var(--of-link-on-dark);
}

@media (hover: hover) {
  .of-link:hover {
    color: var(--of-link-hover);
    text-decoration: underline;
  }

  .of-on-dark .of-link:hover {
    color: var(--of-link-on-dark);
  }
}

/* A button that looks like an .of-link */
.of-link-button {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  cursor: pointer;
}

.of-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 32px;
}

/* ==========================================================================
   Scroll reveal (plugins/reveal.ts adds the class). Everyone gets the fade; the upward
   slide is only for visitors who have not asked for reduced motion.
   ========================================================================== */

.of-reveal {
  opacity: 0;
  transition: opacity 1000ms cubic-bezier(0.33, 0, 0.2, 1);
}

.of-reveal.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .of-reveal {
    transform: translateY(40px);
    transition:
      opacity 1000ms cubic-bezier(0.33, 0, 0.2, 1),
      transform 1100ms var(--ease-out);
  }

  .of-reveal.is-visible {
    transform: none;
  }
}

/* ==========================================================================
   Page hero for inner pages
   ========================================================================== */

.of-page-hero {
  padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
  background-color: var(--of-bg-soft);
  text-align: center;
}

.of-page-hero .of-container {
  max-width: 980px;
}

.of-page-hero__back {
  margin: 0 0 1rem;
  font-size: var(--text-small);
}

.of-page-hero__back a {
  color: var(--of-link);
}

.of-page-hero__back a::before {
  content: '\2039\00a0';
}

[dir='rtl'] .of-page-hero__back a::before {
  content: '\203A\00a0';
}

.of-page-hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: var(--of-ink);
  text-wrap: balance;
}

.of-page-hero__lede {
  margin: 0 auto;
  max-width: 44rem;
  font-size: var(--text-lede);
  line-height: 1.38;
  color: var(--of-text-muted);
  text-wrap: pretty;
}

/* ==========================================================================
   Reference directory (home page and references page)
   ========================================================================== */

.of-ref-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  max-width: 44rem;
}

@media (max-width: 640px) {
  .of-ref-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

.of-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.of-field label {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--of-ink);
}

.of-field input,
.of-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--of-line-strong);
  border-radius: var(--radius);
  background-color: var(--of-bg);
  color: var(--of-ink);
  font-size: 1rem;
}

.of-field input::placeholder {
  color: var(--of-text-muted);
}

.of-ref-status {
  margin: 1.25rem 0 1rem;
  font-size: var(--text-small);
  color: var(--of-text-muted);
  font-variant-numeric: tabular-nums;
}

.of-ref-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.of-ref {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 12px;
  border-block-end: 1px solid var(--of-line);
}

.of-ref img {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.of-ref__name {
  margin: 0;
  font-weight: 600;
  color: var(--of-ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.of-ref__city {
  margin: 0;
  font-size: var(--text-small);
  color: var(--of-text-muted);
}

.of-ref-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-block: 1.5rem;
}

.of-ref-empty p {
  margin: 0;
}

.of-ref-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  margin-block-start: 2rem;
}

