/* =============================================================
   Welly's World — thelangers.com
   Design system by Adam West. Build by Mort.
   Source spec: Team/adamwest-creative/thelangers-design-system.md
   ============================================================= */

/* ----- Google Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=IBM+Plex+Serif:ital,wght@0,400;0,500;1,400&family=IBM+Plex+Sans:wght@400;600&display=swap');

/* ----- Design tokens ----- */
:root {
  /* Colors */
  --ink-white:      #FAFAF8;
  --deep-charcoal:  #111418;
  --slate-mid:      #4A5260;
  --cool-stone:     #9AA2AD;
  --paper-shadow:   #E8E4DC;
  --brass-gold:     #C5A55A;
  --positive:       #2A7A4B;
  --negative:       #9B2335;

  /* Typography */
  --font-display:   'Playfair Display', Georgia, serif;
  --font-serif:     'IBM Plex Serif', Georgia, serif;
  --font-sans:      'IBM Plex Sans', system-ui, sans-serif;

  /* Spacing (base-8) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;

  /* Layout */
  --container-max: 1080px;
  --reading-width:  640px;
}

/* ----- Reset ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--ink-white);
  color: var(--deep-charcoal);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

/* =============================================================
   GLOBAL HEADER
   ============================================================= */

.site-header {
  background-color: var(--ink-white);
  border-bottom: 1.5px solid var(--brass-gold);
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-4);
}

/* Wordmark */
.site-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--deep-charcoal);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-wordmark:hover {
  color: var(--deep-charcoal);
}

/* Nav (primary) */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-nav a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--slate-mid);
  letter-spacing: 0.06em;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover {
  color: var(--deep-charcoal);
}

.site-nav a.active {
  color: var(--deep-charcoal);
  border-bottom-color: var(--brass-gold);
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--deep-charcoal);
  transition: transform 0.2s;
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  background-color: var(--ink-white);
  padding: var(--space-6) var(--space-4);
  flex-direction: column;
  gap: var(--space-3);
  z-index: 200;
  box-shadow: -2px 0 12px rgba(17, 20, 24, 0.08);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  color: var(--deep-charcoal);
  padding: var(--space-1) 0;
}

.mobile-nav-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--slate-mid);
}

/* =============================================================
   TICKER COMPONENT
   ============================================================= */

.ticker {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
  margin-left: var(--space-3);
  flex-shrink: 0;
}

.ticker-icon {
  width: 20px;
  height: 20px;
  color: var(--brass-gold);
  flex-shrink: 0;
}

.ticker-price {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep-charcoal);
}

.ticker-change {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  transition: color 0.3s;
}

.ticker-change.positive { color: var(--positive); }
.ticker-change.negative { color: var(--negative); }

/* Mobile ticker strip (below header) */
.ticker-strip {
  display: none;
  background-color: var(--ink-white);
  border-bottom: 1px solid var(--cool-stone);
  height: 36px;
  align-items: center;
  justify-content: center;
}

.ticker-strip .ticker {
  margin-left: 0;
}

/* =============================================================
   HERO (Home page)
   ============================================================= */

.hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
  text-align: center;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1.15;
  color: var(--deep-charcoal);
  margin-bottom: var(--space-2);
}

.hero-tagline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--slate-mid);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Brass section divider */
.section-rule {
  border: none;
  border-top: 1px solid var(--brass-gold);
  margin: var(--space-5) 0;
}

.section-rule--stone {
  border-top-color: var(--cool-stone);
}

/* =============================================================
   SECTION HEADERS
   ============================================================= */

.section-header {
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1.25;
  color: var(--deep-charcoal);
}

.section-link {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--deep-charcoal);
  text-decoration: underline;
  text-decoration-color: var(--brass-gold);
  text-underline-offset: 3px;
  letter-spacing: 0.04em;
}

.section-link:hover {
  text-decoration-thickness: 2px;
}

/* =============================================================
   ARTICLE CARDS
   ============================================================= */

