/* ============================================================================
   ohrion engine, v1
   ----------------------------------------------------------------------------
   The mechanism, not the design. Never edit this file per project: theme it by
   overriding the tokens in :root from the page's own stylesheet, and write your
   own markup on top.

   Every value here comes from 01-brand-guidelines.md. Changing a token value
   here changes the brand, which is a decision for the brand guide, not for a
   build.
   ========================================================================== */

:root {
  /* ---- The seven. Nothing else is a colour. ---------------------------- */
  --oh-canvas:   #F8F6F1;
  --oh-surface:  #FFFFFF;
  --oh-ink:      #3D3A38;
  --oh-ink-soft: #6A6562;
  --oh-accent:   #4D2C7C;
  --oh-sand:     #C9B78E;
  --oh-rule:     #E8E4DE;

  /* Derived. Always a mix of the above, never a new literal. */
  --oh-accent-wash: color-mix(in srgb, var(--oh-accent) 8%, transparent);
  --oh-sand-wash:   color-mix(in srgb, var(--oh-sand) 18%, transparent);
  --oh-ink-faint:   color-mix(in srgb, var(--oh-ink) 55%, var(--oh-canvas));

  /* ---- Type. Bitter first, Source Sans 3 first. See brand-floor.md §2. -- */
  --oh-font-display: Bitter, "Bookman Old Style", Georgia, serif;
  --oh-font-text: "Source Sans 3", Calibri, "Segoe UI", system-ui, -apple-system, sans-serif;

  --oh-t-xs:   0.8125rem;                          /* 13px, labels only     */
  --oh-t-sm:   0.9375rem;                          /* 15px, captions only   */
  --oh-t-base: 1.0625rem;                          /* 17px, body floor 16   */
  --oh-t-lg:   1.1875rem;
  --oh-t-xl:   clamp(1.375rem, 1.1rem + 1.1vw, 1.75rem);
  --oh-t-2xl:  clamp(1.75rem, 1.3rem + 1.9vw, 2.375rem);
  --oh-t-3xl:  clamp(2.125rem, 1.4rem + 3vw, 3.25rem);
  --oh-t-4xl:  clamp(2.375rem, 1.5rem + 3.9vw, 4.25rem);

  --oh-lh-display: 1.12;
  --oh-lh-body: 1.62;
  --oh-track-tight: -0.02em;
  --oh-track-label: 0.08em;

  /* Measure. 40rem is the v3/v4 mockup column, ~66ch at 17px. */
  --oh-measure: 40rem;
  --oh-measure-wide: 62rem;

  /* ---- Space. 4px base. ------------------------------------------------ */
  --oh-1: 0.25rem;  --oh-2: 0.5rem;   --oh-3: 0.75rem;  --oh-4: 1rem;
  --oh-5: 1.5rem;   --oh-6: 2rem;     --oh-7: 3rem;     --oh-8: 4rem;
  --oh-9: 6rem;     --oh-10: 8rem;    --oh-11: 12rem;

  --oh-section: clamp(3.5rem, 2rem + 7vw, 7.5rem);
  --oh-gutter: clamp(1.25rem, 0.5rem + 3vw, 3rem);

  /* ---- Surface. -------------------------------------------------------- */
  --oh-radius: 18px;
  --oh-radius-sm: 12px;
  --oh-radius-pill: 999px;
  --oh-shadow: 0 14px 44px -22px rgba(61, 58, 56, 0.45);
  --oh-shadow-sm: 0 6px 18px -12px rgba(61, 58, 56, 0.4);

  /* ---- Motion. Calm. --------------------------------------------------- */
  --oh-dur: 400ms;
  --oh-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --oh-rise: 12px;

  color-scheme: light;
}

/* ============================================================ base ======= */

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

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

