/* ============================================================
   UltiKnit — ultiknit.com
   Shared stylesheet. No frameworks, no build step,
   no third-party requests.
   ============================================================ */

/* --- Self-hosted Inter. Drop the woff2 into assets/fonts/ and
       it takes over; until then the system stack carries it. --- */
@font-face {
  font-family: 'InterVar';
  src: url('/assets/fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette — sourced from manifest.json and the app's own tokens */
  --forest:      #575D4A;
  --clay:        #DA9C84;
  --sage:        #A7B59E;
  --paper:       #F5F2EC;
  --card:        #FFFFFF;
  --ink:         #33362C;
  --ink-soft:    #6B6F60;
  --rule:        #DDD8D0;

  --body: 'InterVar', 'Inter', -apple-system, BlinkMacSystemFont,
          'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: Georgia, 'Times New Roman', serif;

  --measure: 34rem;   /* reading width for prose */
  --gutter: 1.5rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--forest);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}

.masthead__inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.125rem var(--gutter);
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  color: var(--forest);
  text-decoration: none;
  line-height: 1;
}

.tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--clay);
  line-height: 1;
}

.masthead__nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.masthead__nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible { color: var(--forest); }

/* ---------- Document sheet ----------
   Legal and prose pages sit on a white sheet, echoing the
   in-app legal sheets so the two read as one product.        */

.sheet {
  max-width: calc(var(--measure) + 6rem);
  margin: 2.5rem auto 4rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  padding: 2.75rem 3rem 3rem;
}

.sheet__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
  color: var(--forest);
  margin: 0;
}

.sheet__updated {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}

.sheet__rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.75rem 0 2rem;
}

/* Section headings inside a document sheet.
   Small, letterspaced, forest — carried over from the app. */
.sheet h2 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 2.25rem 0 0.625rem;
}

.sheet h2:first-of-type { margin-top: 0; }

.sheet p,
.sheet ul { max-width: var(--measure); }

.sheet p { margin: 0 0 1rem; }

.sheet ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.sheet li { margin-bottom: 0.375rem; }

.sheet strong { font-weight: 700; color: var(--forest); }

.sheet a {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}
.sheet a:hover,
.sheet a:focus-visible { color: var(--forest); }

/* ---------- Footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 2.25rem var(--gutter) 3rem;
}

.foot__inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover, .foot a:focus-visible {
  color: var(--forest);
  text-decoration: underline;
}

.foot__legal { margin-left: auto; }

/* ---------- Focus & motion floor ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ---------- Narrow screens ---------- */

@media (max-width: 40rem) {
  .sheet {
    margin: 1.25rem 0.75rem 2.5rem;
    padding: 1.75rem 1.375rem 2.25rem;
    border-radius: 1rem;
  }
  .masthead__nav { width: 100%; margin-left: 0; }
  .foot__legal { margin-left: 0; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; }
  .masthead__nav, .skip { display: none; }
  .sheet { border: 0; margin: 0; padding: 0; max-width: none; }
}
