/* ==========================================================================
   Rizwan's Portfolio — Design System
   Inspired by thisiskp.com · Adapted for a builder-founder
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   Design Tokens (CSS Custom Properties)
   ========================================================================== */
:root {
  /* Color Palette */
  --bg: #EFF8FF;
  /* Light sky — page background */
  --hero-panel: #54abce;
  /* Sky blue — photo panel */
  --surface: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #4A5568;
  --text-muted: #8899AA;
  --accent: #2181B5;
  /* Deeper sky — links & CTAs */
  --accent-soft: #E1F1FA;
  /* Soft sky — quote block bg */
  --border: #D0E4F0;
  /* Sky-tinted border */
  --danger-soft: #FFF3F3;
  --danger: #CC3333;

  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

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

  /* Layout */
  --content-max-width: 640px;
  --page-max-width: 1100px;
  --nav-height: 56px;
  --left-panel-width: 48%;
  --right-panel-width: 52%;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg);
}

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

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text-primary);
}

ul,
ol {
  list-style: none;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-3) 0;
}

/* ==========================================================================
   Home Page — Split Column Layout
   ========================================================================== */
.home-layout {
  display: grid;
  grid-template-columns: var(--left-panel-width) var(--right-panel-width);
  min-height: 100vh;
}

/* --- Left Panel: Sticky Photo --- */
.photo-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: var(--hero-panel);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.photo-panel__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.photo-panel__img.fade-in {
  transition: opacity 4s cubic-bezier(0.22, 1, 0.36, 1), transform 4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Right Panel: Scrollable Content --- */
.content-panel {
  background-color: var(--bg);
  min-height: 100vh;
  position: relative;
}

.content-panel__inner {
  padding: 0 var(--space-6) var(--space-10) var(--space-6);
  max-width: calc(var(--content-max-width) + var(--space-6) * 2);
}

/* ==========================================================================
   Navigation (inside right panel, sticky)
   ========================================================================== */
#nav-placeholder {
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  background-color: var(--hero-panel);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  padding: 0 var(--space-6);
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: #FFFFFF;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: auto;
}

.nav__logo:hover {
  text-decoration: none;
  color: #FFFFFF;
}

.nav__logo-separator {
  color: rgba(255, 255, 255, 0.4);
  margin: 0 2px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav__link:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.nav__link--active {
  color: #FFFFFF;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
  text-underline-offset: 4px;
}

/* Hamburger menu (mobile only) */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  color: #FFFFFF;
}

.nav__hamburger svg {
  display: block;
}

/* Mobile dropdown menu */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background-color: var(--hero-panel);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav__mobile-menu.is-open {
  display: flex;
}

.nav__mobile-link {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  padding: var(--space-1) 0;
  transition: color 0.2s ease;
}

.nav__mobile-link:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.nav__mobile-link--active {
  color: #FFFFFF;
}

/* ==========================================================================
   Page Layouts (Inner Pages)
   ========================================================================== */
.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Inner page nav (full-width, centered) */
.page-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--hero-panel);
}

.page-nav .nav {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  background: transparent;
  backdrop-filter: none;
}

.page-content {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-3) var(--space-10);
  width: 100%;
}

/* ==========================================================================
   Page Header (emoji + title + subtitle)
   ========================================================================== */
.page-header {
  margin-bottom: var(--space-8);
}

.page-header__emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-2);
}

.page-header__title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.page-header__subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
  max-width: 520px;
}

/* ==========================================================================
   Home Page Sections
   ========================================================================== */

/* Section spacing */
.section {
  margin-bottom: var(--space-10);
}

.section--sm {
  margin-bottom: var(--space-6);
}

