/* =========================================================
   COREWORKS STUDIO — theme.css
   Design tokens, resets, base typography.
   ========================================================= */

/* ---------------------------------------------------------
   Self-hosted fonts (Space Grotesk, Inter, JetBrains Mono)
   --------------------------------------------------------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  /* --- Color: ink & surfaces (near-black, not flat #000) --- */
  --ink:            #08080a;
  --ink-raised:     #131316;
  --ink-raised-2:   #1b1b20;
  --ink-overlay:    rgba(6, 6, 8, 0.82);

  /* --- Color: type --- */
  --paper:          #f3f1ea;
  --paper-dim:      #a7a49c;
  --paper-faint:    #6c6963;

  /* --- Color: gold accent (sampled from the CoreWorks mark — used sparingly) --- */
  --gold:           #c6994a;
  --gold-bright:    #ddb56a;
  --gold-dim:       #8f7038;
  --gold-wash:      rgba(198, 153, 74, 0.10);

  /* --- Hairlines --- */
  --line:           rgba(255, 255, 255, 0.09);
  --line-strong:    rgba(255, 255, 255, 0.16);
  --line-gold:      rgba(198, 153, 74, 0.35);

  /* --- Type families --- */
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* --- Type scale --- */
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.375rem;
  --text-xl:   1.85rem;
  --text-2xl:  clamp(1.9rem, 1.5rem + 1.8vw, 2.75rem);
  --text-3xl:  clamp(2.4rem, 1.7rem + 3vw, 3.75rem);
  --text-4xl:  clamp(2.9rem, 1.7rem + 4vw, 4.75rem);

  /* --- Spacing scale --- */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-8:  3rem;
  --sp-10: 4rem;
  --sp-12: 5rem;
  --sp-14: 6.5rem;
  --sp-16: 8rem;

  /* --- Layout --- */
  --container: 1320px;
  --gutter: clamp(1.25rem, 4.5vw, 4rem);
  --radius-sm: 2px;
  --radius-md: 3px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 220ms;
  --dur-med: 480ms;
  --dur-slow: 760ms;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

button { background: none; border: none; cursor: pointer; }

::selection { background: var(--gold-dim); color: var(--paper); }

/* Focus visibility — accessible, but not intrusive on mouse users */
:focus { outline: none; }
:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   Base typography
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.lede {
  color: var(--paper-dim);
  font-size: var(--text-md);
  line-height: 1.7;
  max-width: 46ch;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--sp-14);
}

@media (max-width: 720px) {
  .section { padding-block: var(--sp-10); }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  background: var(--gold);
  color: var(--ink);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  z-index: 200;
  transition: top var(--dur-fast) var(--ease);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--sp-4); }

/* =========================================================
   Reveal-on-scroll (subtle — respects reduced motion)
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
html.no-js .reveal { opacity: 1; transform: none; }
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-group > * { transition-delay: calc(var(--stagger, 0) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