/* Grid containers */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.article-grid--two-col {
  grid-template-columns: repeat(2, 1fr);
}

/* Individual card */
.article-card {
  background-color: var(--ink-white);
  border: 1px solid var(--cool-stone);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.15s;
}

.article-card:hover {
  border-color: var(--brass-gold);
}

/* Optional thumbnail */
.article-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) 0;
  width: calc(100% + var(--space-3) * 2);
}

/* Meta line: category + date */
.article-meta {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  letter-spacing: 0.08em;
}

.article-meta-dot {
  margin: 0 0.375em;
}

/* Card headline */
.article-card-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--deep-charcoal);
}

.article-card-headline a {
  text-decoration: none;
}

.article-card-headline a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brass-gold);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* One-line summary */
.article-card-summary {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--slate-mid);
  line-height: 1.5;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Read link */
.article-read-link {
  margin-top: auto;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--deep-charcoal);
  text-decoration: underline;
  text-decoration-color: var(--brass-gold);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-read-link:hover {
  text-decoration-thickness: 2px;
}

/* =============================================================
   ARTICLE INDEX PAGE (/articles)
   ============================================================= */

.page-header {
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1.15;
  color: var(--deep-charcoal);
}

/* =============================================================
   ARTICLE PAGE (/articles/[slug])
   ============================================================= */

.article-page {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* Reading column: centered 6-column (~640px) */
.reading-col {
  max-width: var(--reading-width);
  margin-left: auto;
  margin-right: auto;
}

.article-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1.15;
  color: var(--deep-charcoal);
  margin-bottom: var(--space-2);
}

.article-byline {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  margin-bottom: var(--space-2);
}

/* Brass entry rule below byline */
.article-entry-rule {
  border: none;
  border-top: 1px solid var(--brass-gold);
  margin-bottom: var(--space-4);
}

/* Article body typography */
.article-body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--deep-charcoal);
}

.article-body p {
  margin-bottom: var(--space-3);
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 1.25;
  color: var(--deep-charcoal);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
}

.article-body h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--deep-charcoal);
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

/* Section break within body */
.article-body hr {
  border: none;
  border-top: 1px solid var(--cool-stone);
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
}

/* Body links */
.article-body a {
  color: var(--deep-charcoal);
  text-decoration: underline;
  text-decoration-color: var(--brass-gold);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.article-body a:hover {
  text-decoration-thickness: 2px;
}

/* Blockquote */
.article-body blockquote {
  font-style: italic;
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: none;
}

/* Pull quote */
.pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--slate-mid);
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--brass-gold);
}

/* Strong */
.article-body strong {
  font-weight: 500;
}

/* Figure / caption */
.article-body figure {
  margin: var(--space-4) 0;
}

.article-body figcaption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--slate-mid);
  margin-top: var(--space-1);
}

/* =============================================================
   RELATED ARTICLES MODULE
   ============================================================= */

.related-articles {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--cool-stone);
}

.related-articles-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep-charcoal);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

/* Related cards use narrower headlines */
.related-articles .article-card-headline {
  font-size: 1rem;
}

/* =============================================================
   WATCHLIST TABLE
   ============================================================= */

.watchlist-intro {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--deep-charcoal);
  max-width: var(--reading-width);
  margin-bottom: var(--space-3);
}

.watchlist-updated {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

/* Outer wrapper: allows horizontal scroll on mobile */
.watchlist-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.watchlist-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
}

/* Table header */
.watchlist-table thead tr {
  background-color: var(--paper-shadow);
}

.watchlist-table th {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--deep-charcoal);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--cool-stone);
}

.watchlist-table th.right { text-align: right; }

/* Table body rows */
.watchlist-table tbody tr {
  background-color: var(--ink-white);
  border-bottom: 1px solid var(--cool-stone);
  transition: background-color 0.1s;
}

/* Alternating rows */
.watchlist-table tbody tr:nth-child(even) {
  background-color: var(--paper-shadow);
}

.watchlist-table tbody tr:hover {
  background-color: var(--paper-shadow);
}

