/*
  ============================================================
  STYLES: colors, fonts & spacing live in the :root variables
  below. Change a variable here and it updates the whole site.
  You usually won't need to touch anything past the variables
  section unless you want to change the layout itself.
  ============================================================

  TYPE SYSTEM
  Two fonts, two jobs:
  - Crimson Pro (serif) is for anything the visitor actually reads:
    the hero name/bio, article titles and body copy, card/list
    titles that link to writing, pull-quotes.
  - Inter (sans) is for interface chrome: navigation, buttons,
    badges/flairs, meta lines, form controls, section dividers,
    and structured data (the resume timeline).
  A single --text-* scale is shared by both, so every element's
  size is chosen from the same ladder instead of one-off values.
*/

:root {
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type scale — each step has one job. Nothing meant to be read as a
     full sentence sits below 16px; badges/labels/meta can go to 14px. */
  --text-2xs: 0.75rem;   /* 12px — rarely used micro text */
  --text-xs:  0.875rem;  /* 14px — badges, flairs, meta, captions, form labels */
  --text-sm:  1rem;      /* 16px — buttons, nav, card/list titles, form inputs */
  --text-md:  1.125rem;  /* 18px — reading paragraphs (bio, article body) */
  --text-lg:  1.375rem;  /* 22px — dek, pull-quotes, in-article h3 */
  --text-xl:  1.75rem;   /* 28px — section labels, in-article h2 */
  --text-2xl: 2.125rem;  /* 34px — unused headroom for future headings */
  --text-3xl: 2.625rem;  /* 42px — hero name / article title, mobile */
  --text-4xl: 3.375rem;  /* 54px — hero name / article title, desktop */

  /* Palette — core blues, impressionist undertones, warm accents, warm neutrals */
  --color-indigo: #2C3E66;    /* deep indigo — headings, dark base */
  --color-cerulean: #3E7CB1;  /* primary brand blue */
  --color-sky: #A9C9DD;       /* soft sky — large surfaces, soft tints */
  --color-lavender: #B8A9C9;  /* lavender mist — shadows, subtle gradients */
  --color-sage: #8FA998;      /* sage green — secondary UI elements */
  --color-ochre: #D9A441;     /* golden ochre — CTAs, buttons, links-as-action */
  --color-coral: #E8A87C;     /* soft coral — secondary accent */
  --color-warm-white: #F7F4EE;
  --color-charcoal: #334155;
  --color-charcoal-faded: #7c8593;

  /* Semantic aliases used throughout the site */
  --color-bg: var(--color-warm-white);
  --color-text-heading: var(--color-indigo);
  --color-text-body: var(--color-charcoal);
  --color-text-body-faded: var(--color-charcoal-faded);
  --color-border: #E4DECF;
  --color-accent: var(--color-cerulean);
  --color-accent-strong: #2C5E85;  /* darker cerulean, for text set on light tints */
  --color-accent-soft: var(--color-sky);
  --color-cta: var(--color-ochre);
  --color-surface-soft: #EDF3F8;       /* light cerulean/sky tint — panels, tracks */
  --color-surface-soft-hover: #DCEAF3;
  --badge-gradient: linear-gradient(to right, var(--color-cerulean), var(--color-sky));

  /* Decorative background blobs — soft, overlapping color fields (dappled
     light, the way an impressionist canvas blends several hues in one
     brushed area rather than a single flat tint). */
  --blob-top-gradient: radial-gradient(circle at 32% 28%, rgba(217,164,65,0.20), rgba(62,124,177,0.22) 45%, rgba(184,169,201,0.15) 78%, transparent 100%);
  --blob-bottom-gradient: radial-gradient(circle at 68% 72%, rgba(143,169,152,0.22), rgba(169,201,221,0.26) 45%, rgba(232,168,124,0.14) 78%, transparent 100%);
  --blob-mid-gradient: radial-gradient(circle at 50% 50%, rgba(184,169,201,0.16), rgba(232,168,124,0.12) 55%, transparent 80%);

  --shadow-sm: 0 1px 2px rgba(44,62,102,0.06);
  --shadow-md: 0 4px 12px rgba(44,62,102,0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text-body);
  font-family: var(--font-sans);
}

h1, h2, h3, h4 { font-weight: 700; margin: 0; }

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

/* Decorative gradient blurs, fixed to the viewport so they read as a
   background layer the page content scrolls over (see initParallax).
   Organic (non-circular) radii keep them from reading as neat geometric
   discs — closer to a soft, brushed bloom of color. */
.blob {
  position: fixed;
  width: 40rem;
  height: 40rem;
  border-radius: 58% 42% 53% 47% / 48% 60% 40% 52%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.blob-top {
  top: 0;
  right: 0;
  background: var(--blob-top-gradient);
}
.blob-bottom {
  bottom: 0;
  left: 0;
  background: var(--blob-bottom-gradient);
}

/* Third, quieter color bloom drifting through the middle of the canvas */
.page::before {
  content: "";
  position: fixed;
  top: 30%;
  left: 50%;
  width: 46rem;
  height: 46rem;
  transform: translate(-50%, -50%);
  border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
  background: var(--blob-mid-gradient);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

/* Fine canvas-grain texture over the whole page, like tooth in painted
   canvas catching soft light. Self-contained SVG noise, no image request. */
.page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  position: relative;
  z-index: 1;
  max-width: 56rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
@media (min-width: 768px) {
  .container { padding: 4.5rem 1.5rem; }
}

/* Scroll fade-in */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  margin-bottom: 2.75rem;
}
.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero */
.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.hero-photo {
  flex-shrink: 0;
  width: 12rem;
  height: 12rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.hero-text { min-width: 0; }

.hero-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--color-text-body);
  margin: 0 0 1rem;
}
.hero-subtitle-dot { color: var(--color-accent-soft); line-height: 1; }

