/* ==========================================================================
   SkillFORGE — site styles
   Tokens first, so future pages share the same look and feel.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/archivo-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wght-italic.woff2") format("woff2-variations"),
       url("/assets/fonts/archivo-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Colour */
  --c-deep: #020a1c;
  --c-mid: #073a5c;
  --c-lit: #3a95b2;
  --c-text: #ffffff;
  --c-text-soft: rgba(255, 255, 255, 0.92);
  --c-glass: rgba(6, 30, 52, 0.55);
  --c-glass-border: rgba(170, 225, 255, 0.22);
  --c-accent: #8fdcff;

  /* Type */
  --f-sans: "Archivo", "Aptos Display", "Segoe UI", system-ui, sans-serif;
  --shadow-text: 0 3px 10px rgba(0, 12, 30, 0.55), 0 1px 2px rgba(0, 12, 30, 0.45);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Cursor: a small air-bubble ring (and a smaller one while pressed) */
  --cursor-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='9' fill='rgba(170,225,255,0.07)' stroke='rgba(0,16,36,0.3)' stroke-width='3'/%3E%3Ccircle cx='14' cy='14' r='9' fill='none' stroke='rgba(225,246,255,0.8)' stroke-width='1.2'/%3E%3Ccircle cx='10.8' cy='10.4' r='1.4' fill='rgba(255,255,255,0.85)'/%3E%3C/svg%3E") 14 14, auto;
  --cursor-ring-pressed: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='6.5' fill='rgba(170,225,255,0.14)' stroke='rgba(0,16,36,0.3)' stroke-width='3'/%3E%3Ccircle cx='14' cy='14' r='6.5' fill='none' stroke='rgba(240,250,255,0.95)' stroke-width='1.3'/%3E%3Ccircle cx='12' cy='11.6' r='1.2' fill='%23fff'/%3E%3C/svg%3E") 14 14, auto;

  /* Parallax offsets, written by JS */
  --px: 0px;
  --py: 0px;
}

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

html, body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--f-sans);
  color: var(--c-text);
  /* Static fallback ocean — also visible before WebGL starts */
  background:
    radial-gradient(ellipse 70% 85% at 50% -8%, var(--c-lit) 0%, var(--c-mid) 38%, var(--c-deep) 85%),
    var(--c-deep);
  -webkit-tap-highlight-color: transparent;
  cursor: var(--cursor-ring);
}
body:active { cursor: var(--cursor-ring-pressed); }

/* ---------- Ocean ---------- */
.ocean {
  position: fixed;
  inset: 0;
  z-index: 0;
  touch-action: none;             /* press-and-hold on touch screens releases air, not scroll */
  -webkit-touch-callout: none;
}
.ocean__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Hero / brand ---------- */
.hero {
  position: fixed;
  left: 50%;
  top: 74%;                       /* centred in the lower third */
  z-index: 1;
  transform: translate(-50%, -50%) translate3d(var(--px), var(--py), 0);
  text-align: center;
  pointer-events: none;           /* clicks pass through to the water */
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  background: transparent;
}

.brand {
  margin: 0;
  line-height: 0.9;
  font-size: clamp(3.4rem, 12vw, 9.5rem);
  text-shadow: var(--shadow-text);
  letter-spacing: -0.035em;
}
.brand__skill {
  font-weight: 850;
  font-style: normal;
}
.brand__forge {
  font-size: 0.74em;
  font-weight: 380;
  font-style: italic;
  letter-spacing: 0.005em;
  margin-left: 0.04em;
}

.tagline {
  margin: 0.55em 0 0;
  font-size: clamp(1.05rem, 3.35vw, 2.65rem);
  font-weight: 380;
  letter-spacing: 0.005em;
  color: var(--c-text-soft);
  text-shadow: var(--shadow-text);
}

/* ---------- Settings (gear + panel) ---------- */
.settings {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 10;
  cursor: auto;
}

.settings__toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--c-glass-border);
  border-radius: 50%;
  background: var(--c-glass);
  color: var(--c-text);
  opacity: 0.6;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s, transform 0.4s var(--ease-out);
}
.settings__toggle:hover,
.settings__toggle:focus-visible,
.settings__toggle[aria-expanded="true"] { opacity: 1; }
.settings__toggle[aria-expanded="true"] { transform: rotate(60deg); }
.settings__toggle:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

.settings__panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: min(280px, calc(100vw - 2rem));
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--c-glass-border);
  border-radius: 14px;
  background: var(--c-glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 12px 40px rgba(0, 8, 24, 0.45);
  font-size: 0.9rem;
  animation: panel-in 0.25s var(--ease-out);
}
.settings__panel[hidden] { display: none; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.settings__title {
  margin: 0 0 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.settings__group {
  margin: 0 0 0.95rem;
  padding: 0;
  border: 0;
}
.settings__group legend,
.settings__label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0;
  font-weight: 500;
}
.settings__label output { color: var(--c-accent); font-variant-numeric: tabular-nums; }

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: rgba(0, 10, 25, 0.45);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented span {
  display: block;
  padding: 0.4rem 0;
  border-radius: 7px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.2s, color 0.2s;
}
.segmented input:checked + span {
  background: rgba(143, 220, 255, 0.22);
  color: #fff;
}
.segmented input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 1px; }

/* Range sliders */
input[type="range"] {
  width: 100%;
  margin: 0.2rem 0 0;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.settings__reset {
  margin-top: 0.1rem;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.settings__reset:hover { color: #fff; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .settings__panel { animation: none; }
  .settings__toggle { transition: none; }
}
