/* felipefahl.dev — engineering notebook. Tokens: see docs/DESIGN.md */

/* Self-hosted fonts (SIL OFL 1.1), latin subset, variable weight */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/source-sans-3-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #F4F1EA;
  --ink: #1C1B19;
  --graphite: #6B675F;
  --rule: #D9D3C7;
  --oxide: #A33A24;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --measure: 68ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1917;
    --ink: #ECE7DD;
    --graphite: #A39E94;
    --rule: #34312C;
    --oxide: #D9694F;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--oxide);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--oxide); outline-offset: 3px; }

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a {
  color: var(--graphite);
  text-decoration: none;
  font-size: 1rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--oxide);
}

/* Type */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: var(--measure); }

.mono {
  font-family: var(--mono);
  font-size: 0.85em;
  letter-spacing: 0;
}
.muted { color: var(--graphite); }

/* Intro */
.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding: clamp(3rem, 8vw, 6rem) 0 3rem;
}
.intro .lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  line-height: 1.45;
  margin-top: 1.25rem;
}
.intro .meta { margin-top: 1.5rem; }

.portrait {
  margin: 0;
  width: 100%;
  max-width: 10rem;
}
.portrait img,
.portrait .placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.portrait .placeholder {
  display: grid;
  place-items: center;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 0.8rem;
  background: repeating-linear-gradient(
    -45deg, transparent 0 8px, var(--rule) 8px 9px
  );
}

@media (min-width: 48rem) {
  .intro { grid-template-columns: 1fr 14rem; align-items: start; }
  .portrait { max-width: none; }
}

/* Sections */
.section {
  border-top: 1px solid var(--rule);
  padding: 3rem 0;
}
.section > h2 { margin-bottom: 1.5rem; }
.section-label {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--graphite);
  margin: 0 0 0.5rem;
}

/* Facts list */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.facts li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.facts li:last-child { border-bottom: 0; }

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline > li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.timeline > li:last-child { border-bottom: 0; }
.timeline .when {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--graphite);
  padding-top: 0.25rem;
}
.timeline .org { color: var(--graphite); margin: 0.25rem 0 0.5rem; }
.timeline p:last-child { margin-bottom: 0; }

@media (min-width: 48rem) {
  .timeline > li { grid-template-columns: 11rem 1fr; }
}

/* Contact */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font-size: 0.9rem;
  color: var(--graphite);
}
.site-footer p { margin: 0; max-width: none; }

/* Draft markers: remove before publishing */
.todo {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--oxide);
  border: 1px dashed var(--oxide);
  padding: 0 0.3em;
}
