/* =========================================================================
   Sophotonics - pre-launch splash styles
   Brand tokens, reset, single-page layout, accessibility utilities.
   ========================================================================= */

:root {
  /* Brand */
  --so-orange: #E8A33D;
  --so-orange-dark: #C48224;
  --so-grey: #9C9C9C;
  --so-grey-dark: #6B6B6B;
  --so-ink: #1C1C1C;
  --so-paper: #FFFFFF;
  --so-paper-alt: #F5F5F4;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Radius / shadow / type */
  --radius-sm: 4px;
  --radius-lg: 16px;
  --shadow-2: 0 4px 12px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* High-contrast overrides (toggled by a11y toolbar) */
.hc {
  --so-ink: #000000;
  --so-grey: #444444;
  --so-grey-dark: #222222;
  --so-paper: #FFFFFF;
  --so-paper-alt: #FFFFFF;
  --so-orange: #B36F00;
  --so-orange-dark: #8C5500;
}
.hc * { border-color: #000 !important; }

/* Reduced motion (toggled by a11y toolbar) */
.rm *, .rm *::before, .rm *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--so-ink);
  background: var(--so-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: var(--so-orange-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--so-ink); }
h1, h2 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }

/* ----- Accessibility utilities ----- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  /* Parked fully above the viewport. translateY is relative to the link's own
     height, so it stays hidden at any root font size (the a11y text-size
     control scales <html>); a fixed negative top in px does not. */
  position: absolute; top: 0; left: var(--space-4);
  transform: translateY(-200%);
  background: var(--so-ink); color: #fff; padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); z-index: 1000; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); transform: translateY(0); }
:focus-visible {
  outline: 3px solid var(--so-orange-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ----- Splash ----- */
.splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-7) var(--space-4) var(--space-6);
  width: min(100% - 2rem, 44rem);
  margin-inline: auto;
}
.splash__brand { display: block;
		width: min(100%, 30rem); }
.splash__logo { width: min(100%, 30rem);
  text-wrap: balance; }

.splash__line {
  font-size: clamp(1.05rem, 0.5vw + 1rem, 1.3rem);
  max-width: 34rem;
  text-wrap: balance;
}
.splash__soon {
  font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; color: var(--so-grey-dark);
}

.splash__contact {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-3) var(--space-5);
  font-weight: 600;
}
.splash__contact a { word-break: break-word; }

.splash__legal {
  margin-top: auto;
  padding-top: var(--space-6);
  font-size: .85rem;
  color: var(--so-grey-dark);
}

/* ----- Accessibility toolbar ----- */
.a11y-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--so-ink); color: var(--so-orange);
  border: 2px solid var(--so-orange);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
}
.a11y-fab:hover { background: var(--so-orange); color: var(--so-ink); }

.a11y-panel {
  position: fixed; right: 1rem; bottom: 4.5rem; z-index: 61;
  background: var(--so-paper);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  width: min(20rem, calc(100vw - 2rem));
  padding: var(--space-5);
  text-align: left;
  display: none;
}
.a11y-panel[aria-hidden="false"] { display: block; }
.a11y-panel h2 { font-size: 1rem; line-height: 1.2; margin: 0 0 var(--space-4); }
.a11y-panel .a11y-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.a11y-panel .a11y-row:last-child { margin-bottom: 0; }
.a11y-panel button {
  background: var(--so-paper-alt); color: var(--so-ink);
  border: 1px solid var(--so-grey);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-weight: 600;
}
.a11y-panel button[aria-pressed="true"] {
  background: var(--so-orange); border-color: var(--so-orange-dark);
}
.a11y-panel .a11y-group { display: inline-flex; gap: var(--space-2); }
.a11y-panel .a11y-close {
  background: transparent; border: none; font-weight: 600; color: var(--so-grey-dark);
  margin-top: var(--space-3);
}

/* Print: hide chrome */
@media print {
  .a11y-fab, .a11y-panel { display: none !important; }
  a { color: var(--so-ink); text-decoration: underline; }
  .splash { min-height: 0; }
}

/* Honour OS-level reduced motion in addition to .rm */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
