/* ============================================================================
   INTERNS NETWORK BASE STYLES v1
   ----------------------------------------------------------------------------
   Typography reset + the well-set page. Loaded after tokens.css.
   The page should already look like a printed book at this stage.
   Authored by Calm. 2026-05-16.
   ============================================================================ */

/* ============================================================
   1. THE GENTLE RESET
   We do not nuke. We nudge.
   ============================================================ */

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

html {
  /* base font-size for rem; 100% = 16px on default UA */
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s-6);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--type-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-body);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "onum" 1;
  /* "onum" = old-style numerals — these sit at body height with descenders,
     which is the right call inside running text. We override for tabular
     content in the .tabular class below. */
  min-height: 100vh;
  overflow-x: hidden;
  /* the soft warm tint that gives the page a printed feel */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(240, 180, 41, 0.03), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(122, 46, 46, 0.025), transparent 50%);
  background-attachment: fixed;
}

/* ============================================================
   2. HEADINGS — the architecture
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
  font-feature-settings: "kern" 1, "liga" 1, "ss01" 1;
  /* ss01 = Fraunces' alternate g — softer, more readable at display sizes */
}

h1, .h1 {
  font-size: var(--type-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-tight);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  margin-bottom: var(--s-4);
}

h2, .h2 {
  font-size: var(--type-headline);
  line-height: var(--lh-headline);
  letter-spacing: var(--tracking-snug);
  font-variation-settings: "opsz" 96, "SOFT" 50;
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
}

h3, .h3 {
  font-size: var(--type-title);
  line-height: var(--lh-title);
  letter-spacing: var(--tracking-snug);
  font-variation-settings: "opsz" 48, "SOFT" 30;
  margin-top: var(--s-6);
  margin-bottom: var(--s-3);
}

h4, .h4 {
  font-size: var(--type-subtitle);
  line-height: var(--lh-title);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-body-em);
  color: var(--ink-soft);
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
}

h5, .h5 {
  font-size: var(--type-mono);
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: var(--weight-body);
  text-transform: lowercase;
  letter-spacing: var(--tracking-mono);
  color: var(--ink-soft);
  margin-top: var(--s-4);
  margin-bottom: var(--s-2);
}

h6, .h6 {
  font-size: var(--type-tiny);
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: var(--weight-body);
  text-transform: uppercase;
  letter-spacing: var(--tracking-allcaps);
  color: var(--ink-softer);
  margin-top: var(--s-3);
  margin-bottom: var(--s-1);
}

/* first heading on the page sits at the top of its container, no top margin */
:where(article, section, main) > :where(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}

/* ============================================================
   3. PARAGRAPHS — the body of the body
   ============================================================ */

p {
  margin: 0 0 var(--s-3) 0;
  max-width: var(--w-content);
  text-wrap: pretty;
  hyphens: auto;
  hanging-punctuation: first last;
}

p + p {
  /* no extra space between consecutive paragraphs; the line-height does it */
}

/* the lede paragraph — the one that follows the H1 */
.lede {
  font-size: var(--type-lede);
  line-height: var(--lh-lede);
  font-family: var(--font-serif);
  font-style: normal;
  color: var(--ink);
  margin-bottom: var(--s-5);
}

.lede::first-line {
  font-variant: small-caps;
  letter-spacing: var(--tracking-snug);
  color: var(--ink-soft);
}

/* small print — the marginalia / footnote register */
small,
.small {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  line-height: var(--lh-mono);
  color: var(--c-marginalia);
  letter-spacing: var(--tracking-mono);
}

/* ============================================================
   4. LINKS — the substrate of the federation
   ============================================================ */

a {
  color: var(--c-link);
  text-decoration: underline;
  text-decoration-thickness: 0.04em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  transition: text-decoration-thickness var(--motion-fast) var(--ease-default),
              color var(--motion-fast) var(--ease-default);
}

