@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,400i,500i&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500&display=swap');

:root {
  --type-sans: 'General Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --fg: #000;
  --bg: #fff;
  --muted: rgba(0, 0, 0, 0.6);
  --rule: rgba(0, 0, 0, 0.1);

  --container: 1080px;
  --body-size: 17px;
  --body-lh: 1.65;
  --body-weight: 400;
  --hero-size: 64px;
  --subhead-size: 22px;
  --h2-size: 30px;
  --lesson-size: 32px;
  --media-scale: 100%;
  --gutter: clamp(1.25rem, 5vw, 2rem);
}

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

html {
  font-size: var(--body-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--type-sans);
  font-weight: var(--body-weight);
  line-height: var(--body-lh);
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img, iframe, video { max-width: 100%; }

h1, h2, h3, p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}

/* ─── Hero ─────────────────────────────────── */

.hero {
  text-align: center;
  margin: 0 auto 7rem;
  max-width: 40em;
}

.hero h1 {
  font-size: var(--hero-size);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.0;
  margin-bottom: 2.25rem;
}

.hero p {
  font-size: var(--subhead-size);
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.hero .hero-signature {
  font-family: 'Caveat', 'Caveat Brush', cursive;
  font-weight: 500;
  font-size: 3.2rem; /* ~54px (20% smaller than 4rem) */
  line-height: 1;
  color: var(--fg);
  margin-top: 1.75rem;
  letter-spacing: -0.005em;
  transform: translateX(-1rem); /* optical nudge — "Jeppe" is heavier than "—" */
}

/* ─── Pieces — alternating left/right, lesson centered below ── */

.piece {
  display: grid;
  grid-template-columns: 5fr 5fr;
  grid-template-areas:
    "text media"
    "lesson lesson";
  column-gap: 4rem;
  row-gap: 0;
  margin-bottom: 0;
  align-items: start;
}

/* Subtle hairline divider between sections — fades at edges */
.section-divider {
  display: block;
  width: clamp(320px, 65%, 640px);
  height: 1px;
  margin: 5rem auto;
  border: 0;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.18) 50%,
    transparent 100%
  );
  pointer-events: none;
}

/* Alternation — Intel piece has copy on right, media on left */
.piece-right {
  grid-template-areas:
    "media text"
    "lesson lesson";
}

.piece-text {
  grid-area: text;
  min-width: 0;
}
.piece-media {
  grid-area: media;
  width: var(--media-scale);
  min-width: 0;
}

/* In piece-right, push media to the right edge of its column for visual balance */
.piece-right .piece-media {
  margin-left: auto;
}

/* When media has a tab strip at its top, drop the text column to align with
   the card body below the tabs (desktop only — mobile stacks anyway) */
@media (min-width: 901px) {
  .piece:has([data-variant="tabbed"]) .piece-text {
    padding-top: 2.75rem;
  }
}

.piece h2 {
  font-size: var(--h2-size);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.32;
  margin-bottom: 1.5rem;
}

.frame {
  font-size: var(--body-size);
  line-height: var(--body-lh);
  margin-bottom: 1.5rem;
  text-wrap: pretty;
}

.lesson {
  grid-area: lesson;
  font-family: var(--type-sans);
  font-style: italic;
  font-weight: 400;
  font-size: var(--lesson-size);
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-align: center;
  max-width: 24em;
  margin: 5rem auto 0;
  padding: 0 var(--gutter);
}

/* ─── Embeds ───────────────────────────────── */

.embed-video {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
}

.embed-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-image {
  display: block;
  text-decoration: none !important;
  border: 1px solid var(--rule);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.embed-image:hover { border-color: rgba(0, 0, 0, 0.28); }

.embed-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Tweet card ────────────────────────────── */

.tweet-card {
  display: block;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid var(--rule);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.2s ease;
}

.tweet-card:hover { border-color: rgba(0, 0, 0, 0.28); }

.tweet-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 1rem 1.25rem 0.25rem;
}

.tweet-author { font-weight: 600; font-size: 0.9375rem; color: var(--fg); }
.tweet-handle { color: var(--muted); font-weight: 400; font-size: 0.875rem; }

.tweet-text {
  padding: 0.5rem 1.25rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--fg);
}

.tweet-media {
  position: relative;
  width: 100%;
  background: #000;
  display: block;
}

