/* ------------------------------------------------------------------
   Hannah Francis — portfolio homepage
   Layout, components and palette modelled on adrien.website/txt:
   a fake macOS desktop hero that zooms out on scroll, a list of project
   rows and a quiet footer. Light and dark themes.
------------------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --paper-sunk: #f5f6f8;
  --ink: #14171c;
  --ink-soft: #5b6169;
  --ink-faint: #8b909a;
  --line: #eeeeee;
  --accent: #0088ff;
  --brand-title: #000000;
  --brand-sub: #727272;
  --fc-bg: #fafafa;
  --fc-title: #000000;
  --fc-sub: #727272;

  --mono: ui-monospace, "SF Mono", "Menlo", "Cascadia Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --inter: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Desktop wallpaper. Drop an image at images/wallpaper.jpg to replace the painted sky. */
  --wallpaper:
    radial-gradient(ellipse 38% 16% at 12% 78%, rgba(255, 255, 255, 0.95), transparent 70%),
    radial-gradient(ellipse 30% 14% at 30% 84%, rgba(255, 255, 255, 0.9), transparent 70%),
    radial-gradient(ellipse 34% 18% at 88% 70%, rgba(255, 255, 255, 0.95), transparent 70%),
    radial-gradient(ellipse 22% 10% at 70% 86%, rgba(255, 255, 255, 0.85), transparent 70%),
    radial-gradient(ellipse 16% 6% at 55% 30%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #1668c4 0%, #2b8ae0 38%, #5db3f0 70%, #a9dcfa 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111214;
    --paper-sunk: #17181b;
    --ink: #edeef0;
    --ink-soft: #a3a8b0;
    --ink-faint: #6d7178;
    --line: #2a2c30;
    --brand-title: #f2f3f5;
    --brand-sub: #9aa0a8;
    --fc-bg: #18191c;
    --fc-title: #f2f3f5;
    --fc-sub: #9aa0a8;
    --wallpaper:
      radial-gradient(ellipse 38% 16% at 12% 78%, rgba(120, 140, 190, 0.45), transparent 70%),
      radial-gradient(ellipse 34% 18% at 88% 70%, rgba(120, 140, 190, 0.45), transparent 70%),
      radial-gradient(circle at 80% 18%, rgba(255, 255, 240, 0.9) 0 1.2%, transparent 1.6%),
      linear-gradient(180deg, #070d24 0%, #14224f 45%, #2d3f78 80%, #4a5a92 100%);
  }
}

:root[data-theme="dark"] {
  --paper: #111214;
  --paper-sunk: #17181b;
  --ink: #edeef0;
  --ink-soft: #a3a8b0;
  --ink-faint: #6d7178;
  --line: #2a2c30;
  --brand-title: #f2f3f5;
  --brand-sub: #9aa0a8;
  --fc-bg: #18191c;
  --fc-title: #f2f3f5;
  --fc-sub: #9aa0a8;
  --wallpaper:
    radial-gradient(ellipse 38% 16% at 12% 78%, rgba(120, 140, 190, 0.45), transparent 70%),
    radial-gradient(ellipse 34% 18% at 88% 70%, rgba(120, 140, 190, 0.45), transparent 70%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 240, 0.9) 0 1.2%, transparent 1.6%),
    linear-gradient(180deg, #070d24 0%, #14224f 45%, #2d3f78 80%, #4a5a92 100%);
}

* { box-sizing: border-box; }

/* Lenis smooth scroll */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* ---------- header ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--inter);
  font-size: 16px;
  text-decoration: none;
}

.brand .mark {
  font-weight: 500;
  color: var(--brand-title);
  white-space: nowrap;
}

.brand .mark .type,
.brand .mark .cursor {
  display: inline-block;
  vertical-align: middle;
}

.brand .mark .cursor {
  width: 2px;
  height: 0.85em;
  background: var(--accent);
}

.brand .mark .cursor.blink { animation: blink 1.1s step-end infinite; }

.brand .sub {
  font-weight: 400;
  color: var(--brand-sub);
}

@keyframes blink { 50% { opacity: 0; } }

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 14px;
  border-radius: 9999px;
  background: #3b3939;
  color: #ffffff;
  font-family: var(--inter);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease;
}