body {
  margin: 0;
  background: var(--oh-canvas);
  color: var(--oh-ink);
  font-family: var(--oh-font-text);
  font-size: var(--oh-t-base);
  line-height: var(--oh-lh-body);
  -webkit-font-smoothing: antialiased;
  /* A page that scrolls sideways on a phone is a bug, never a design. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--oh-font-display);
  font-weight: 700;
  color: var(--oh-ink);              /* never the accent. brand-floor.md §1 */
  line-height: var(--oh-lh-display);
  letter-spacing: var(--oh-track-tight);
  text-wrap: balance;
  /* More space above a heading than below it. brand-floor.md §3. */
  margin: var(--oh-8) 0 var(--oh-4);
}
h1 { font-size: var(--oh-t-4xl); }
h2 { font-size: var(--oh-t-3xl); }
h3 { font-size: var(--oh-t-xl); }
h4 { font-size: var(--oh-t-lg); }

p, li { text-wrap: pretty; max-width: var(--oh-measure); }
p { margin: 0 0 var(--oh-4); }

a { color: var(--oh-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

:focus-visible {
  outline: 2px solid var(--oh-accent);
  outline-offset: 3px;
  border-radius: var(--oh-radius-sm);
}

/* Phones: step the hero down a rung. A 4rem headline wraps to six lines
   at 390px. brand-floor.md §2. */
@media (max-width: 700px) {
  h1 { font-size: var(--oh-t-2xl); }
  h2 { font-size: var(--oh-t-xl); }
}

/* ========================================================= structure ===== */

.oh-wrap {
  width: 100%;
  max-width: var(--oh-measure-wide);
  margin-inline: auto;
  padding-inline: var(--oh-gutter);
}
.oh-wrap--narrow { max-width: calc(var(--oh-measure) + var(--oh-gutter) * 2); }

.oh-section { padding-block: var(--oh-section); }
.oh-section + .oh-section { border-top: 1px solid var(--oh-rule); }
.oh-section > :first-child { margin-top: 0; }

.oh-lede { font-size: var(--oh-t-lg); color: var(--oh-ink-soft); }

/* Small caps label. One of these per three sections, at most. */
.oh-label {
  font-size: var(--oh-t-xs);
  letter-spacing: var(--oh-track-label);
  text-transform: uppercase;
  color: var(--oh-accent);
  font-weight: 600;
  margin: 0 0 var(--oh-3);
}

/* Sand rule. The decorative horizontal line from the brand guide. */
.oh-rule {
  border: 0;
  border-top: 2px solid var(--oh-sand);
  width: 3.5rem;
  margin: var(--oh-6) 0;
}

.oh-card {
  background: var(--oh-surface);
  border: 1px solid var(--oh-rule);
  border-radius: var(--oh-radius);
  padding: var(--oh-6);
  box-shadow: var(--oh-shadow-sm);
}

/* ============================================================ buttons ==== */

.oh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--oh-2);
  /* 48px minimum tap target on touch. */
  min-height: 48px;
  padding: var(--oh-3) var(--oh-6);
  border-radius: var(--oh-radius-pill);
  font-family: var(--oh-font-text);
  font-size: var(--oh-t-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--oh-dur) var(--oh-ease),
              color var(--oh-dur) var(--oh-ease),
              transform var(--oh-dur) var(--oh-ease);
}
/* Small solid accent fill. This is the sanctioned use of the purple. */
.oh-btn--primary { background: var(--oh-accent); color: var(--oh-surface); }
.oh-btn--primary:hover { transform: translateY(-1px); }

.oh-btn--secondary {
  background: transparent;
  color: var(--oh-ink);
  border-color: var(--oh-sand);
}
.oh-btn--secondary:hover { background: var(--oh-sand-wash); }

/* ================================================================ nav ==== */

.oh-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--oh-canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--oh-rule);
}
.oh-nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--oh-5); min-height: 68px;
}
/* The link fills the nav height so the tap target clears 44px even though the
   mark itself is 34px tall. */
.oh-nav__logo { display: flex; align-items: center; min-height: 48px; }
.oh-nav__logo img, .oh-nav__logo svg { height: 34px; width: auto; }

