/* ==========================================================================
   Apple Design System — Nord Notes Edition
   Typography: SF Pro Display / Text
   Tokens, Bento Grids, Glassmorphism & Micro-interactions
   ========================================================================== */

:root {
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Apple Light Palette */
  --bg-page: #f5f5f7;
  --bg-card: #ffffff;
  --bg-subtle: #fbfbfd;
  --bg-tertiary: #e8e8ed;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #a1a1a6;
  --link-color: #0071e3;
  --link-hover: #0077ed;
  --accent-green: #34c759;
  --accent-orange: #ff9500;
  
  --border-light: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-border: rgba(0, 0, 0, 0.12);

  --radius-card: 20px;
  --radius-pill: 980px;
  --radius-sm: 10px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.08);

  --max-w: 1080px;
  --read-w: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #000000;
    --bg-card: #1c1c1e;
    --bg-subtle: #161618;
    --bg-tertiary: #2c2c2e;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #6e6e73;
    --link-color: #2997ff;
    --link-hover: #47a6ff;
    --accent-green: #30d158;
    --accent-orange: #ff9f0a;

    --border-light: rgba(255, 255, 255, 0.12);
    --border-card: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(22, 22, 23, 0.82);
    --nav-border: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.6);
  }
}

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

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

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-system);
  line-height: 1.55;
  letter-spacing: -0.016em;
}

/* ==========================================================================
   Apple Sticky Nav
   ========================================================================== */

header.apple-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 52px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.brand-pill {
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

nav.nav-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  font-weight: 400;
}

nav.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   Page Wrap
   ========================================================================== */

.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 100px;
}

/* ==========================================================================
   Apple Hero Section
   ========================================================================== */

.apple-hero {
  text-align: center;
  padding: 40px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--link-color);
  margin-bottom: 12px;
}

.hero-headline {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 820px;
  margin-bottom: 18px;
}

.hero-subhead {
  font-size: 21px;
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 640px;
  letter-spacing: -0.015em;
  font-weight: 400;
}

/* ==========================================================================
   3D Canvas Stage (Apple Interactive Viewer Style)
   ========================================================================== */

.stage-card {
  position: relative;
  width: 100%;
  height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 60px;
}

#nord-3d-scene {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-badge-top {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
  .stage-badge-top {
    background: rgba(28, 28, 30, 0.75);
  }
}

.stage-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.stage-hint-right {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stage-caption-bottom {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  max-width: 440px;
  pointer-events: none;
}

.stage-caption-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.stage-caption-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Bento Grid Layout
   ========================================================================== */

.section-header {
  margin-bottom: 30px;
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Card sizes */
.bento-card-hero {
  grid-column: span 12;
  min-height: 440px;
  position: relative;
  justify-content: flex-end;
  padding: 44px;
}

.bento-card-hero .card-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.bento-card-hero .card-scrim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.78) 85%);
  z-index: 2;
}

.bento-card-hero .card-content {
  position: relative;
  z-index: 3;
  color: #ffffff;
  max-width: 680px;
}

.bento-card-hero .card-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  color: #ffffff;
}

.bento-card-hero .card-excerpt {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Secondary bento cards (2 cols) */
.bento-card-half {
  grid-column: span 6;
}

.bento-card-third {
  grid-column: span 4;
}

.card-img-wrap {
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.bento-card:hover .card-img-wrap img {
  transform: scale(1.03);
}

.card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-pill-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--link-color);
  margin-bottom: 10px;
}

.card-title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 20px;
  flex: 1;
}

.card-footer-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--link-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Apple Infographic Widgets
   ========================================================================== */

.widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 36px 36px;
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.widget-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.widget-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.widget-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Segmented Control (iOS style) */
.segmented-control {
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  padding: 3px;
  display: inline-flex;
}

.segment-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Solar Widget Layout */
.solar-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: center;
}

.solar-meter-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
}

.solar-metric-big {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  margin: 12px 0 4px;
}

.solar-metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.apple-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  margin: 16px 0;
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: 0.5px solid rgba(0,0,0,0.04);
}

.solar-info-callout {
  background: var(--bg-subtle);
  border-left: 3px solid var(--link-color);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 18px;
}

/* Trail Waypoint Buttons */
.trail-waypoints-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin: 20px 0;
}

.trail-pill-btn {
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.trail-pill-btn:hover,
.trail-pill-btn.active {
  background: var(--link-color);
  color: #ffffff;
  border-color: var(--link-color);
}

.trail-info-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
}

.trail-info-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.trail-info-meta {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-orange);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* Materiality Matrix */
.mat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
}

.mat-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.mat-bar-label {
  flex: 1;
  color: var(--text-secondary);
}

.mat-bar-track {
  width: 140px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.mat-bar-fill {
  height: 100%;
  background: var(--link-color);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.mat-bar-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  width: 44px;
  text-align: right;
}

/* ==========================================================================
   Article Reading Page (Apple News / Books Layout)
   ========================================================================== */

article.apple-article {
  max-width: var(--read-w);
  margin: 0 auto;
  padding-top: 20px;
}

.article-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--link-color);
  text-decoration: none;
  margin-bottom: 32px;
}

.article-back-nav:hover {
  text-decoration: underline;
}

.article-hero-img-wrap {
  width: 100%;
  height: 380px;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-card);
}

.article-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-header {
  margin-bottom: 36px;
}

.article-header h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 12px 0 16px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.article-content {
  font-size: 18.5px;
  line-height: 1.68;
  letter-spacing: -0.012em;
}

.article-content p {
  margin-bottom: 1.6em;
}

.article-content h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
}

.article-content blockquote {
  margin: 36px 0;
  padding: 20px 24px;
  background: var(--bg-card);
  border-left: 3px solid var(--link-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-primary);
}

.article-content blockquote p {
  margin: 0;
}

/* ==========================================================================
   Apple Footer
   ========================================================================== */

footer.apple-footer {
  background: var(--bg-page);
  border-top: 1px solid var(--border-light);
  padding: 36px 24px;
  margin-top: 80px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

/* Responsive */
@media (max-width: 860px) {
  .hero-headline {
    font-size: 40px;
  }
  .bento-card-half,
  .bento-card-third {
    grid-column: span 12;
  }
  .solar-layout {
    grid-template-columns: 1fr;
  }
  .mat-grid {
    grid-template-columns: 1fr;
  }
  .stage-card {
    height: 380px;
  }
}

@media (max-width: 600px) {
  .hero-headline {
    font-size: 32px;
  }
  .hero-subhead {
    font-size: 18px;
  }
  .bento-card-hero {
    padding: 24px;
    min-height: 360px;
  }
  .bento-card-hero .card-title {
    font-size: 24px;
  }
  .article-header h1 {
    font-size: 30px;
  }
  .article-hero-img-wrap {
    height: 240px;
  }
}
