/* === Omnia Core — Design Tokens === */
:root {
  /* Colors — set via JS Tweaks but defaults here */
  --bg: #F2F0EB;
  --bg-inverse: #0F0F0E;
  --fg: #0F0F0E;
  --fg-muted: #6B6960;
  --fg-on-dark: #F2F0EB;
  --fg-muted-on-dark: #8A8780;
  --accent: #FF4B1F;
  --success: #4F6B28;
  --rule: rgba(15, 15, 14, 0.12);
  --rule-on-dark: rgba(242, 240, 235, 0.14);

  /* Type — defaults; Tweaks may override */
  --font-display: "Fraunces", "Times New Roman", serif;
  --font-text: "Inter Tight", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Spacing scale — Major Third 1.333 */
  --s-0: 4px;
  --s-1: 8px;
  --s-2: 11px;
  --s-3: 15px;
  --s-4: 20px;
  --s-5: 27px;
  --s-6: 36px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 85px;
  --s-10: 114px;
  --s-11: 152px;
  --s-12: 203px;

  /* Easings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  /* Container */
  --col: minmax(0, 1fr);
  --gutter: 24px;
  --pad: clamp(20px, 4vw, 56px);

  /* Image ratios */
  --ratio-portrait: 1 / 1;
}

/* Theme switches */
[data-theme="dark"] {
  --bg: #0F0F0E;
  --bg-inverse: #F2F0EB;
  --fg: #F2F0EB;
  --fg-muted: #8A8780;
  --rule: rgba(242, 240, 235, 0.14);
  --success: #A8C66C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}

body {
  min-height: 100vh;
  transition: background 600ms var(--ease-out-quart), color 600ms var(--ease-out-quart);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: none; }

/* Focus indicator — WCAG 2.4.7 / 2.4.13 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
input:focus-visible, textarea:focus-visible {
  outline-offset: 4px;
}
[role="status"]:focus-visible { outline: none; }

::selection { background: var(--accent); color: var(--bg); }

/* 12-col grid helper */
.grid {
  display: grid;
  grid-template-columns: repeat(12, var(--col));
  column-gap: var(--gutter);
  padding-left: var(--pad);
  padding-right: var(--pad);
  width: 100%;
}

/* Mono labels */
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.rule { border-top: 1px solid var(--rule); }
[data-theme="dark"] .rule { border-top-color: var(--rule-on-dark); }

/* Nav links — graue Hover-Box als Feedback */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  margin: -8px -12px;
  border-radius: 8px;
  transition: background 220ms var(--ease-out-quart), color 220ms var(--ease-out-quart);
}
.nav-link:hover {
  background: rgba(15, 15, 14, 0.06);
  color: var(--fg);
}
[data-theme="dark"] .nav-link:hover {
  background: rgba(242, 240, 235, 0.08);
  color: var(--fg-on-dark);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 720px) {
  html, body { cursor: auto; }
  button, a, input, textarea, label, [data-cursor] { cursor: auto !important; }
  button, a { cursor: pointer !important; }
  input, textarea { cursor: text !important; }

  /* Stack 12-col grid on mobile: every direct child spans full width,
     overriding inline `gridColumn` styles set in JSX. */
  .grid > * { grid-column: 1 / -1 !important; text-align: left !important; }

  /* Tighter container padding so content uses real estate */
  .grid { column-gap: 16px; padding-left: 20px; padding-right: 20px; }

  /* Reduce massive display headings so they don't blow viewport */
  h1, h2, h3 {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  /* Hide custom desktop cursor on touch */
  [data-custom-cursor] { display: none !important; }

  /* Ensure interactive targets meet 44x44 AAA */
  button, a, [role="button"] { min-height: 44px; }

  /* Section vertical rhythm tightens on mobile */
  section { padding-top: var(--s-9) !important; padding-bottom: var(--s-8) !important; }

  /* Hide elements designed for desktop only (decorative floats, hover chrome) */
  .desktop-only { display: none !important; }
}
