:root {
  color-scheme: light dark;
  --bg: #f4f7f9;
  --surface: #e9f0f3;
  --surface-soft: #e9f0f3;
  --ink: #132330;
  --muted: #526675;
  --line: #d5e0e6;
  --line-strong: #d5e0e6;
  --accent: #347b80;
  --accent-ink: #163f43;
  --button: #162d3d;
  --button-ink: #f5fafc;
  --max: 1180px;
  --header-height: 78px;
  --footer-gap: 30px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b141c;
    --surface: #14232d;
    --surface-soft: #14232d;
    --ink: #e9f0f5;
    --muted: #afbec8;
    --line: #263946;
    --line-strong: #263946;
    --accent: #83c4c7;
    --accent-ink: #b7e1e3;
    --button: #d7e8eb;
    --button-ink: #0d1d26;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b141c;
  --surface: #14232d;
  --surface-soft: #14232d;
  --ink: #e9f0f5;
  --muted: #afbec8;
  --line: #263946;
  --line-strong: #263946;
  --accent: #83c4c7;
  --accent-ink: #b7e1e3;
  --button: #d7e8eb;
  --button-ink: #0d1d26;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

.screen,
section[id] {
  scroll-margin-top: var(--header-height);
}

.screen {
  min-height: calc(100svh - var(--header-height));
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--button);
  color: var(--button-ink);
  text-decoration: none;
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 87%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--header-height);
  gap: 32px;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.nav-links { gap: 30px; }
.nav-actions { gap: 16px; }

.nav-links a {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="location"] { color: var(--accent); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

.theme-toggle:hover { filter: brightness(1.06); }

.theme-icon {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-moon,
:root[data-theme="dark"] .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon-sun { display: none; }
  :root:not([data-theme]) .theme-icon-moon { display: block; }
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero {
  display: grid;
  align-items: center;
  padding-block: clamp(46px, 6vh, 66px);
}

.hero-copy h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.65rem, 6.25vw, 6.2rem);
  font-weight: 680;
  letter-spacing: -.065em;
  line-height: .96;
}

.hero-copy h1 span { color: var(--accent); }

.hero-intro {
  max-width: 710px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.7;
}

.hero-actions,
.contact-links { gap: 12px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--button); color: var(--button-ink); }
.button-secondary { border-color: var(--line-strong); color: var(--ink); }
.button-secondary:hover { background: var(--surface); }
.button-accent { background: var(--accent); color: var(--bg); }
.button-accent:hover { background: var(--accent-ink); }
.approach-panel { align-self: center; }

.principles {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: baseline;
}

.principles li > span {
  color: var(--accent);
  font-size: .875rem;
  font-weight: 800;
}

.body-copy {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.principles strong {
  color: inherit;
  font-weight: 700;
}

.current-compact { margin-top: 30px; }
.current-copy,
.article-card p { margin: 0; }

.proof {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  background: var(--surface-soft);
}

.proof-section { min-height: 0; }

.recommendations.proof-section {
  display: flex;
  align-items: flex-start;
  padding-block: 46px 26px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .75fr);
  gap: 70px;
  align-items: end;
  margin-bottom: 26px;
}

.section-title {
  margin: 0;
  font-size: clamp(2.65rem, 4.15vw, 4rem);
  font-weight: 680;
  letter-spacing: -.055em;
  line-height: 1.02;
}

.text-link {
  justify-self: end;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.recommendation-card {
  display: flex;
  flex-direction: column;
  min-height: 218px;
  margin: 0;
  padding: 22px;
  border-radius: 14px;
  background: var(--bg);
}

.recommendation-card::before {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.5rem;
  line-height: .8;
  content: "“";
}

.recommendation-card blockquote { margin: 0 0 18px; }

.recommendation-card blockquote p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.46;
}

.recommendation-card figcaption { margin-top: auto; }

.recommendation-card figcaption a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.recommendation-card figcaption strong { font-size: .85rem; }

.recommendation-card figcaption span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.4;
}

.recommendation-card figcaption small {
  margin-top: 7px;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.recommendation-card figcaption a:hover strong { color: var(--accent); }

.credentials.proof-section {
  display: flex;
  align-items: flex-start;
  padding-block: 28px 40px;
}

.credentials .shell {
  display: grid;
  grid-template-columns: minmax(310px, .76fr) minmax(0, 1.24fr);
  gap: 42px;
  align-items: end;
}

.credentials .section-heading {
  display: block;
  align-self: end;
  margin: 0;
  padding-top: 2px;
}

.badge-viewport {
  --rail-gap: 18px;
  --rail-gap-total: 72px;
  --badge-art-size: 146px;
  width: 100%;
  align-self: end;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 16px;
  scroll-padding-inline: 0;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.badge-viewport::-webkit-scrollbar { height: 6px; }
.badge-viewport::-webkit-scrollbar-track { background: transparent; }
.badge-viewport::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line-strong); }

.badge-grid {
  display: flex;
  width: 100%;
  min-width: 100%;
  height: var(--badge-art-size);
  gap: var(--rail-gap);
}

.badge-link {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 calc((100% - var(--rail-gap-total)) / 5);
  height: var(--badge-art-size);
  padding: 0;
  border-radius: 10px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  text-decoration: none;
}

.badge-link::after {
  position: absolute;
  top: 2px;
  right: 3px;
  color: var(--accent);
  font-size: .875rem;
  opacity: 0;
  content: "↗";
  transition: opacity 180ms ease;
}

.badge-link:hover::after,
.badge-link:focus-visible::after { opacity: 1; }

.badge-media {
  display: grid;
  place-items: center;
  width: min(100%, var(--badge-art-size));
  min-height: 0;
  aspect-ratio: 1;
}

