/* ==========================================================================
   AI Friday — Design System
   ========================================================================== */

/* --- Custom Properties --------------------------------------------------- */
:root {
  /* Colors — Light Mode */
  --bg:             #FDF6EE;
  --surface:        #FFFFFF;
  --text:           #2C1810;
  --text-secondary: #5A3D2E;
  --muted:          #8B7355;
  --accent:         #D4663A;
  --accent-hover:   #C05A32;
  --secondary:      #5B8A72;
  --border:         #E8DDD0;
  --border-subtle:  #F0E6D8;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code:    'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Type Scale */
  --text-hero:   clamp(28px, 5vw, 44px);
  --text-h1:     44px;
  --text-h2:     28px;
  --text-h3:     22px;
  --text-body-lg: 17px;
  --text-body:   15px;
  --text-small:  13px;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Layout */
  --max-width: 680px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(44, 24, 16, 0.04), 0 4px 12px rgba(44, 24, 16, 0.03);
  --shadow-card-hover: 0 2px 8px rgba(44, 24, 16, 0.06), 0 8px 24px rgba(44, 24, 16, 0.05);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

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

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.01em;
}

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

p {
  margin-bottom: var(--space-md);
}

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

.text-lg {
  font-size: var(--text-body-lg);
  line-height: 1.7;
}

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

.text-muted {
  color: var(--muted);
}

.text-secondary {
  color: var(--text-secondary);
}

code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* --- Layout -------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Navigation ---------------------------------------------------------- */
.nav {
  padding: var(--space-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.nav-logo:hover {
  text-decoration: none;
}

.logo-ai {
  color: var(--text);
}

.logo-friday {
  color: var(--accent);
}

.nav-logo:hover .logo-friday {
  color: var(--accent-hover);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-links a {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.15s ease;
}

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

.nav-back {
  font-size: var(--text-small) !important;
  color: var(--muted) !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-back:hover {
  color: var(--text) !important;
}

/* --- Hero (editorial) ---------------------------------------------------- */
.hero-editorial {
  padding: var(--space-2xl) 0 0;
}

.hero-editorial h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.hero-editorial h1 em {
  font-style: italic;
  color: var(--accent);
}

.prose {
  font-size: var(--text-body-lg);
  line-height: 1.75;
  color: var(--text-secondary);
}

.prose p + p {
  margin-top: var(--space-md);
}

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

.prose a:hover {
  text-decoration-color: var(--accent);
}

.cta-row {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.link-quiet {
  color: var(--muted);
  font-size: 14px;
}

.link-quiet:hover {
  color: var(--text);
}

/* --- Legacy hero (kept for brief pages) ---------------------------------- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-lg);
  font-variation-settings: 'opsz' 72;
}

.hero-headline em {
  font-style: italic;
  color: var(--accent);
}

.hero-subtitle {
  font-size: var(--text-body-lg);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 102, 58, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.link-arrow {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- About Section ------------------------------------------------------- */
.about {
  padding: var(--space-xl) 0 var(--space-2xl);
}

.about + .about {
  padding-top: 0;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl);
  box-shadow: var(--shadow-card);
}

.about-card p {
  font-size: var(--text-body-lg);
  line-height: 1.75;
  color: var(--text-secondary);
}

.about-card p + p {
  margin-top: var(--space-md);
}

.about-card + .about-card {
  margin-top: var(--space-lg);
}

.about-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

/* --- Footer -------------------------------------------------------------- */
.footer {
  padding: var(--space-xl) 0 var(--space-2xl);
  text-align: center;
  color: var(--muted);
  font-size: var(--text-small);
  border-top: 1px solid var(--border-subtle);
}

.footer-fleur {
  font-size: 20px;
  display: block;
  margin-bottom: var(--space-sm);
}

/* --- Brief Page ---------------------------------------------------------- */
.brief-header {
  padding: var(--space-2xl) 0 var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xl);
}

.brief-date {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-sm);
  font-variation-settings: 'opsz' 48;
}

.brief-theme {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-body-lg);
  color: var(--muted);
  font-variation-settings: 'opsz' 18;
}

/* Lede — the "what you need to know" paragraph */
.brief-lede {
  font-size: var(--text-body-lg);
  line-height: 1.8;
  color: var(--text);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.brief-lede strong {
  color: var(--text);
  font-weight: 700;
}

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

.brief-lede a:hover {
  text-decoration-color: var(--accent);
}

/* Brief Content — Linkblog Style */
.brief-content {
  padding: 0 0 var(--space-xl);
}

.brief-section {
  margin-bottom: var(--space-xl);
}

.brief-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
  font-variation-settings: 'opsz' 28;
}

.item {
  margin-bottom: var(--space-xl);
}

.item-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  font-variation-settings: 'opsz' 24;
}

.item-title a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.item-title a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.item-body {
  font-size: var(--text-body-lg);
  line-height: 1.75;
  color: var(--text-secondary);
}

.item-body strong {
  color: var(--text);
  font-weight: 600;
}

.item-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

.item-body a:hover {
  text-decoration-color: var(--accent);
}

