/* =============================================================================
   discrepancies.eu — personal portfolio
   Design tokens & patterns carried over from the original site's
   design/landing.html so the portfolio stays visually of a piece with the
   projects it links to.
   ============================================================================= */

:root {
  --ink: #1a1a1e;
  --paper: #f7f5f0;
  --paper-dark: #ece8df;
  --warm: #8b7355;
  --warm-light: #b09a7a;
  --warm-faint: rgba(139, 115, 85, 0.08);
  --accent: #c4553a;
  --text: #3a3a3c;
  --text-light: #6b6b70;
  --rule: rgba(26, 26, 30, 0.12);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ─────────────────────────── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .nav-links a {
  font-size: 0.82rem;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  transition: color 0.2s;
}

nav .nav-links a:hover { color: var(--ink); }

/* ── Hero ────────────────────────────────── */

.hero {
  padding: 11rem 2.5rem 5rem;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-overline {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--warm);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.75rem;
}

.hero-subtitle {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--warm);
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.hero-attribution {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-light);
  margin-top: 0.9rem;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 2.5rem auto 0;
  line-height: 1.8;
  font-weight: 300;
}

/* ── Sections ────────────────────────────── */

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2.5rem;
}

.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--warm);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-align: center;
}

.section-intro {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 400;
  color: var(--warm);
  line-height: 1.5;
}

/* ── Tool groups (US / Europe / Foundational) ─────── */

.tool-group { margin-bottom: 3rem; }
.tool-group:last-child { margin-bottom: 0; }

.group-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

/* ── About ───────────────────────────────── */

.about-inner { max-width: 640px; margin: 0 auto; }

.about-inner p {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text);
  font-weight: 300;
}
.about-inner p + p { margin-top: 1.4rem; }

.about-inner .about-cv {
  margin-top: 1.9rem;
  font-size: 0.95rem;
  color: var(--text-light);
}
.about-inner .about-cv a { color: var(--accent); text-decoration: none; }
.about-inner .about-cv a:hover { text-decoration: underline; }

/* ── Projects grid ───────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Groups of three (US / Europe tool rows, the writing row). */
.projects-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* A single foundational card spans the full width. */
.project-card.feature { grid-column: 1 / -1; }

.project-card {
  display: flex;
  flex-direction: column;
  /* Keep equal grid columns even when a card's content (e.g. the nowrap URL
     line) is wide — without this, min-width:auto lets a track outgrow its 1fr. */
  min-width: 0;
  border: 1px solid var(--rule);
  background: #fbfaf7;
  padding: 2rem 2.2rem 1.8rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 26, 30, 0.07);
}

/* Non-linked cards (no destination yet) shouldn't imply a click target. */
.project-card.is-static { cursor: default; }
.project-card.is-static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--rule);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.project-card h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.status {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--rule);
  color: var(--text-light);
  white-space: nowrap;
}

.status.live { color: #2f6b3d; border-color: rgba(47, 107, 61, 0.35); }
.status.archived { color: var(--warm); border-color: var(--warm-light); }
.status.desktop { color: var(--text-light); }
.status.soon { color: var(--accent); border-color: rgba(196, 85, 58, 0.35); }
.status.preview { color: var(--warm); border-color: var(--warm-light); }
.status.cadence { color: var(--warm); border-color: var(--warm-light); }

.project-card p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  flex-grow: 1;
}

.project-link {
  margin-top: 1.4rem;
  font-family: var(--mono);
  /* Sized so the longest tool URL (edgar-explorer.discrepancies.eu) stays on
     one line within a 3-up card, matching the shorter ones; nowrap keeps the
     trailing arrow from ever dropping to its own line. */
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--warm);
  transition: color 0.2s;
}

.project-card:hover .project-link { color: var(--accent); }
.project-link .arrow { transition: transform 0.2s; display: inline-block; }
.project-card:hover .project-link .arrow { transform: translateX(4px); }

/* ── Footer ──────────────────────────────── */

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2.5rem 4rem;
  border-top: 1px solid var(--rule);
  color: var(--text-light);
}

.footer-disclaimer {
  max-width: 820px;
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.footer-disclaimer strong { color: var(--text); font-weight: 500; }
.footer-disclaimer a { text-decoration: underline; text-underline-offset: 2px; }

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
}

footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: var(--ink); }

footer .footer-links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 980px) {
  .projects-grid.grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .hero { padding: 9rem 1.5rem 3.5rem; }
  .hero h1 { font-size: 2.8rem; }
  .hero-subtitle { font-size: 1.2rem; }
  section { padding: 3rem 1.5rem; }
  .projects-grid,
  .projects-grid.grid-3 { grid-template-columns: 1fr; }
  .section-intro { font-size: 1.15rem; }
  nav .nav-links { display: none; }
  footer { flex-direction: column; align-items: flex-start; }
  .article { padding: 8rem 1.5rem 3rem; }
  .article h1 { font-size: 2.2rem; }
  .holdings-table { font-size: 0.82rem; }
  .holdings-table th, .holdings-table td { padding: 0.6rem 0.5rem; }
}

