/* Tauvion Technologies public site. No build step, no third-party requests.
   Two small scripts: theme.js (light/dark switch) and dial.js (the logo dial on the home page). */

/* Dark is the default for every visitor. theme.js sets data-theme="light" when a visitor switches. */
:root {
  --paper: #0e151b;
  --ink: #e3eaee;
  --muted: #98a7b2;
  --rule: #26343e;
  --tick: #4d5d69;
  --accent: #6bbfca;
  --measure: 40rem;
  --page: 64rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --paper: #f4f7f8;
  --ink: #111926; /* brand navy, from the approved logo */
  --muted: #56646f;
  --rule: #cfd8dd;
  --tick: #8d9ba6;
  --accent: #1b6c78;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.75rem;
  background: var(--paper);
  padding: 0.25rem 0.5rem;
}

/* Header and footer */

.site-header,
main {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.site-mark {
  display: block;
  width: 1.75rem;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* Light/dark switch. Hidden until theme.js runs, since it needs the script. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.5rem -0.5rem -0.5rem -0.25rem;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon,
:root[data-theme="light"] .icon-sun {
  display: none;
}

:root[data-theme="light"] .icon-moon {
  display: block;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--page) - 2 * var(--gutter)));
  margin: 5rem auto 0;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 1.5rem;
}

.site-footer a {
  color: var(--muted);
}

/* Home: the wordmark sits on an instrument scale */

.hero {
  padding-top: clamp(2rem, 8vw, 5rem);
}

.hero-logo {
  margin: 0;
  color: var(--ink);
  line-height: 0;
}

.hero-logo .logo {
  display: block;
  width: clamp(9rem, 24vw, 15rem);
  height: auto;
  overflow: visible; /* the mark's corners swing past the box when it turns */
}

/* The mark turns about the centre of its hexagon frame, in the logo's own units. */
.logo-mark {
  transform-box: view-box;
  transform-origin: 641.05px 456.8px;
}

/* The logo, and beside it a readout that appears while the dial is turned. */
.hero-figure {
  position: relative;
  width: fit-content;
}

.readout {
  position: absolute;
  top: 0;
  left: calc(100% + clamp(0.75rem, 4vw, 2.5rem));
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 0 0.6em;
  padding: 0.55em 0.8em;
  border: 1px solid var(--tick);
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: clamp(0.625rem, 1.1vw, 0.8125rem);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.readout.is-shown {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease;
}

.readout .k,
.readout .u {
  color: var(--muted);
}

.readout .v {
  min-width: 8ch;
  text-align: right;
}

.scale {
  position: relative;
  height: 1.5rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--tick);
  background:
    repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 80px) top left / 100% 1.25rem no-repeat,
    repeating-linear-gradient(to right, var(--tick) 0 1px, transparent 1px 16px) top left / 100% 0.5rem no-repeat;
}

/* The index mark. On load it slides in and settles at 61.8%.
   dial.js lets a visitor drag it; the logo mark turns with it, and both settle back on release. */
.needle {
  position: absolute;
  top: -0.6rem;
  left: 61.8%;
  width: 2px;
  height: 2.1rem;
  background: var(--accent);
  animation: settle 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* A grab area wider than the 2px line, about a fingertip across. */
.needle::before {
  content: "";
  position: absolute;
  inset: -0.5rem -1.25rem;
}

.needle,
.logo-mark {
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.scale.is-live .needle {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.hero.is-turning .needle,
.hero.is-turning .logo-mark {
  transition: none;
}

.hero.is-turning .needle {
  cursor: grabbing;
}

@keyframes settle {
  from {
    left: 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  to {
    left: 61.8%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .needle {
    animation: none;
  }

  .needle,
  .logo-mark {
    transition: none;
  }
}

.lede {
  max-width: 32ch;
  margin: 1.75rem 0 0;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Home: label + content rows */

.rows {
  margin-top: clamp(3rem, 8vw, 5rem);
}

.row {
  display: grid;
  grid-template-columns: 11rem minmax(0, var(--measure));
  gap: 0.5rem 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}

.row h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.row p {
  margin: 0;
}

.row p + p {
  margin-top: 0.75rem;
}

.pairs {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
}

.pairs dt {
  font-weight: 600;
}

.pairs dd {
  margin: 0;
}

@media (max-width: 40rem) {
  .site-nav {
    gap: 0.875rem;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .pairs {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .pairs dd + dt {
    margin-top: 0.75rem;
  }
}

/* Text pages: support, privacy, 404 */

.doc {
  padding-top: clamp(1.5rem, 6vw, 3.5rem);
}

.doc > * {
  max-width: var(--measure);
}

.doc h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.doc .meta {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.doc h2 {
  margin: 2.5rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.doc h3 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.0625rem;
}

.doc p,
.doc ul {
  margin: 0.5rem 0 0;
}

.doc ul {
  padding-left: 1.25rem;
}

.doc li + li {
  margin-top: 0.35rem;
}

@media (max-width: 30rem) {
  .wide-only {
    display: none;
  }
}

/* While the logo is at its smallest, drop one readout row so the box stays beside it. */
@media (max-width: 37.5rem) {
  .readout {
    line-height: 1.4;
  }

  .readout .opt {
    display: none;
  }
}

/* The narrowest phones: tighten the header so it stays on one line. */
@media (max-width: 22rem) {
  .site-header {
    column-gap: 0.5rem;
  }

  .site-name {
    gap: 0.45rem;
  }

  .site-nav {
    gap: 0.625rem;
  }

  .theme-toggle {
    margin-left: -0.5rem;
  }
}