.tweet-media img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.tweet-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tweet-play-icon::after {
  content: '';
  width: 56px;
  height: 56px;
  background-color: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'><path d='M8 5v14l11-7z'/></svg>");
  background-repeat: no-repeat;
  background-position: 56% center;
  background-size: 24px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.tweet-card:hover .tweet-play-icon::after {
  background-color: rgba(0, 0, 0, 0.8);
  transform: scale(1.05);
}

.tweet-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.tweet-footer time { display: none; }

.tweet-cta { font-weight: 500; color: var(--fg); }

.tweet-card:hover .tweet-cta {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ─────────────────────────────────────────────
   Carousel — universal DOM, variant-controlled
   ───────────────────────────────────────────── */

.tweets-carousel {
  position: relative;
  width: 100%;
}

.c-frame {
  position: relative;
  width: 100%;
}

.tweets-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.tweets-track::-webkit-scrollbar { display: none; }

.tweets-track > .tweet-card,
.tweets-track > .video-card {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.tweets-carousel,
.c-frame,
.tweets-track {
  min-width: 0;
  max-width: 100%;
}

/* ─── Video card (used in JetBlue carousel) ────── */

.video-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  overflow: hidden;
}

.video-card video {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: cover;
}

.video-caption {
  padding: 0.875rem 1.25rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fg);
  letter-spacing: -0.005em;
  text-wrap: balance;
}

/* All controls hidden by default — variants opt in */
.c-tabs, .c-progress, .c-arrow, .c-dots, .c-counter, .c-thumbs, .c-timeline {
  display: none;
}

/* ── Bottom controls container ── */
.c-controls {
  margin-top: 1.25rem;
}

/* ── Dots ── */
.c-dots {
  gap: 8px;
  justify-content: center;
}

.c-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.c-dot[aria-current="true"] {
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.15);
}

.c-dot:hover { background: rgba(0, 0, 0, 0.45); }

.c-dot:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.4);
  outline-offset: 3px;
}

/* ── Numbered counter ── */
.c-counter {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.c-counter-current { color: var(--fg); font-weight: 500; }

/* ── Arrows ── */
.c-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--rule);
  cursor: pointer;
  z-index: 5;
  font-size: 22px;
  color: var(--fg);
  font-family: inherit;
  line-height: 1;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.c-arrow:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.05);
}

.c-prev { left: -20px; }
.c-next { right: -20px; }

/* ── Tabs ── */
.c-tabs {
  gap: 0;
  margin-bottom: 1rem;
  justify-content: flex-start;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.c-tabs::-webkit-scrollbar { display: none; }

.c-tab {
  background: transparent;
  border: 0;
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 0 0 auto;
}

.c-tab[aria-current="true"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.c-tab:hover { color: var(--fg); }

/* ── Thumbnails ── */
.c-thumbs {
  gap: 0.5rem;
  justify-content: center;
}

.c-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.c-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.c-thumb[aria-current="true"] {
  opacity: 1;
  border-color: var(--fg);
}

.c-thumb:hover { opacity: 1; }

/* ── Timeline ── */
.c-timeline {
  gap: 0;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 0 1rem;
}

.c-timeline::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  top: 6px;
  height: 1px;
  background: var(--rule);
  z-index: 0;
}

.c-timeline-marker {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
  font-family: inherit;
}

.c-marker-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.c-timeline-marker[aria-current="true"] .c-marker-dot {
  background: var(--fg);
  border-color: var(--fg);
}

.c-marker-date {
  font-size: 0.6875rem;
  color: var(--muted);
  font-feature-settings: "tnum" 1;
}

.c-timeline-marker[aria-current="true"] .c-marker-date {
  color: var(--fg);
  font-weight: 500;
}

/* ── Progress bar ── */
.c-progress {
  position: relative;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  border-radius: 1px;
  overflow: hidden;
}

.c-progress-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--fg);
  border-radius: 1px;
}

/* ─────────────────────────────────────────────
   Variant declarations
   ───────────────────────────────────────────── */

/* 1. Dots (minimal) */
[data-variant="dots"] .c-dots { display: flex; }

/* 2. Numbered (arrows + counter) */
[data-variant="numbered"] .c-arrow { display: flex; }
[data-variant="numbered"] .c-counter { display: block; }

/* 3. Tabbed above */
[data-variant="tabbed"] .c-tabs { display: flex; }

/* 4. Thumbnail strip */
[data-variant="thumbnails"] .c-thumbs { display: flex; }

