/* ============================================================
   MYKO — BASE
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
  font-feature-settings: "ss01", "ss02", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
  letter-spacing: var(--tr-tight);
  line-height: var(--lh-tight);
  color: var(--ink);
}

h1 { font-size: var(--fs-4xl); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-3xl); font-weight: 500; letter-spacing: -0.025em; }
h3 { font-size: var(--fs-2xl); font-weight: 500; line-height: var(--lh-snug); }
h4 { font-size: var(--fs-xl); font-weight: 500; line-height: var(--lh-snug); }
h5 { font-size: var(--fs-lg); font-weight: 500; }
h6 { font-size: var(--fs-base); font-weight: 500; }

p {
  margin: 0 0 var(--s-4);
  max-width: 68ch;
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--fresh);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

a:hover {
  text-decoration-color: var(--ink);
  color: var(--fresh-deep);
}

strong, b {
  font-weight: 600;
}

/* Utilities */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.wrap-text {
  max-width: var(--wrap-text);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.wrap-narrow {
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

@media (max-width: 640px) {
  .wrap, .wrap-text, .wrap-narrow {
    padding: 0 var(--s-5);
  }
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tr-mono);
  color: var(--steel);
  text-transform: uppercase;
  font-weight: 400;
}

.mono-lg {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-mono);
  color: var(--steel);
  font-weight: 400;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--fresh);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-4);
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
  border-radius: var(--r-md);
  z-index: 100;
}

.skip-link:focus {
  top: var(--s-4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Section rhythm */
.section {
  padding: var(--s-10) 0;
}

.section-tight { padding: var(--s-8) 0; }
.section-loose { padding: var(--s-11) 0; }

.section-line {
  border-top: var(--hairline) solid var(--ash);
}

/* Ink-inverted section for accents */
.ink-section {
  background: var(--ink);
  color: var(--paper);
}
.ink-section h1, .ink-section h2, .ink-section h3,
.ink-section h4, .ink-section h5, .ink-section h6 { color: var(--paper); }
.ink-section .mono, .ink-section .mono-lg { color: var(--steel-soft); }
.ink-section a { color: var(--paper); text-decoration-color: var(--fresh); }
.ink-section a:hover { text-decoration-color: var(--paper); color: var(--paper); }