.item-body blockquote {
  border-left: 3px solid var(--accent);
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(212, 102, 58, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-body);
  color: var(--text);
  line-height: 1.7;
}

.item-body blockquote p {
  margin-bottom: var(--space-sm);
}

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

.item-body code {
  font-family: var(--font-code);
  font-size: 0.88em;
  background: var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.item-body p {
  margin-bottom: var(--space-sm);
}

.item-body p:last-child {
  margin-bottom: 0;
}

.item-via {
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: var(--text-small);
  color: var(--muted);
  font-style: italic;
}

/* Quick links section */
.quick-links ul {
  list-style: none;
  padding: 0;
}

.quick-links li {
  margin-bottom: var(--space-sm);
  font-size: var(--text-body);
  line-height: 1.65;
  padding-left: var(--space-md);
  position: relative;
}

.quick-links li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--muted);
  font-weight: 700;
}

.quick-links li a {
  color: var(--accent);
  text-decoration: none;
}

.quick-links li a:hover {
  text-decoration: underline;
}

.ql-note {
  color: var(--muted);
  font-size: var(--text-small);
}

/* --- Sources ------------------------------------------------------------- */
.sources {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.sources-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.sources-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

.sources-list li {
  font-size: var(--text-small);
}

.sources-list a {
  color: var(--muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-block;
  transition: all 0.15s ease;
}

.sources-list a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(212, 102, 58, 0.04);
}

/* --- Prev / Next Navigation ---------------------------------------------- */
.brief-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-xl) 0;
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
  gap: var(--space-md);
}

.brief-nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  padding: var(--space-sm) 0;
  transition: color 0.15s ease;
}

.brief-nav-link:hover {
  color: var(--accent-hover);
}

.brief-nav-label {
  font-size: var(--text-small);
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brief-nav-date {
  font-family: var(--font-display);
  font-size: var(--text-body-lg);
  font-weight: 600;
  color: var(--accent);
}

.brief-nav-link:hover .brief-nav-date {
  color: var(--accent-hover);
}

.brief-nav-link--next {
  text-align: right;
  margin-left: auto;
}

.brief-nav-placeholder {
  flex: 1;
}

/* --- Index Pages ------------------------------------------------------------- */
.index-list {
  padding: 0 0 var(--space-2xl);
}

.index-item {
  margin-bottom: var(--space-md);
}

.index-item a {
  display: block;
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.index-item a:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.index-date {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
  font-variation-settings: 'opsz' 24;
}

.index-preview {
  font-size: var(--text-body);
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.year-month {
  margin-bottom: var(--space-xl);
}

.year-month h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.year-days {
  font-size: var(--text-body-lg);
  line-height: 2;
}

.year-days a {
  color: var(--accent);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.year-days a:hover {
  border-color: var(--accent);
  background: rgba(212, 102, 58, 0.04);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --text-h1:    32px;
    --text-h2:    24px;
    --text-h3:    19px;
    --text-body-lg: 16px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .hero-actions {
    flex-direction: column;
  }

  .about-card {
    padding: var(--space-lg) var(--space-md);
  }

  .brief-header {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .brief-card {
    padding: var(--space-md);
  }

  .brief-card-emoji {
    font-size: 24px;
  }

  .brief-card-body {
    padding-left: calc(24px + var(--space-md));
  }

  .brief-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .brief-nav-link--next {
    text-align: left;
  }

  .sources-list {
    gap: var(--space-sm);
  }

  .nav {
    padding: var(--space-md) 0;
  }
}

/* --- Subscribe Form ------------------------------------------------------ */
.subscribe-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 460px;
}

.subscribe-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--muted);
}

.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 102, 58, 0.1);
}

.subscribe-form input[type="submit"] {
  padding: 12px 24px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.subscribe-form input[type="submit"]:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 102, 58, 0.3);
}

@media (max-width: 640px) {
  .subscribe-form {
    flex-direction: column;
  }
}

/* --- Meetings ------------------------------------------------------------ */
.meetings-section {
  margin-bottom: var(--space-2xl);
}

.meetings-section-title {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-subtle);
}

.meetings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.meeting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  position: relative;
}

.meeting-card--next {
  border-color: var(--accent);
  border-width: 2px;
}

.meeting-card--past {
  opacity: 0.6;
}

.meeting-card-date {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.meeting-card-location {
  font-size: var(--text-body);
  color: var(--muted);
}

.meeting-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--accent);
  color: #fff;
  font-size: var(--text-small);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Meeting date (big, on home page) ------------------------------------ */
.meeting-date-big {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
  font-variation-settings: 'opsz' 28;
}

/* --- Latest Brief (home page) -------------------------------------------- */
.latest-brief {
  padding: var(--space-xl) 0;
}

.latest-brief-heading {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.latest-brief-heading a {
  color: var(--muted);
}

.latest-brief-heading a:hover {
  color: var(--text);
}

.latest-brief .brief-lede {
  margin-bottom: var(--space-md);
}

/* --- Hero aside (location) ----------------------------------------------- */
.hero-aside {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  margin-top: 10px;
  font-variation-settings: 'opsz' 18;
}