/* 5. Side-peek */
[data-variant="side-peek"] .c-dots { display: flex; }
[data-variant="side-peek"] .tweets-track {
  scroll-padding: 0 12%;
  padding: 0 12%;
  gap: 1rem;
}
[data-variant="side-peek"] .tweets-track > .tweet-card,
[data-variant="side-peek"] .tweets-track > .video-card {
  flex: 0 0 76%;
  scroll-snap-align: center;
}

/* 6. Stacked deck */
[data-variant="stacked"] .tweets-track {
  display: block;
  position: relative;
  height: 600px;
  overflow: visible;
}
[data-variant="stacked"] .tweets-track > .tweet-card,
[data-variant="stacked"] .tweets-track > .video-card {
  position: absolute;
  inset: 0;
  flex: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  cursor: pointer;
}
[data-variant="stacked"] .tweets-track > [data-stack="0"] {
  transform: translate(0, 0) rotate(0deg);
  z-index: 4;
  opacity: 1;
}
[data-variant="stacked"] .tweets-track > [data-stack="1"] {
  transform: translate(10px, 12px) rotate(1.5deg);
  z-index: 3;
  opacity: 0.6;
}
[data-variant="stacked"] .tweets-track > [data-stack="2"] {
  transform: translate(20px, 24px) rotate(3deg);
  z-index: 2;
  opacity: 0.3;
}
[data-variant="stacked"] .tweets-track > [data-stack="3"] {
  transform: translate(30px, 36px) rotate(4.5deg);
  z-index: 1;
  opacity: 0.15;
}
[data-variant="stacked"] .c-counter { display: block; }

/* 7. Auto-advance */
[data-variant="auto"] .c-progress { display: block; }
[data-variant="auto"] .c-dots { display: flex; }

/* 8. Timeline */
[data-variant="timeline"] .c-timeline { display: flex; }

/* 9. Hover arrows */
[data-variant="hover-arrows"] .c-arrow {
  display: flex;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.2s ease;
  pointer-events: auto;
}
[data-variant="hover-arrows"] .c-frame:hover .c-arrow,
[data-variant="hover-arrows"] .c-frame:focus-within .c-arrow {
  opacity: 1;
}
[data-variant="hover-arrows"] .c-dots { display: flex; }

/* 10. Vertical pager */
[data-variant="vertical"] .tweets-track {
  flex-direction: column;
  scroll-snap-type: y mandatory;
  height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
}
[data-variant="vertical"] .tweets-track > .tweet-card,
[data-variant="vertical"] .tweets-track > .video-card {
  flex: 0 0 auto;
  width: 100%;
  scroll-snap-align: start;
}
[data-variant="vertical"] .c-counter { display: block; }

/* ─── Read-more CTA ─────────────────────────── */

.read-more {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-top: 1.25rem;
}

/* ─── Closing ──────────────────────────────── */

.closing {
  margin-top: 0;
  text-align: center;
}

.closing p {
  font-size: clamp(0.6875rem, 1.6vw, 0.875rem);
  line-height: 1.5;
  margin-bottom: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.signoff {
  margin-top: 1.75rem !important;
  margin-bottom: 0 !important;
  font-size: var(--body-size);
}

/* ─── Links ────────────────────────────────── */

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0, 0, 0, 0.4);
  text-underline-offset: 4px;
}

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Tablet / collapse grid ────────────────── */

@media (max-width: 900px) {
  .piece, .piece-right {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "media"
      "lesson";
    column-gap: 0;
    row-gap: 2.25rem;
  }
  .piece-media,
  .piece-right .piece-media { width: 100%; margin-left: 0; }
  .lesson { margin-top: 2.5rem; }

  .c-arrow { width: 36px; height: 36px; font-size: 18px; }
  .c-prev { left: 8px; }
  .c-next { right: 8px; }
}

/* ─── Mobile ───────────────────────────────── */

@media (max-width: 480px) {
  :root {
    --hero-size: 48px;
    --subhead-size: 19px;
    --h2-size: 26px;
    --lesson-size: 26px;
    --body-size: 16px;
  }

  .hero { margin-bottom: 4.5rem; }
  .section-divider { margin: 3rem auto; width: clamp(220px, 75%, 440px); }

  .lesson { margin: 2rem auto 0; max-width: 22em; }

  .tweet-text { font-size: 0.9375rem; }
}

/* ─── Print ────────────────────────────────── */

@media print {
  body { font-size: 11pt; }
  .embed-video, .tweets-carousel, .embed-image, .video-card { display: none !important; }
}
