/* ==========================================================================
   GARY LAYN — Base
   garylayn.com/src/styles/base.css

   Global reset and element defaults.
   No classes here — only element selectors and root-level rules.
   All values derived from tokens.css.
   ========================================================================== */


/* --------------------------------------------------------------------------
   RESET
-------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  scroll-padding-top: var(--nav-height);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--stock);
  color: var(--text-on-stock);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font: inherit;
}


/* --------------------------------------------------------------------------
   TYPOGRAPHY DEFAULTS
   Headings use display font. Body uses serif. Mono used via utility class.
-------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  color: inherit;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p {
  max-width: 68ch;
}

em {
  font-style: italic;
}

strong {
  font-weight: var(--weight-bold);
}


/* --------------------------------------------------------------------------
   ACCESSIBILITY
-------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: var(--z-overlay);
  background: var(--signal);
  color: var(--ink-0);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  transition: top var(--duration-base) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

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

:focus:not(:focus-visible) {
  outline: none;
}


/* --------------------------------------------------------------------------
   LAYOUT UTILITIES
   Used in every template. Not component-specific.
-------------------------------------------------------------------------- */

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter, 1rem);
}

@media (min-width: 900px) {
  .wrap { padding: 0 var(--gutter-lg); }
}

.wrap--narrow {
  max-width: 680px;
}

.section {
  padding: var(--section-pad);
}

/* Surface modifiers */
.on-ink {
  background: var(--ink-1);
  color: var(--text-on-ink);
}

.on-ink-deep {
  background: var(--ink-0);
  color: var(--text-on-ink);
}


/* --------------------------------------------------------------------------
   FILM-STRIP SPROCKET
   Signature element. Appears at top of page and between major sections.
-------------------------------------------------------------------------- */

.sprocket {
  height: 7px;
  background-image: repeating-linear-gradient(
    to right,
    var(--stock-line) 0 7px,
    transparent 7px 20px
  );
  opacity: 0.55;
}

.sprocket.on-ink {
  background-image: repeating-linear-gradient(
    to right,
    var(--ink-line) 0 7px,
    transparent 7px 20px
  );
}


/* --------------------------------------------------------------------------
   SCROLL REVEAL
   JS adds .in when element enters viewport.
-------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-slow) var(--ease),
    transform var(--duration-slow) var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* --------------------------------------------------------------------------
   TOAST NOTIFICATION
   Appears bottom-right when clicking unbuilt page links.
-------------------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: var(--z-overlay);
  background: var(--ink-1);
  color: var(--text-on-ink);
  border: 1px solid var(--signal);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  max-width: min(90vw, 340px);
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