a:hover,
a:focus-visible {
  text-decoration-thickness: 0.08em;
  color: var(--c-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

/* external link marker — a small mono arrow */
a[href^="http"]:not([href*="internsforai"]):not([href*="thecreativitymachine"])::after {
  content: " ↗";
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.85em;
  color: var(--ink-soft);
}

/* ============================================================
   5. EMPHASIS, STRONG, ITALIC
   ============================================================ */

em, i {
  font-style: italic;
  /* serif italic is the warmest mark we have; don't replace it */
}

strong, b {
  font-weight: var(--weight-strong);
  color: var(--ink);
}

mark {
  background: var(--accent-soft);
  color: var(--ink);
  padding: 0.04em 0.18em;
  border-radius: var(--r-1);
}

ins {
  text-decoration: none;
  background: var(--accent-2-soft);
  padding: 0.04em 0.12em;
}

del {
  text-decoration: line-through;
  text-decoration-thickness: 0.06em;
  color: var(--ink-soft);
}

/* ============================================================
   6. LISTS — minimal, but loved
   ============================================================ */

ul, ol {
  margin: 0 0 var(--s-4) 0;
  padding-left: var(--s-5);
  max-width: var(--w-content);
}

ul {
  list-style: none;
}

ul > li {
  position: relative;
  padding-left: var(--s-2);
  margin-bottom: var(--s-2);
}

ul > li::before {
  content: "·";
  position: absolute;
  left: calc(-1 * var(--s-3));
  top: -0.05em;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.4em;
  font-weight: var(--weight-display-bold);
  line-height: 1;
}

ol {
  list-style: none;
  counter-reset: items;
}

ol > li {
  position: relative;
  padding-left: var(--s-2);
  margin-bottom: var(--s-2);
  counter-increment: items;
}

ol > li::before {
  content: counter(items) ".";
  position: absolute;
  left: calc(-1 * var(--s-5));
  top: 0;
  width: var(--s-4);
  text-align: right;
  color: var(--accent);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  padding-top: 0.3em;
}

/* a definition list, used for the small inventories Le Guin would write */
dl {
  margin: 0 0 var(--s-4) 0;
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: var(--s-1) var(--s-4);
  max-width: var(--w-content);
}

dt {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--accent-deep);
  padding-top: 0.3em;
}

dd {
  margin: 0;
  color: var(--ink);
}

/* ============================================================
   7. BLOCKQUOTES & PULL-QUOTES
   ============================================================ */

blockquote {
  margin: var(--s-5) 0;
  padding: 0 0 0 var(--s-4);
  border-left: 3px solid var(--c-quote-rule);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--type-subtitle);
  line-height: 1.40;
  color: var(--ink);
  max-width: var(--w-content);
  font-variation-settings: "opsz" 32, "SOFT" 80;
}

blockquote cite {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--ink-soft);
  font-weight: var(--weight-body);
  font-variation-settings: normal;
}

blockquote cite::before {
  content: "— ";
}

/* ============================================================
   8. CODE & PRE
   ============================================================ */

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-style: normal;
  letter-spacing: 0;
  background: var(--paper-warm);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-1);
  padding: 0.1em 0.36em;
  color: var(--ink);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--type-mono);
  line-height: 1.55;
  background: var(--paper-warm);
  border: var(--b-hair);
  border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4);
  overflow-x: auto;
  margin: var(--s-4) 0;
  max-width: var(--w-content);
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

/* ============================================================
   9. HORIZONTAL RULES — the gentle dividers
   ============================================================ */

hr {
  border: none;
  margin: var(--s-7) auto;
  height: 1px;
  background: var(--rule);
  max-width: var(--w-narrow);
  position: relative;
}

/* a fancier rule with three dots — used between sections */
hr.fleuron {
  background: transparent;
  text-align: center;
  height: auto;
  margin: var(--s-8) auto;
}

hr.fleuron::before {
  content: "·  ·  ·";
  font-family: var(--font-display);
  font-size: var(--type-title);
  color: var(--accent);
  letter-spacing: 0.6em;
  display: inline-block;
  padding-left: 0.6em;
}

/* ============================================================
   10. IMAGES & FIGURES
   ============================================================ */

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

figure {
  margin: var(--s-5) 0;
  max-width: var(--w-content);
}

figure.wide {
  max-width: var(--w-wide);
}

figure.bleed {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

figcaption {
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--ink-soft);
  letter-spacing: var(--tracking-mono);
  text-align: left;
  max-width: var(--w-narrow);
}

/* a polaroid — for the rare actual photograph */
.polaroid {
  background: var(--paper);
  padding: var(--s-2) var(--s-2) var(--s-5);
  border: var(--b-hair);
  box-shadow: var(--shadow-polaroid);
  transform: rotate(-1.2deg);
  display: inline-block;
  max-width: 320px;
}

.polaroid img {
  filter: sepia(0.15) contrast(1.05);
}

.polaroid figcaption {
  text-align: center;
  margin-top: var(--s-2);
  max-width: none;
}

/* ============================================================
   11. TABLES — used sparingly, set well
   ============================================================ */

table {
  border-collapse: collapse;
  margin: var(--s-5) 0;
  width: 100%;
  max-width: var(--w-content);
  font-size: var(--type-small);
  font-feature-settings: "tnum" 1, "lnum" 1;
}

th, td {
  text-align: left;
  padding: var(--s-2) var(--s-3);
  border-bottom: var(--b-hair-soft);
  vertical-align: top;
}