/* --- Section 1: Name Label + Tagline --- */
.hero-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.hero-tagline {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-tagline>span {
  display: block;
}

.name-highlight {
  color: #FF5722;
}

/* --- Section 2: Bio Paragraphs --- */
.bio-text {
  max-width: 580px;
}

.bio-text p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

.bio-text p:last-child {
  margin-bottom: 0;
}

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

/* --- Section 3: Testimonial Quotes --- */
.quote-block {
  border-left: 3px solid var(--accent);
  background-color: var(--accent-soft);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quote-block:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.quote-block:last-child {
  margin-bottom: 0;
}

.quote-block__text {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-primary);
}

.quote-block__attribution {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* --- Section 4: Currently Building Card --- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background-color: var(--surface);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.card__emoji {
  font-size: 1.4rem;
  margin-bottom: var(--space-2);
  display: block;
}

.card__label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.card__body {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-2);
}

.card__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.card__link:hover {
  gap: 8px;
  text-decoration: none;
}

/* --- Section 5: Featured Writing (3-card grid) --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.writing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.writing-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.writing-card__emoji {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

.writing-card__title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: auto;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.writing-card__title a {
  color: inherit;
  text-decoration: none;
}

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

.writing-card__meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-family: var(--font-mono);
}

.writing-card__read {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: var(--space-1);
}

/* --- Section 6: Featured Projects (2-card grid) --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.project-card__thumb {
  height: 160px;
  background-color: var(--hero-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__thumb-placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.project-card__content {
  padding: var(--space-2) 20px 20px;
}

.project-card__name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Status Chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  font-family: var(--font-mono);
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.status-chip--active {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.status-chip--exit {
  background-color: #E8F5E9;
  color: #2E7D32;
}

.status-chip--shutdown {
  background-color: #F5F5F5;
  color: var(--text-muted);
}

.status-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-chip--active .status-chip__dot {
  background-color: var(--accent);
}

.status-chip--exit .status-chip__dot {
  background-color: #2E7D32;
}

.status-chip--shutdown .status-chip__dot {
  background-color: var(--text-muted);
}

.project-card__tags {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.project-card__link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
}

/* --- Section 7: Learnings Teaser --- */
.learning-teaser {
  border-left: 3px solid var(--danger);
  background-color: var(--danger-soft);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition: transform 0.2s ease;
}

.learning-teaser:hover {
  transform: translateX(4px);
}

.learning-teaser__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.learning-teaser__body {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.learning-teaser__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.learning-teaser__link:hover {
  color: var(--danger);
  gap: 8px;
  text-decoration: none;
}

/* --- Section 8: Connect --- */
.connect {
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.connect__label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.connect__links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.connect__links a {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

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

.connect__separator {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* --- Footer --- */
.footer {
  margin-top: var(--space-6);
  padding-bottom: var(--space-5);
}

.footer__text {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Section Heading (used on inner pages + home)
   ========================================================================== */
.section-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.see-all-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: var(--space-3);
}

/* ==========================================================================
   Projects Page — Full Project Cards
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: var(--space-5);
}

.project-full-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.project-full-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.project-full-card__thumb {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-full-card__content {
  padding: 20px;
}

.project-full-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-full-card__pitch {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}

.project-full-card__tags {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: var(--space-2);
}

/* ==========================================================================
   Writing Page — Post List
   ========================================================================== */
.post-row {
  display: flex;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--space-2);
  transition: background-color 0.2s ease;
}

.post-row:hover {
  background-color: rgba(0, 102, 255, 0.03);
}

.post-row__emoji {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 36px;
}

.post-row__title {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.post-row__title a {
  color: var(--text-primary);
  text-decoration: none;
}

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

.post-row__date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ==========================================================================
   Learnings Page — Learning Cards
   ========================================================================== */
.learning-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background-color: var(--surface);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.learning-card:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.learning-card__counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.learning-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.learning-card__field {
  margin-bottom: var(--space-2);
}

.learning-card__field-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.learning-card__field-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.learning-card__meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.learning-card__link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--danger);
  margin-top: var(--space-2);
  display: inline-block;
}

/* ==========================================================================
   Bio Page — Special Components
   ========================================================================== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.photo-grid__img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background-color: var(--hero-panel);
}

/* Collapsible Toggle */
.collapsible {
  margin-bottom: var(--space-8);
}

.collapsible__trigger {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-1) 0;
  transition: gap 0.2s ease;
}

.collapsible__trigger:hover {
  gap: 10px;
}

.collapsible__trigger-arrow {
  transition: transform 0.3s ease;
  font-size: 0.82rem;
}

.collapsible.is-open .collapsible__trigger-arrow {
  transform: rotate(90deg);
}

.collapsible__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.collapsible.is-open .collapsible__content {
  max-height: 2000px;
  opacity: 1;
}

.collapsible__inner {
  padding-top: var(--space-3);
}

.collapsible__inner p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

/* ==========================================================================
   Contact Page
   ========================================================================== */
.contact-content {
  max-width: 540px;
}

.contact-content p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
}

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

/* ==========================================================================
   Retro Links Section (used on Bio + Contact)
   ========================================================================== */
.find-me {
  margin-top: var(--space-8);
}

.find-me__links {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.find-me__links a {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

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

/* ==========================================================================
   Other Experiments (plain list)
   ========================================================================== */
.experiments-list {
  margin-top: var(--space-5);
}

.experiments-list li {
  padding: var(--space-1) 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.experiments-list li:last-child {
  border-bottom: none;
}

.experiments-list a {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Annual Retrospectives
   ========================================================================== */
.retro-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.retro-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Closing Note (Learnings page)
   ========================================================================== */
.closing-note {
  border-left: 3px solid var(--border);
  padding: var(--space-3);
  margin-top: var(--space-8);
  background-color: rgba(0, 0, 0, 0.015);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.closing-note p {
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ==========================================================================
   Utility / Helpers
   ========================================================================== */
.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

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

.mt-8 {
  margin-top: var(--space-8);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {

  /* Adjust body/layout to prevent content hiding behind fixed nav */
  body {
    padding-top: var(--nav-height);
  }

  .home-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .photo-panel {
    position: relative;
    top: auto;
    height: 380px;
    align-items: flex-end;
    padding-top: 0;
  }

  .photo-panel__img {
    width: 90%;
    max-width: 360px;
  }

  .content-panel__inner {
    padding: 0 var(--space-3) var(--space-6) var(--space-3);
  }

  /* Nav: full-width fixed bar on mobile */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0 var(--space-3);
    background-color: var(--hero-panel);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  /* Grids: single column */
  .grid-3,
  .grid-2,
  .projects-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  /* Page header */
  .page-header__title {
    font-size: 2.2rem;
  }

  /* Page content */
  .page-content {
    padding: var(--space-3) var(--space-2) var(--space-8);
  }

  /* Inner page nav mobile */
  .page-nav .nav {
    padding: 0 var(--space-2);
  }

  /* Post rows */
  .post-row {
    flex-wrap: wrap;
  }

  .post-row__date {
    width: 100%;
    padding-left: calc(36px + var(--space-2));
  }
}

@media (max-width: 480px) {
  .hero-tagline {
    font-size: 2rem;
  }

  .page-header__title {
    font-size: 1.8rem;
  }
}

/* ==========================================================================
   Subtle Animations
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  .quote-block,
  .card,
  .writing-card,
  .project-card,
  .project-full-card,
  .learning-card,
  .learning-teaser {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
      box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Fade-in on scroll (activated via JS) */
  .fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 2s cubic-bezier(0.22, 1, 0.36, 1), transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Staggered delay for sequential items */
  .fade-in.is-visible:nth-child(2) {
    transition-delay: 0.15s;
  }

  .fade-in.is-visible:nth-child(3) {
    transition-delay: 0.3s;
  }

  .fade-in.is-visible:nth-child(4) {
    transition-delay: 0.45s;
  }
}

/* Fallback: show content if JS disabled or reduced motion preferred */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}

noscript+.fade-in,
.no-js .fade-in {
  opacity: 1;
  transform: none;
}