a.badge:hover,
button.badge:hover { background: #242222; }

.badge--theme {
  gap: 6px;
  border: none;
  cursor: pointer;
}

.badge--theme svg { width: 14px; height: 14px; }
.badge--theme .moon { display: none; }
.badge--theme.active .sun { display: none; }
.badge--theme.active .moon { display: block; }

/* ---------- hero scroll-zoom ---------- */

.hero-pin { position: relative; }

.hero-sticky .top {
  position: relative;
  z-index: 31;
  will-change: transform, opacity;
}

.stage-slot {
  position: relative;
  aspect-ratio: 16 / 11;
}

@media (max-width: 768px) {
  .hero-pin { padding-top: 0 !important; }
  .hero-sticky .top { opacity: 1 !important; transform: none !important; }
  .hero-sticky .stage {
    position: absolute !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 16px !important;
  }
}

/* ---------- stage (fake desktop) ---------- */

.stage {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  background: var(--wallpaper);
  background-size: cover;
  background-position: 50% 42%;
  z-index: 30;
  will-change: top, left, width, height;
}

.menubar {
  position: absolute;
  top: 2px;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 590;
  line-height: 16px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  z-index: 5;
}

.menubar .left,
.menubar .right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menubar a { text-decoration: none; }
.menubar .apple { font-size: 14px; }
.menubar .app-name { font-weight: 860; }
.menubar .menu-item { opacity: 0.85; }
.menubar a.menu-item:hover { opacity: 1; }
.menubar .clock { font-variant-numeric: tabular-nums; }

.app-stack {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, 68%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  z-index: 10;
}

/* ---------- app window ---------- */

.window {
  width: 100%;
  height: 396px;
  display: flex;
  flex-direction: column;
  background: var(--wbg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.25s ease;
  --wbg: #ffffff;
  --wfg: #1b1d21;
  --wfg-soft: #868b92;
  --wpill: #f0f1f3;
  --wpill-active: #ffffff;
}

.window.dark {
  --wbg: #232427;
  --wfg: #ecedef;
  --wfg-soft: #91959c;
  --wpill: #2c2d31;
  --wpill-active: #38393e;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--wbg);
}

.traffic {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
  padding-right: 4px;
}

.traffic span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.traffic span:nth-child(1) { background: #ff5c60; }
.traffic span:nth-child(2) { background: #fac800; }
.traffic span:nth-child(3) { background: #35c759; }

.tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tab-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 140px;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wfg-soft);
  font-family: var(--sans);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.tab-pill.active {
  background: var(--wpill-active);
  color: var(--wfg);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.window.dark .tab-pill.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.tab-pill:hover:not(.active) { background: var(--wpill); }

.icon-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--wfg-soft);
  text-decoration: none;
}

.icon-btn:hover { background: var(--wpill); color: var(--wfg); }
.icon-btn svg { width: 14px; height: 14px; }

.editor-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 6px;
  background: var(--wbg);
}

.editor {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--wfg);
}

.editor[hidden] { display: none; }

.editor h1,
.editor p {
  margin: 0 0 13px;
  font-size: inherit;
  font-weight: 400;
}

.editor a {
  color: var(--wfg);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--wfg) 35%, transparent);
  text-underline-offset: 2px;
}

.editor a:hover { text-decoration-color: currentColor; }

.editor .caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: #0a84ff;
  animation: blink 1s step-end infinite;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: var(--wbg);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--wfg-soft);
}

/* ---------- glass dock ---------- */