/* Language toggle. Two small buttons, and they still have to be tappable. */
.oh-lang { display: flex; gap: var(--oh-1); }
.oh-lang button {
  min-width: 44px; min-height: 44px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: var(--oh-t-sm); font-weight: 600;
  color: var(--oh-ink-soft);
  border-radius: var(--oh-radius-sm);
}
.oh-lang button[aria-pressed="true"] { color: var(--oh-accent); }
.oh-lang button:hover { background: var(--oh-sand-wash); }
.oh-nav__links { display: flex; align-items: center; gap: var(--oh-5); list-style: none; margin: 0; padding: 0; }
/* :not(.oh-btn) matters. Without it this rule outranks .oh-btn--primary on
   specificity and repaints the nav CTA's label in the ink, which lands at
   1.06:1 on the purple fill. The harness catches it; the exclusion prevents it. */
.oh-nav__links a:not(.oh-btn) { color: var(--oh-ink); text-decoration: none; font-size: var(--oh-t-sm); }
.oh-nav__links a:not(.oh-btn):hover { color: var(--oh-accent); }
/* The nav CTA is smaller than a section CTA, but it is still a button. */
.oh-nav__links .oh-btn { min-height: 44px; padding: var(--oh-2) var(--oh-5); }

/* The mobile menu. The current site has none below 860px and the nav simply
   vanishes. The engine ships one so no build can inherit that defect. */
.oh-nav__toggle {
  display: none;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  background: none; border: 1px solid var(--oh-rule);
  border-radius: var(--oh-radius-sm); cursor: pointer;
}
.oh-nav__toggle span {
  display: block; width: 20px; height: 2px; background: var(--oh-ink);
  position: relative;
}
.oh-nav__toggle span::before,
.oh-nav__toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--oh-ink);
}
.oh-nav__toggle span::before { top: -6px; }
.oh-nav__toggle span::after { top: 6px; }

@media (max-width: 860px) {
  .oh-nav__toggle { display: inline-flex; }
  .oh-nav__links {
    position: absolute; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--oh-canvas);
    border-bottom: 1px solid var(--oh-rule);
    padding: var(--oh-3) var(--oh-gutter) var(--oh-5);
  }
  .oh-nav__links[hidden] { display: none; }
  .oh-nav__links li { border-top: 1px solid var(--oh-rule); }
  .oh-nav__links li:first-child { border-top: 0; }
  .oh-nav__links a { display: block; padding: var(--oh-4) 0; font-size: var(--oh-t-base); }
}

/* ============================================================= reveal ==== */
/* The only motion the engine provides. 12px rise, 400ms, ease-out.
   Elements are marked [data-oh-reveal] in the markup; ohrion.js adds
   .is-in when they enter. The pre-state is applied by JS only, so a page
   with JS disabled shows everything. */

[data-oh-reveal].oh-armed {
  opacity: 0;
  transform: translateY(var(--oh-rise));
  transition: opacity var(--oh-dur) var(--oh-ease),
              transform var(--oh-dur) var(--oh-ease);
  transition-delay: var(--oh-delay, 0ms);
}
[data-oh-reveal].oh-armed.is-in { opacity: 1; transform: none; }

/* ===================================================== reduced motion ==== */
/* Everything final, immediately, no transition. Verified by the
   --reduced-motion shoot. Do not bypass this. */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-oh-reveal].oh-armed { opacity: 1; transform: none; }
}

/* ============================================================== utils ==== */

.oh-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;
}

/* Skip link. Focus order starts here. */
.oh-skip {
  position: absolute; left: var(--oh-gutter); top: -100px; z-index: 100;
  background: var(--oh-surface); color: var(--oh-ink);
  padding: var(--oh-3) var(--oh-5); border-radius: var(--oh-radius-sm);
  border: 1px solid var(--oh-rule); text-decoration: none;
}
.oh-skip:focus { top: var(--oh-3); }

/* Wide content scrolls inside its own box. The page body never does. */
.oh-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