.hero-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-heading);
  margin-bottom: 0.375rem;
}
@media (min-width: 768px) {
  .hero-name { font-size: var(--text-2xl); }
}

.bio { display: flex; flex-direction: column; gap: 0.75rem; }
.bio p {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-text-body);
  margin: 0;
}

/* Section labels */
.section-label {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text-heading);
  margin-bottom: 1.125rem;
}

/* Highlight boxes (nested inside timeline entries) */
.highlight-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}
.highlight-stat {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.15rem;
}
.highlight-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-body);
}

/* Timeline — structured resume data, kept in the sans/UI voice */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; align-items: flex-start; }
.timeline-year {
  flex-shrink: 0;
  width: 5.5rem;
  padding-top: 0.125rem;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-accent);
}
.timeline-content {
  flex-grow: 1;
  border-left: 2px solid var(--color-border);
  padding: 0 0 1.125rem 1.25rem;
  transition: border-color 0.2s ease;
}
.timeline-item:last-child .timeline-content { padding-bottom: 0; }
.timeline-item:hover .timeline-content { border-color: var(--color-accent-soft); }
.timeline-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.3;
  color: var(--color-text-heading);
  margin-bottom: 0.2rem;
}
.timeline-role {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text-body);
  margin: 0 0 0.625rem;
}
.timeline-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.625rem;
  max-width: 26rem;
}

/* "More about me" button (above the tabs) */
.more-about-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-heading);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.more-about-btn:hover { border-color: var(--color-accent-soft); box-shadow: var(--shadow-md); }
.more-about-btn:active { transform: scale(0.97); }
.more-about-icon { flex-shrink: 0; transition: transform 0.3s ease; }
.more-about-btn.is-open .more-about-icon { transform: rotate(180deg); }

/* About section (revealed by the button above, sits before Ideas/Recommendations) */
.about-section {
  margin-bottom: 2.75rem;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.about-section.is-visible { opacity: 1; transform: translateY(0); }
.about-intro p {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-md);
  line-height: 1.65;
  color: var(--color-text-body);
  margin: 0 0 1rem;
}
.about-intro p:last-child { margin-bottom: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .about-section,
  .more-about-icon { transition: none; }
}

/* Tabbed content nav (Ideas / Recommendations) */
.content-nav {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.content-nav-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-body);
  padding: 0 0 0.625rem;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.content-nav-btn:hover { color: var(--color-text-heading); }
.content-nav-btn.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Card grid (Ideas & Recommendations tabs) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}
.link-card {
  display: block;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.link-card:hover {
  border-color: var(--color-accent-soft);
  box-shadow: var(--shadow-sm);
}
.link-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--badge-gradient);
}
.link-card-body { padding: 0.875rem 1rem 1rem; }
.link-card-flair {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  margin-left: -0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.link-card-flair.flair-c0 { background: #E3EEF6; color: #2C5E85; } /* cerulean */
.link-card-flair.flair-c1 { background: #E8EFE9; color: #4F6B58; } /* sage */
.link-card-flair.flair-c2 { background: #FBF0DC; color: #8C6423; } /* ochre */
.link-card-flair.flair-c3 { background: #FBEEE4; color: #A15A34; } /* coral */
.link-card-flair.flair-c4 { background: #EFEAF3; color: #6B5480; } /* lavender */
.link-card-title {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-heading);
  margin: 0;
}
.link-card-subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 100;
  line-height: 1.4;
  color: var(--color-text-body-faded);
  margin: 0.3rem 0 0;
}

/* Featured card — the most recent idea, given more room than the rest */
.link-card-featured {
  grid-column: 1 / -1;
}
@media (min-width: 640px) {
  .link-card-featured {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
  }
  .link-card-featured .link-card-thumb { height: 100%; aspect-ratio: auto; }
}
.link-card-featured .link-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.link-card-featured .link-card-title { font-size: var(--text-lg); line-height: 1.25; }
.link-card-featured .link-card-subtitle { font-size: var(--text-sm); margin-top: 0.5rem; }

/* Recommendations list (grouped by topic, with favicons) */
.rec-groups { display: flex; flex-direction: column; gap: 1.25rem; }
.rec-group-title {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-accent);
  margin: 0 0 0.625rem;
}
.rec-list { display: flex; flex-direction: column; gap: 0.5rem; }
.rec-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rec-item:hover {
  border-color: var(--color-accent-soft);
  box-shadow: var(--shadow-sm);
}
.rec-favicon {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
}
.rec-item-body { min-width: 0; }
.rec-item-title {
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-heading);
  margin: 0;
}
.rec-item-meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-body);
  margin: 0.2rem 0 0;
}

/* Social links */
.social-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.social-link:hover {
  background: var(--hover-gradient, var(--badge-gradient));
  box-shadow: var(--shadow-md);
}
.social-link svg {
  color: var(--color-text-body);
  transition: color 0.3s ease;
}
.social-link:hover svg { color: white; }

/* Small screens */
@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .hero-photo { width: 8.5rem; height: 8.5rem; }
}
@media (max-width: 480px) {
  .hero-name { font-size: var(--text-2xl); }
  .timeline-item { flex-direction: column; }
  .timeline-year { width: auto; margin-bottom: 0.25rem; }
  .timeline-content { border-left: none; border-top: 2px solid var(--color-border); padding: 1rem 0 1.5rem 0; }
}