.dock {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 9999px;
  background: rgba(36, 38, 44, 0.33);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.glass-seg {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--inter);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.glass-seg svg { width: 16px; height: 16px; flex-shrink: 0; }
.glass-seg:hover:not(.active) { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.glass-seg.active { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.glass-seg .moon { display: none; }
.glass-seg.active .sun { display: none; }
.glass-seg.active .moon { display: block; }

/* ---------- divider ---------- */

.divider {
  max-width: 820px;
  width: 100%;
  height: 1px;
  margin: 60px auto;
  border: 0;
  background: var(--line);
}

/* ---------- promo ---------- */

.work {
  margin-top: 100px;
  scroll-margin-top: 40px;
}

/* Segmented filter pill */
.filter {
  display: flex;
  width: fit-content;
  gap: 2px;
  margin: 0 auto 64px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--paper);
}

.filter__seg {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--inter);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter__seg:hover:not(.active) { color: var(--ink-soft); }

.filter__seg.active {
  background: var(--paper-sunk);
  color: var(--ink);
}

.promos {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.promo[hidden] { display: none; }

.promo.promo--flip { grid-template-columns: 1fr 411px; }
.promo--flip .promo-media { order: 2; }

.promos-empty {
  margin: 0;
  padding: 60px 0;
  font-size: 15px;
  text-align: center;
  color: var(--ink-faint);
}

.promo {
  display: grid;
  grid-template-columns: 411px 1fr;
  gap: 56px;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
}

.promo-media {
  position: relative;
  display: block;
}

.promo-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 411 / 311;
  object-fit: contain;
  border-radius: 20px;
  background: var(--thumb-bg, #ffffff);
}

.promo-media .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(36, 38, 44, 0.45);
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  color: #ffffff;
  translate: -50% -50%;
  transition: background 0.2s ease;
}

.promo-media:hover .play { background: rgba(36, 38, 44, 0.65); }
.promo-media .play svg { width: 18px; height: 18px; margin-left: 2px; }

.promo-copy h3 {
  margin: 0 0 14px;
  font-family: var(--inter);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}

.promo-copy p {
  max-width: 38ch;
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--brand-sub);
}

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--ink-faint);
}

.foot nav { display: flex; gap: 16px; }

.foot a {
  color: var(--ink-faint);
  text-decoration: none;
}

.foot a:hover {
  color: var(--ink-soft);
  text-decoration: underline;
}

/* ---------- breakpoints ---------- */

@media (max-width: 680px) {
  .menubar .hide-narrow { display: none; }
  .menubar { font-size: 11px; padding: 0 12px; }
  .menubar .left,
  .menubar .right { gap: 10px; }
  .stage-slot { aspect-ratio: 3 / 4.3; }
  .app-stack { width: 84%; gap: 12px; }
  .window { height: 300px; }
  .tab-pill { max-width: 90px; padding: 4px 6px; font-size: 11px; }
  .editor-wrap { padding: 14px 16px 4px; }
  .editor { font-size: 12.5px; }
  .statusbar { font-size: 9.5px; padding: 6px 12px; }
  .dock { gap: 4px; max-width: 100%; }
  .glass-seg { width: 34px; height: 34px; padding: 0; gap: 0; justify-content: center; }
  .glass-seg span { display: none; }
  .promo,
  .promo.promo--flip { grid-template-columns: 1fr; gap: 28px; }
  .promo--flip .promo-media { order: 0; }
  .promos { gap: 66px; }
  .work { margin-top: 66px; }
  .filter { margin-bottom: 48px; }
  .filter__seg { padding: 7px 12px; font-size: 14px; gap: 6px; }
  .divider { margin: 40px auto; }
  .brand .sub { display: none; }
}

/* ---------- homepage text scale ----------
   Every text size on the homepage is 2px larger than the shared
   defaults above, which the case study pages keep. */

.home .brand { font-size: 18px; }
.home .badge { font-size: 15px; height: 34px; padding: 0 24px; }
.home .menubar { font-size: 15px; }
.home .menubar .apple { font-size: 16px; }
.home .tab-pill { font-size: 15px; }
.home .editor { font-size: 15px; }
.home .statusbar { font-size: 12.5px; }
.home .glass-seg { font-size: 15px; }
.home .filter__seg { font-size: 17px; }
.home .promos-empty { font-size: 17px; }
.home .promo-copy h3 { font-size: 23px; }
.home .promo-copy p { font-size: 17px; }
.home .foot { font-size: 15px; }

@media (max-width: 680px) {
  .home .menubar { font-size: 13px; }
  .home .tab-pill { font-size: 13px; }
  .home .editor { font-size: 14.5px; }
  .home .statusbar { font-size: 11.5px; }
  .home .filter__seg { font-size: 16px; }
}
