/* ABOUTME: Site-wide styles for Medidental (medidentsupplies.com).
   ABOUTME: Hand-maintained during Phase 0; becomes a src/ passthrough asset in Phase 2. */

/* Palette is drawn from the subject: the pale blue-green film of a sterilization
   pouch, its dark print, and the brown of a processed indicator strip. */
:root {
  /* Tell the UA our palette covers both themes, so native chrome (scrollbars, and any form
     control Phase 2 introduces) stops assuming light. */
  color-scheme: light dark;

  --paper:     #f2f4f1;
  --paper-2:   #e8ebe6;
  --film:      #cbdbd4;
  --ink:       #16201d;
  --ink-muted: #5c6863;
  --rule:      #c3ccc6;
  --indicator: #7a4232;

  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-text: "Iowan Old Style", Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #101512;
    --paper-2:   #171e1a;
    --film:      #2c3b36;
    --ink:       #e6ebe7;
    --ink-muted: #93a09a;
    --rule:      #2c3733;
    --indicator: #d99377;
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  padding: clamp(2.5rem, 10vh, 7rem) clamp(1.5rem, 6vw, 3rem) 3rem;
  display: flex;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.page { width: 100%; max-width: 34rem; }

::selection { background: var(--film); color: var(--ink); }

a {
  color: var(--indicator);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 150ms ease;
}
a:hover { color: var(--ink); }
a:focus-visible {
  outline: 2px solid var(--indicator);
  outline-offset: 3px;
  border-radius: 2px;
}

.wordmark {
  margin: 0 0 clamp(2.25rem, 8vh, 4rem);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.6rem, 5.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

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

.note { color: var(--ink-muted); }

/* The signature element: a blank service record. The site's whole promise is
   three facts per part, and none of them are filled in yet. */
.specimen {
  margin: clamp(2.25rem, 7vh, 3.25rem) 0;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--paper-2);
  border-left: 2px solid var(--film);
}

.specimen__fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 1.5rem;
}
@media (min-width: 34rem) {
  .specimen__fields { grid-template-columns: repeat(3, 1fr); }
}

.field__label {
  display: block;
  margin-bottom: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field__rule {
  display: block;
  height: 1px;
  background: var(--ink-muted);
  transform: scaleX(0);
  transform-origin: left center;
  animation: draw 720ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.field:nth-child(1) .field__rule { animation-delay: 260ms; }
.field:nth-child(2) .field__rule { animation-delay: 420ms; }
.field:nth-child(3) .field__rule { animation-delay: 580ms; }

.specimen__caption {
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

.site-footer {
  margin-top: clamp(3rem, 10vh, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.home-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page > * { animation: rise 620ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.page > *:nth-child(1) { animation-delay: 0ms; }
.page > *:nth-child(2) { animation-delay: 70ms; }
.page > *:nth-child(3) { animation-delay: 140ms; }
.page > *:nth-child(4) { animation-delay: 210ms; }
.page > *:nth-child(5) { animation-delay: 280ms; }
.page > *:nth-child(6) { animation-delay: 350ms; }
/* Both pages have six children today. The Phase 2 generator may write more; without this they
   would silently fall back to 0ms and pop in alongside the first element. */
.page > *:nth-child(n+7) { animation-delay: 420ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes draw {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .page > * { animation: none; }
  .field__rule { animation: none; transform: none; }
}