.watchlist-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* Asset name cell */
.asset-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--deep-charcoal);
  line-height: 1.2;
}

.asset-ticker {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--slate-mid);
  margin-top: 2px;
}

/* Price cell */
.asset-price {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep-charcoal);
  text-align: right;
}

/* 24h change cell */
.asset-change {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: right;
}

.asset-change.positive { color: var(--positive); }
.asset-change.negative { color: var(--negative); }

/* Welly status label */
.welly-status {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8125rem;
}

.welly-status--watching     { color: var(--slate-mid); }
.welly-status--accumulating { color: var(--brass-gold); }
.welly-status--avoiding     { color: var(--negative); }

/* =============================================================
   ABOUT PAGE
   ============================================================= */

.about-page {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.about-content {
  max-width: var(--reading-width);
  margin: 0 auto;
}

/* Photo slot */
.about-photo {
  width: 320px;
  height: 320px;
  float: left;
  margin-right: var(--space-4);
  margin-bottom: var(--space-3);
  object-fit: cover;
}

.about-photo-placeholder {
  width: 320px;
  height: 320px;
  float: left;
  margin-right: var(--space-4);
  margin-bottom: var(--space-3);
  background-color: var(--paper-shadow);
  flex-shrink: 0;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

.about-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1.15;
  color: var(--deep-charcoal);
  margin-bottom: var(--space-1);
}

.about-role {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.about-rule {
  border: none;
  border-top: 1px solid var(--brass-gold);
  margin-bottom: var(--space-4);
  clear: both;
}

.about-bio {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--deep-charcoal);
  margin-bottom: var(--space-5);
}

.about-bio p {
  margin-bottom: var(--space-3);
}

/* Trust signals */
.trust-signals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.trust-signal-number {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--deep-charcoal);
}

.trust-signal-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--slate-mid);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.about-disclaimer {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate-mid);
  margin-bottom: var(--space-4);
}

/* =============================================================
   WATCHLIST PREVIEW (Home page)
   ============================================================= */

.watchlist-preview {
  margin-top: var(--space-6);
}

/* Reuse watchlist-table styles; just a smaller table here */

/* =============================================================
   FOOTER
   ============================================================= */

.site-footer {
  background-color: var(--ink-white);
  border-top: 1px solid var(--cool-stone);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
  margin-top: var(--space-6);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.footer-col-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep-charcoal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-links a {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--slate-mid);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--deep-charcoal);
}

.footer-legal {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--slate-mid);
}

.footer-legal p {
  margin-bottom: var(--space-1);
}

/* =============================================================
   UTILITY
   ============================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Page section padding */
.section {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

.section--large {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* Callout box (future use) */
.callout {
  background-color: var(--paper-shadow);
  padding: var(--space-3);
  margin: var(--space-4) 0;
}

/* =============================================================
   RESPONSIVE — Tablet (768px to 1023px)
   ============================================================= */

@media (max-width: 1023px) {
  .container {
    padding-left: 32px;
    padding-right: 32px;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-signals {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================================
   RESPONSIVE — Mobile (767px and below)
   ============================================================= */

@media (max-width: 767px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Header */
  .site-header {
    height: 56px;
  }

  .site-nav {
    display: none;
  }

  .ticker {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .ticker-strip {
    display: flex;
  }

  /* Typography */
  .hero-name,
  .article-headline,
  .page-title,
  .about-name {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  /* Grids collapse to single column */
  .article-grid,
  .article-grid--two-col {
    grid-template-columns: 1fr;
  }

  /* About photo full-width, stacked */
  .about-photo,
  .about-photo-placeholder {
    float: none;
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    margin-right: 0;
    margin-bottom: var(--space-4);
  }

  /* Trust signals */
  .trust-signals {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
  }

  /* Footer stacks */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* Reading column full-width */
  .reading-col {
    max-width: 100%;
  }

  .related-articles .article-grid {
    grid-template-columns: 1fr;
  }
}