/* =============================================================================
   Shared page furniture used by the sub-pages
   (/portfolio, /case-studies, /essays and the article templates).
   ============================================================================= */

/* ── Thesis band ─────────────────────────── */

.thesis {
  max-width: 760px;
  text-align: center;
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.thesis p {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
}

/* ── Sub-page header (case studies / essays / portfolio index) ── */

.page-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 9rem 2.5rem 2rem;
  text-align: center;
}

.page-header .hero-overline { margin-bottom: 1.5rem; }

.page-header h1 {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--text-light);
  font-weight: 300;
  line-height: 1.8;
}

.back-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ── Listing (posts in case-studies / essays) ── */

.post-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
  list-style: none;
}

.post-list li { border-top: 1px solid var(--rule); }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }

.post-list a {
  display: block;
  padding: 2rem 0;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.2s;
}
.post-list a:hover { padding-left: 0.5rem; }

.post-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 0.5rem;
}

.post-list h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.post-list p {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 300;
}

.empty-note {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2.5rem 5rem;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.25rem;
}

/* ── Long-form article (individual case study / essay) ── */

.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 9rem 2.5rem 4rem;
}

.article-head { margin-bottom: 3rem; }

.article .article-overline {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--warm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.article h1 {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.article .byline {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 300;
}

.prose > * + * { margin-top: 1.5rem; }

.prose h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 3rem;
}

.prose h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin-top: 2rem;
}

.prose p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: 0.5rem; font-weight: 300; line-height: 1.75; }

.prose blockquote {
  border-left: 2px solid var(--warm-light);
  padding-left: 1.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--warm);
  line-height: 1.5;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* Citation line under a pulled quote (AI policy). */
.prose .quote-cite {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--text-light);
  margin-top: 0.85rem;
}
.prose .quote-cite a { color: var(--text-light); text-decoration: underline; }

/* Address block in the Impressum. */
.prose address {
  font-style: normal;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.7;
}

/* “The app at work” callout — the closed loop between tools and writing. */
.app-note {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--warm-faint);
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
}

.app-note .app-note-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.app-note p { font-size: 0.98rem; line-height: 1.7; color: var(--text); font-weight: 300; }
.app-note p + p { margin-top: 0.8rem; }

/* ── Markdown-generated prose (tables, code, images, footnotes) ── */
/* These style what build.py emits from Markdown, in both articles and the
   portfolio commentary. Table alignment comes from inline styles Markdown adds. */

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.5rem 0;
}
.prose thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light);
  border-bottom: 1px solid var(--ink);
  padding: 0.55rem 0.8rem;
  text-align: left;
}
.prose tbody td {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0.8rem;
  font-weight: 300;
}
.prose td[style*="right"], .prose th[style*="right"] { font-variant-numeric: tabular-nums; }

.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--warm-faint);
  padding: 0.1rem 0.35rem;
}
.prose pre {
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; }

.prose img { max-width: 100%; height: auto; }

.prose sup { font-size: 0.72em; }
.prose .footnote {
  margin-top: 3rem;
  padding-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}
.prose .footnote hr { margin: 0 0 1rem; }
.prose .footnote ol { padding-left: 1.2rem; }
.prose .footnote li { font-weight: 300; }
.prose .footnote p { font-size: 0.85rem; line-height: 1.6; }

/* ── Portfolio commentary (dated Markdown entries) ── */

.commentary-entry {
  max-width: 760px;
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
  margin-top: 1.75rem;
}
.commentary-entry:first-of-type { border-top: none; padding-top: 0; margin-top: 0.5rem; }
.commentary-entry .post-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 0.5rem;
}
.commentary-entry h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

/* ── Portfolio tables & rules ─────────────── */

.portfolio-section { max-width: 900px; }

.portfolio-section h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2.5rem;
  border: 1px solid var(--rule);
  background: #fbfaf7;
  padding: 2rem 2.2rem;
}

.rule-item .rule-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: 0.35rem;
}
.rule-item .rule-value { font-size: 1rem; color: var(--ink); font-weight: 400; }

.perf-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 2rem 0;
}

.perf-item .perf-value {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.perf-item .perf-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.holdings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.holdings-table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm);
  text-align: left;
  font-weight: 400;
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.holdings-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
  font-weight: 300;
  vertical-align: top;
}

.holdings-table td.num { font-variant-numeric: tabular-nums; }
.holdings-table .pos { color: #2f6b3d; }
.holdings-table .neg { color: var(--accent); }
.holdings-table a { color: var(--accent); text-decoration: none; }
.holdings-table a:hover { text-decoration: underline; }

.table-scroll { overflow-x: auto; }

.table-empty {
  padding: 1.5rem 0.75rem;
  color: var(--text-light);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.05rem;
}

@media (max-width: 620px) {
  .rules-grid { grid-template-columns: 1fr; }
}
