/* =========================================================================
   Turtle Creek Aquaculture — Base styles
   Reset, typography, links, form fields, code, tables.
   ========================================================================= */

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

html {
  font-size: 100%;          /* respect user preference */
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-relaxed);
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Headings ------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-heading);
  margin: 0 0 var(--space-3);
  font-weight: var(--weight-bold);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: var(--track-h1);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semi);
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semi);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--text-h4);
  font-weight: var(--weight-semi);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}

h5 {
  font-family: var(--font-body);
  font-size: var(--text-h5);
  font-weight: var(--weight-semi);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

/* Body text ------------------------------------------------------------ */

p {
  margin: 0 0 var(--space-3);
  text-wrap: pretty;
}

.lead,
p.lead {
  font-size: var(--text-lead);
  line-height: var(--lh-normal);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

small {
  font-size: var(--text-small);
}

strong {
  font-weight: var(--weight-semi);
  color: var(--color-creek-forest);
}

em {
  font-style: italic;
}

/* Links ---------------------------------------------------------------- */

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover,
a:focus-visible {
  color: var(--color-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-river-teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Lists ---------------------------------------------------------------- */

ul, ol {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
}

li {
  margin-bottom: var(--space-1);
}

li::marker {
  color: var(--color-bank-olive);
}

/* Horizontal rule ------------------------------------------------------ */

hr {
  border: none;
  height: 1px;
  background: var(--color-rule);
  margin: var(--space-6) 0;
}

/* Code ----------------------------------------------------------------- */

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-feature-settings: "tnum" 1;
}

code {
  background: var(--color-bg-deep);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--color-creek-forest);
  font-size: 0.92em;
}

pre {
  background: var(--color-creek-forest);
  color: var(--color-cream-sand);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--lh-normal);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Blockquote ----------------------------------------------------------- */

blockquote {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--color-redfish-rust);
  background: var(--color-bg-deep);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-lead);
  line-height: var(--lh-normal);
  color: var(--color-creek-forest);
}

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

/* Tables --------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--text-small);
}

thead {
  background: var(--color-bg-deep);
}

th, td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-rule);
  vertical-align: top;
}

th {
  font-weight: var(--weight-semi);
  color: var(--color-creek-forest);
  font-size: var(--text-meta);
  letter-spacing: var(--track-meta);
  text-transform: uppercase;
}

tbody tr:hover {
  background: var(--color-bg-deep);
}

td.numeric, th.numeric {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  text-align: right;
}

/* Images --------------------------------------------------------------- */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0 0 var(--space-4);
}

figcaption {
  font-size: var(--text-meta);
  color: var(--color-meta);
  margin-top: var(--space-2);
  letter-spacing: var(--track-meta);
}

/* Forms (basic) -------------------------------------------------------- */

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: var(--color-redfish-rust);
  color: var(--color-cream-sand);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-creek-forest);
  color: var(--color-cream-sand);
  padding: var(--space-2) var(--space-3);
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}