.badge-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Artwork adjustments are deliberately independent from rail slot sizing. */
.badge-link[href*="datacamp.com"] .badge-media img {
  width: 87%;
  height: 87%;
  transform: translateY(-3.5%);
}

.badge-link--google-data-analytics .badge-media img { transform: scale(1.2); }

.badge-link--github .badge-media img {
  width: 105%;
  height: 105%;
  transform: translateY(-1.5%);
}

.badge-link--ef .badge-media img {
  width: 92%;
  height: 92%;
  transform: translateY(.5%);
}

.connect-screen {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) 58px;
  column-gap: clamp(42px, 4.5vw, 72px);
  min-height: calc(100svh - var(--header-height));
  padding-inline: max(24px, calc((100% - var(--max)) / 2));
  background: var(--bg);
}

.connect-screen .writing,
.connect-screen .contact {
  min-height: 0;
  padding: 46px 0 var(--footer-gap);
}

.connect-screen .writing { grid-column: 1; }

.connect-screen .writing > .shell,
.connect-screen .contact > .shell {
  width: auto;
  max-width: none;
  margin: 0;
}

.connect-screen .writing > .shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.connect-screen .writing .section-heading {
  display: block;
  margin-bottom: 26px;
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(min-content, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
  max-height: calc(100svh - 240px);
  padding-right: 10px;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.article-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 22px 24px;
  background: var(--surface-soft);
  text-decoration: none;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 20px 0 10px;
  font-size: clamp(1.25rem, 1.65vw, 1.62rem);
  letter-spacing: -.035em;
  line-height: 1.2;
}

.article-link {
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 800;
}

.article-link b { margin-left: 6px; }

.connect-screen .contact {
  grid-column: 2;
  display: flex;
}

.contact-inner {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.contact-copy {
  margin: 24px 0 0;
}

.preferred-domains {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 9px;
  margin: 24px 0 0;
}

.preferred-domains span {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: .875rem;
  font-weight: 700;
  white-space: nowrap;
}

.contact-links {
  display: grid;
  width: max-content;
  margin-top: auto;
  align-items: stretch;
}

.contact-links .button,
.hero-actions .button { justify-content: flex-start; }

.contact-links .button { width: 100%; }
.hero-actions .button { min-width: 0; }

.footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 24px;
  font-size: .875rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (min-width:1121px) {
  .hero.screen {
    grid-template-columns: minmax(0, 1.22fr) minmax(300px, .78fr);
    gap: clamp(40px, 5vw, 72px);
  }

  .approach-panel {
    max-width: 470px;
    justify-self: end;
  }

  .badge-viewport { transform: translateY(24px); }
}

@media (max-width:1120px) {
  .hero.screen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    gap: 56px;
  }

  .approach-panel {
    max-width: none;
    justify-self: stretch;
  }

  .recommendations.proof-section { padding-block: 58px 44px; }
  .credentials.proof-section { padding-block: 36px 40px; }

  .credentials .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .credentials .section-heading {
    align-self: start;
    padding-top: 0;
  }

  .badge-viewport {
    --rail-gap: 12px;
    --rail-gap-total: 24px;
    --badge-art-size: 136px;
    align-self: stretch;
    transform: none;
  }

  .badge-link { flex-basis: calc((100% - var(--rail-gap-total)) / 3); }

  .connect-screen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    min-height: 0;
  }

  .connect-screen .writing,
  .connect-screen .contact,
  .connect-screen .footer { grid-column: 1; }

  .connect-screen .writing,
  .connect-screen .contact { padding-block: 54px 42px; }

  .article-grid {
    max-height: none;
    padding-right: 0;
    overflow: visible;
  }

  .contact-links {
    display: flex;
    flex-wrap: wrap;
    width: min(100%, 420px);
    margin-top: 32px;
  }

  .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommendation-card:last-child { grid-column: 1 / -1; }
}

@media (max-width:720px) {
  .shell { width: min(calc(100% - 32px), var(--max)); }
  .screen { min-height: auto; }
  :root { --header-height: 68px; }
  .nav { width: calc(100% - 24px); gap: 8px; }
  .nav-links { min-width: 0; gap: 8px; }
  .nav-links a { font-size: .66rem; white-space: nowrap; }
  .nav-actions { flex: 0 0 auto; }
  .theme-toggle { width: 38px; height: 38px; }

  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.7rem, 12vw, 3.4rem);
    letter-spacing: -.07em;
  }

  .hero-actions .button { width: 100%; }
  .credentials .shell { gap: 20px; }
  .connect-screen { padding-inline: 16px; }

  .connect-screen .writing,
  .connect-screen .contact { padding-block: 48px 34px; }

  .section-title { font-size: 2.65rem; }

  .contact-links,
  .contact-links .button { width: 100%; }

  .recommendation-grid { grid-template-columns: minmax(0, 1fr); }
  .recommendation-card:last-child { grid-column: auto; }
}

@media (max-width:520px) {
  .nav-links { display:none; }
  .badge-viewport {
    --rail-gap-total: 12px;
    --badge-art-size: 126px;
  }

  .badge-link { flex-basis: calc((100% - var(--rail-gap-total)) / 2); }
}

@media (max-aspect-ratio:4 / 5) and (max-height:1199px) {
  .hero.screen,
  .proof,
  .connect-screen { min-height: auto; }

  .proof,
  .connect-screen { grid-template-rows: auto; }
}

/* Large and portrait displays use a natural reading flow instead of viewport-fit screens. */
@media (min-width:900px) and (min-height:1200px) {
  .hero.screen,
  .proof,
  .connect-screen { min-height: 0; }
}

@media (min-width:1121px) and (min-height:1200px) {
  .connect-screen { grid-template-rows: auto 58px; }
  .article-grid { max-height: none; overflow: visible; }
}

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