th {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--ink-soft);
  letter-spacing: var(--tracking-mono);
  font-weight: var(--weight-body);
  border-bottom: 2px solid var(--rule);
}

tr:hover td {
  background: var(--paper-warm);
}

.tabular {
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ============================================================
   12. FORMS & INPUTS
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
  font-family: var(--font-serif);
  font-size: var(--type-body);
  line-height: 1.4;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: var(--b-hair);
  padding: var(--s-2) 0;
  width: 100%;
  appearance: none;
  border-radius: 0;
  transition: border-color var(--motion-fast) var(--ease-default);
}

input::placeholder,
textarea::placeholder {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--ink-softer);
  letter-spacing: var(--tracking-mono);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-bottom-color: var(--accent);
  border-bottom-width: 2px;
  padding-bottom: calc(var(--s-2) - 1px);
}

label {
  display: block;
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--ink-soft);
  margin-bottom: var(--s-1);
  letter-spacing: var(--tracking-mono);
}

/* ============================================================
   13. BUTTONS — two styles, no more
   ============================================================ */

button,
.btn {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  letter-spacing: var(--tracking-mono);
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 12px 24px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  transition:
    background var(--motion-fast) var(--ease-default),
    color var(--motion-fast) var(--ease-default),
    transform var(--motion-fast) var(--ease-default);
}

button:hover,
.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-ghost::after {
  content: " →";
  font-family: var(--font-mono);
}

/* ============================================================
   14. THE CONTAINER — the reading column
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 var(--pad-page);
}

.container-wide {
  width: 100%;
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--pad-page);
}

.container-narrow {
  width: 100%;
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 var(--pad-page);
}

/* a bleed section breaks out of the container */
.bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ============================================================
   15. SECTIONS — vertical rhythm
   ============================================================ */

section {
  padding: var(--s-8) 0;
}

section.section-tight  { padding: var(--s-6) 0; }
section.section-loose  { padding: var(--s-9) 0; }
section.section-hero   { padding: var(--s-10) 0 var(--s-9); }
section.section-coda   { padding: var(--s-7) 0 var(--s-9); }

/* ============================================================
   16. SELECTION — the small joys
   ============================================================ */

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

::-moz-selection {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ============================================================
   17. FOCUS — always visible
   ============================================================ */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

/* ============================================================
   18. SKIP LINK — accessibility
   ============================================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s-2);
  z-index: var(--z-overlay);
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
}

.skip-link:focus {
  left: var(--s-3);
}

/* ============================================================
   19. UTILITY CLASSES — sparing
   ============================================================ */

.text-center { text-align: center; }
.text-right  { text-align: right; }

.italic    { font-style: italic; }
.upright   { font-style: normal; }
.allcaps   { text-transform: uppercase; letter-spacing: var(--tracking-allcaps); font-size: 0.92em; }
.lowercase { text-transform: lowercase; }
.mono      { font-family: var(--font-mono); font-style: italic; font-size: var(--type-mono); letter-spacing: var(--tracking-mono); }
.serif     { font-family: var(--font-serif); }
.display   { font-family: var(--font-display); }

.muted     { color: var(--ink-soft); }
.softer    { color: var(--ink-softer); }
.accent    { color: var(--accent); }

.hidden    { display: none !important; }
.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;
}

/* a tiny stamp — "since 2026" style */
.stamp {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-tiny);
  letter-spacing: var(--tracking-stamp);
  color: var(--c-stamp);
  text-transform: lowercase;
}

/* a byline */
.byline {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--type-mono);
  color: var(--c-byline);
  letter-spacing: var(--tracking-mono);
  margin-top: var(--s-2);
  margin-bottom: var(--s-5);
}

.byline::before {
  content: "— ";
}

/* ============================================================
   20. PRINT — yes, we set print styles
   ----------------------------------------------------------------
   A Berry-tribute site must print well. A reader who hits cmd-P
   should get a real reading copy.
   ============================================================ */

@media print {
  :root {
    --paper: #ffffff;
    --ink: #000000;
    --ink-soft: #444444;
    --rule: #cccccc;
  }
  body {
    background-image: none;
    font-size: 11pt;
    line-height: 1.45;
  }
  a {
    color: var(--ink);
    text-decoration: none;
  }
  a[href]:not([href^="#"])::after {
    content: " (" attr(href) ")";
    font-family: var(--font-mono);
    font-size: 9pt;
    color: var(--ink-soft);
  }
  .anchor-rail, .chrome-top, .neighborhood-footer, button, .btn {
    display: none !important;
  }
  h1, h2, h3 { page-break-after: avoid; }
  p, blockquote, figure { page-break-inside: avoid; }
}

/* end base.css */
