/* Typography, control geometry, and motion shared across every page. */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-400.woff') format('woff');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-500.woff') format('woff');
  font-style: normal;
  font-weight: 450 550;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-600.woff') format('woff');
  font-style: normal;
  font-weight: 600 650;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-700.woff') format('woff');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --font-ui: 'Inter', sans-serif;
  --radius-control: 12px;
  --radius-panel: 16px;
  --control-height: 44px;
  --motion-fast: 150ms;
  --motion-normal: 220ms;
  --ease-ui: cubic-bezier(.2, .75, .25, 1);
  --border-control: #36424e;
  --focus-color: #85b6ff;
}
html { scrollbar-gutter: stable; }
body {
  font-family: var(--font-ui);
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; }
h1 { font-weight: 600; letter-spacing: -.043em; }
h2 { font-weight: 500; letter-spacing: -.035em; }
h3 { font-weight: 500; letter-spacing: -.022em; }
p { letter-spacing: -.015em; }
.lead { letter-spacing: -.025em; line-height: 1.46; }
.brand { font-weight: 600; letter-spacing: -.035em; }
.brand small { letter-spacing: -.01em; }
.eyebrow { line-height: 1.6; letter-spacing: .26em; font-weight: 600; }
.hero h1 { font-size: clamp(36px, 4.5vw, 58px); line-height: 1.08; }
.card-open h3 { line-height: 1.35; font-weight: 500; }
.stat strong { font-weight: 400; letter-spacing: -.04em; }
.panel, .project-card { border-radius: var(--radius-panel); }
.button, .icon-button, .filter, .select-trigger, input, textarea {
  transition: color var(--motion-fast) var(--ease-ui), background-color var(--motion-fast) var(--ease-ui), border-color var(--motion-fast) var(--ease-ui), box-shadow var(--motion-fast) var(--ease-ui), transform var(--motion-fast) var(--ease-ui);
}
.button, .icon-button {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.015em;
  background: #1b2229;
  border-color: var(--border-control);
}
.button { padding: 12px 20px; }
.icon-button { width: 42px; padding: 10px; }
.button:hover, .icon-button:hover { transform: none; }
.button:active, .icon-button:active { transform: translateY(1px) scale(.985); }
.button svg { width: 16px; height: 16px; stroke-width: 1.7; }
.button.primary { background: #1267ff; border-color: #347eff; color: #fff; }
.button.primary:hover { background: #2877ff; border-color: #6a9eff; box-shadow: 0 3px 15px #1267ff20; }
.button.white { background: #f6f8fa; border-color: #f6f8fa; color: #12161c; }
.button.white:hover { background: #e4ebf4; border-color: #e4ebf4; }
.site-header .button { min-height: 42px; }
.icon-tile { background: #242b33; border: 1px solid #2a323a; border-radius: 12px; }
.icon-tile svg { stroke-width: 1.65; }
.icon-tile.blue { background: #1b293e; border-color: #23314a; }
.search {
  min-height: 52px;
  border-color: var(--border-control);
  border-radius: 14px;
  padding: 9px 15px;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.search:focus-within { border-color: #689df1; box-shadow: 0 0 0 3px #2777ff15; }
.search input { min-height: 30px; border: none; box-shadow: none; }
.search input:focus-visible { outline: none; }
.search > svg { width: 20px; height: 20px; }
.filters { min-height: 52px; border-radius: 15px; padding: 5px; gap: 3px; }
.filter { min-height: 40px; padding: 10px 14px; border-radius: 10px; line-height: 1.3; font-weight: 400; }
.filter.active { color: #111820; background: #f7f9fc; box-shadow: 0 1px 5px #0003; }
.filter:active { transform: scale(.97); }
input:not(.search input), textarea {
  border-color: #485764;
  border-radius: 10px;
  line-height: 1.5;
  background: #141b22;
}
input:not(.search input):hover, textarea:hover { border-color: #627385; }
input:not(.search input):focus, textarea:focus { border-color: #77a9fc; box-shadow: 0 0 0 3px #2777ff18; }
textarea { resize: vertical; min-height: 108px; }
.custom-select {
  position: relative;
  flex: 0 0 135px;
  min-width: 135px;
  min-height: 52px;
  border: 1px solid var(--border-control);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.custom-select:focus-within, .custom-select.is-open { border-color: #689df1; box-shadow: 0 0 0 3px #2777ff15; }
.select-caption { display: block; position: absolute; pointer-events: none; left: 14px; top: 7px; font-size: 10px; color: #a8b3c1; }
.select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 50px; border: 0; border-radius: 13px; background: transparent; color: #f0f3f8; padding: 20px 12px 5px 14px; text-align: left; font-size: 12px; }
.select-trigger:focus-visible { outline: none; }
.select-trigger svg { width: 17px; height: 17px; transform: translateY(-5px); transition: transform var(--motion-fast) var(--ease-ui); }
.is-open .select-trigger svg { transform: translateY(-5px) rotate(180deg); }
.select-options { position: absolute; z-index: 10; top: calc(100% + 7px); right: 0; width: 185px; margin: 0; padding: 5px; list-style: none; background: #1a222b; border: 1px solid #405065; border-radius: 12px; box-shadow: 0 10px 30px #0006; }
.select-options [role=option] { position: relative; padding: 11px 34px 11px 11px; border-radius: 7px; color: #c2cbd6; font-size: 12px; line-height: 1.4; cursor: pointer; outline: none; }
.select-options [role=option]:hover, .select-options [role=option].focused { background: #283648; color: #fff; }
.select-options [aria-selected=true] { color: #a6c9ff; }
.select-options [aria-selected=true]::after { content: ''; position: absolute; right: 13px; top: 14px; width: 9px; height: 5px; border-left: 1.6px solid #89b7ff; border-bottom: 1.6px solid #89b7ff; transform: rotate(-45deg); }
.project-card { transition: border-color var(--motion-normal) var(--ease-ui), box-shadow var(--motion-normal) var(--ease-ui), transform var(--motion-normal) var(--ease-ui); }
.project-card:hover { transform: translateY(-2px); border-color: #3e5065; box-shadow: 0 7px 20px #0002; }
.card-open:focus-visible { outline-offset: 3px; }
.preview { overflow: hidden; border-radius: 11px; }
.preview img { transition: transform 300ms var(--ease-ui); }
@media (hover: hover) { .project-card:hover .preview img { transform: scale(1.025); } }
.post-card { transition: border-color var(--motion-normal) var(--ease-ui), background-color var(--motion-normal) var(--ease-ui); }
.post-card:hover { border-color: #3e5065; background: #161d23; }
.post-arrow { transition: background-color var(--motion-fast), transform var(--motion-fast); }
.post-card:hover .post-arrow { transform: translateX(2px); background: #2b3744; }
.tabs { gap: 5px; }
.code-panel .tabs .filter { min-height: 34px; padding: 8px 13px; }
.code-panel .tabs .filter.active { color: #fff; background: #2b3642; box-shadow: none; }
.code-panel pre { padding-right: 32px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; list-style: none; min-height: 30px; font-size: 16px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; width: 8px; height: 8px; margin-right: 5px; flex-shrink: 0; border-right: 1.5px solid #9ab0c8; border-bottom: 1.5px solid #9ab0c8; transform: rotate(45deg); transition: transform var(--motion-normal) var(--ease-ui); }
.faq details[open] summary::after { transform: rotate(225deg); }
.faq details div { padding: 0 30px 8px 0; animation: none; }
progress { appearance: none; border: none; background: #2a3543; border-radius: 20px; overflow: hidden; }
progress::-webkit-progress-bar { background: #2a3543; }
progress::-webkit-progress-value { background: #448bff; border-radius: 20px; transition: width var(--motion-normal) var(--ease-ui); }
progress::-moz-progress-bar { background: #448bff; border-radius: 20px; }
#quiz-choices .choice { justify-content: space-between; min-height: 48px; }
#quiz-choices .choice:hover { border-color: #6a9bea; background: #1c2a3c; }
#quiz-question:focus { outline: none; }
dialog { box-shadow: 0 24px 100px #0007; overscroll-behavior: contain; border-color: #344e72; }
dialog[open] { animation: dialog-in 220ms var(--ease-ui); }
dialog[open]::backdrop { animation: backdrop-in 180ms ease-out; }
dialog.is-closing { animation: dialog-out 140ms ease-in forwards; pointer-events: none; }
dialog.is-closing::backdrop { animation: backdrop-out 140ms ease-in forwards; }
dialog .close { border-radius: 10px; }
#toast { font-size: 13px; transition: opacity 180ms var(--ease-ui), transform 180ms var(--ease-ui); }
main { animation: page-in 280ms var(--ease-ui); }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { to { opacity: 0; } }
@media (min-width: 1080px) {
  .toolbar { gap: 16px; }
  .toolbar .filters { flex-shrink: 0; }
  .toolbar .filter { padding-inline: 11px; }
}
@media (max-width: 760px) {
  .hero h1 { font-size: 42px; }
  .hero .earth { object-position: center 30%; }
  .toolbar { gap: 12px; }
  .custom-select { flex-basis: 130px; min-width: 130px; }
  .filters { gap: 3px; }
  .filter { flex: 1 0 auto; text-align: center; }
  .tabs .filter { flex: 0 1 auto; }
  .search input, input:not(.search input), textarea { font-size: 16px; }
  .button { min-height: 44px; }
  dialog { width: calc(100% - 24px); max-height: calc(100dvh - 32px); border-radius: 16px; padding: 22px; }
}
@media (max-width: 430px) {
  .hero h1 { font-size: 36px; }
  .hero { padding: 21px; }
  .hero .button { padding: 12px 14px; }
  .home-grid .card-top { min-height: 76px; align-content: flex-start; }
  .home-grid .card-top .tag { margin-left: auto; }
  .toolbar .search { min-width: 0; flex-basis: calc(100% - 144px); }
  .toolbar .search input { width: 100%; font-size: 13px; }
  .toolbar .filter { font-size: 11px; padding: 9px 10px; }
  .custom-select { flex-basis: 125px; min-width: 125px; }
  .site-header .header-cta { min-height: 40px; padding: 10px 12px; }
  .site-header .menu-toggle { min-height: 40px; width: 38px; }
  .select-options [role=option] { min-height: 44px; display: flex; align-items: center; }
  .select-options [aria-selected=true]::after { top: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
/* Keep editorial line breaks from joining words when they reflow. */
.about-hero, .story, .editorial, .hero { min-width: 0; }
.about-hero > *, .story > *, .editorial > *, .hero > * { min-width: 0; }
.earth { object-fit: contain; background: #0b0e11; }
.hero .lead { font-size: 16px; line-height: 1.4; }
.people .icon-tile { width: 36px; height: 36px; }
.people .icon-tile svg { width: 23px; height: 23px; }
@media (min-width: 761px) and (max-width: 1050px) {
  .site-header { min-height: 76px; }
  .hero h1 { font-size: 43px; }
  .hero-copy { padding: 14px 0; }
  .hero .earth { min-height: 395px; }
  .hero .lead { margin-top: 15px; }
  .hero .actions { margin-top: 21px; }
  .hero .people { margin-top: 23px; }
}
@media (max-width: 760px) {
  .hero .earth { object-fit: cover; object-position: center 30%; }
  .about-hero .page-heading h1 { overflow-wrap: normal; }
}
@media (max-width: 430px) {
  .home-grid .card-top { min-height: 52px; }
  .toolbar .filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar .filter { min-width: 0; padding-inline: 8px; }
}


/* Project favicon images in icon tiles */
.project-favicon {
  width: 27px;
  height: 27px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.icon-tile .project-favicon {
  width: 27px;
  height: 27px;
}
.modal-heading .icon-tile .project-favicon {
  width: 30px;
  height: 30px;
}


/* Earth image with text overlay */
.earth-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  background: #0b0e11;
}
.earth-wrap .earth {
  border: 0;
  border-radius: 0;
  min-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.earth-overlay-top,
.earth-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  padding: 24px 28px;
  z-index: 2;
  pointer-events: none;
}
.earth-overlay-top {
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.earth-overlay-top span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #c0c8d2;
  line-height: 1.65;
  text-transform: uppercase;
}
.earth-overlay-bottom {
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.earth-overlay-bottom p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.55;
  color: #e8ecf1;
  text-transform: uppercase;
}
.earth-overlay-bottom i,
.earth-overlay-bottom svg {
  width: 32px;
  height: 32px;
  color: #8898a8;
  stroke-width: 1.3;
  flex-shrink: 0;
}

/* Responsive adjustments for earth overlay */
@media (max-width: 1050px) {
  .earth-wrap { min-height: 395px; }
}
@media (max-width: 760px) {
  .earth-wrap {
    min-height: 0;
    max-height: 300px;
    aspect-ratio: 1.3;
  }
  .earth-overlay-top { padding: 18px 20px; }
  .earth-overlay-top span { font-size: 11px; letter-spacing: 0.15em; }
  .earth-overlay-bottom { padding: 16px 20px; }
  .earth-overlay-bottom p { font-size: 12px; letter-spacing: 0.1em; }
  .earth-overlay-bottom svg { width: 24px; height: 24px; }
}
@media (max-width: 430px) {
  .earth-wrap { max-height: 260px; }
  .earth-overlay-top { padding: 14px 16px; gap: 0; }
  .earth-overlay-top span { font-size: 10px; letter-spacing: 0.12em; line-height: 1.55; }
  .earth-overlay-bottom { padding: 12px 16px; }
  .earth-overlay-bottom p { font-size: 11px; letter-spacing: 0.08em; }
  .earth-overlay-bottom svg { width: 20px; height: 20px; }
}


/* Article hero image: clip to banner aspect ratio (only on article detail pages) */
.article-layout .article-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  margin: 26px 0 34px;
}
@media (max-width: 760px) {
  .article-layout .article-image {
    max-height: 280px;
  }
}
@media (max-width: 430px) {
  .article-layout .article-image {
    max-height: 220px;
  }
}


/* New logo: square aspect ratio */
img.logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
@media (max-width: 430px) {
  img.logo {
    width: 25px;
    height: 25px;
  }
}
