@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/css/fonts/inter-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --ios-bg: #f2f2f7;
  --ios-surface: #fff;
  --ios-text: #000;
  --ios-text-secondary: #3c3c4399;
  --ios-text-tertiary: #3c3c434d;
  --ios-separator: #3c3c434a;
  --ios-fill-pressed: #3c3c4314;
  --ios-accent: #e8734a;
  --ios-blue: #007aff;
  --ios-green: #34c759;
  --gh-cell-empty: #2e2e30;
  --glass-fill: #99999954;
  --glass-blend: luminosity;
  --glass-edge-side: #d0d0d0;
  --glass-edge-ring: #ccc;
  --glass-rim-1: #fff6;
  --glass-rim-2: #ffffff47;
  --glass-rim-3: #ffffff2e;
  --glass-rim-4: #ffffff1f;
  --top-inset: 58px;
}
html[data-mode="dark"] {
  color-scheme: dark;
  --ios-bg: #000;
  --ios-surface: #1c1c1e;
  --ios-text: #fff;
  --ios-text-secondary: #ebebf599;
  --ios-text-tertiary: #ebebf54d;
  --ios-separator: #545458a6;
  --ios-fill-pressed: #ebebf51f;
  --ios-blue: #0a84ff;
  --glass-fill: #2828286b;
  --glass-blend: normal;
  --glass-edge-side: #ffffff1f;
  --glass-edge-ring: #ffffff1f;
  --glass-rim-1: #ffffff2e;
  --glass-rim-2: #ffffff1f;
  --glass-rim-3: #ffffff14;
  --glass-rim-4: #ffffff0f;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #fff; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'SF Pro', Inter, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--ios-text);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
/* The site's change-theme button stays on this page, beside the Settings switch. */
.mode-btn { min-width: 44px; min-height: 44px; }

.stage { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 2rem; perspective: 1500px; overflow: clip; }
.device {
  position: relative;
  aspect-ratio: 880 / 1812;
  width: max(240px, min(400px, calc((100vh - 4rem) * .4857)));
  width: max(240px, min(400px, calc((100dvh - 4rem) * .4857)));
  container-type: inline-size;
}

/* Titanium band, then the black bezel around the glass. */
.frame {
  position: absolute; inset: .45cqw 0; border-radius: 18.2cqw;
  background:
    linear-gradient(90deg, #8d8d8a 0, #f6f6f4 1.6%, #c4c4c1 3.4%, transparent 7%, transparent 93%, #c4c4c1 96.6%, #f6f6f4 98.4%, #8d8d8a 100%),
    linear-gradient(180deg, #9a9a97 0, #fafaf8 .9%, #bdbdba 1.9%, #d9d9d6 50%, #a9a9a6 98.1%, #e9e9e7 99.1%, #858582 100%);
  box-shadow: inset 0 0 0 .1cqw #81817e, inset 0 0 0 .32cqw #dbd9d7, 0 15px 24px -17px #17171966;
}
.frame::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(to bottom, transparent 10%, #777773 10% 10.4%, transparent 10.4% 82.6%, #82817f 82.6% 83%, transparent 83%); }
.device::before { content: ''; position: absolute; inset: 72% -6% 0; background: #11111129; border-radius: 50%; filter: blur(20px); }
.frame::after { content: ''; position: absolute; inset: 1.25cqw; border-radius: 16.95cqw; background: #050506; box-shadow: 0 0 0 .2cqw #57575a; }
.frame .btn { position: absolute; width: .8cqw; background: linear-gradient(90deg, #a3a3a0, #ededeb 50%, #b9b9b6); z-index: -1; }
.frame .action, .frame .vol-up, .frame .vol-down { left: -.45cqw; border-radius: .4cqw 0 0 .4cqw; }
.frame .action { top: 22.4%; height: 3.5%; }
.frame .vol-up { top: 29.3%; height: 6.6%; }
.frame .vol-down { top: 37.6%; height: 6.6%; }
.frame .power { right: -.45cqw; top: 32.3%; height: 10.6%; border-radius: 0 .4cqw .4cqw 0; }

.screen-box { position: absolute; inset: 1.49% 3.75%; border-radius: 14.9cqw; overflow: hidden; }
.screen { position: relative; isolation: isolate; width: 100%; height: 100%; border-radius: inherit; overflow: clip; background: var(--ios-bg); }
.wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -1; pointer-events: none; user-select: none; }
.scaler { position: relative; width: 370px; height: 100%; transform-origin: 0 0; }

.status-bar { position: absolute; inset: 0 0 auto; height: 58px; z-index: 20; color: #fff; pointer-events: none; transition: color .3s ease-out; }
.screen.in-app .status-bar { color: var(--ios-text); }
.status-bar .time { position: absolute; left: 49px; top: 17.5px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.status-icons { position: absolute; right: 30px; top: 21.5px; width: 74px; height: 13.3px; }
.island { position: absolute; top: 11px; left: 50%; width: 122px; height: 34px; margin-left: -61px; border-radius: 999px; background: #000; z-index: 21; pointer-events: none; }

.home { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--top-inset) 10px 18px; }
.widgets { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; margin-top: 8px; padding: 0 4px; }
.widget-slot { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.widget-label, .app > span { color: #fff; font-weight: 500; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.widget-label { font-size: 13px; line-height: 1.5; }
.github-widget { display: block; aspect-ratio: 1; border-radius: 26px; padding: 8.9%; background: #1c1c1e; box-shadow: 0 10px 30px -12px #00000040; transition: transform .16s ease-out; }
.github-widget:active { transform: scale(.97); }
.contribution-grid { display: grid; grid-template: repeat(7, 1fr) / repeat(7, 1fr); grid-auto-flow: column; gap: 2.9%; width: 100%; height: 100%; }
.contribution-grid i { border-radius: 20%; background: var(--gh-cell-empty); }
.contribution-grid i[data-level="1"] { background: #9be9a8; }
.contribution-grid i[data-level="2"] { background: #40c463; }
.contribution-grid i[data-level="3"] { background: #30a14e; }
.contribution-grid i[data-level="4"] { background: #216e39; }
.contribution-grid i:nth-child(1) { border-top-left-radius: 16px; }
.contribution-grid i:nth-child(7) { border-bottom-left-radius: 16px; }
.contribution-grid i:nth-child(43) { border-top-right-radius: 16px; }
.contribution-grid i:nth-child(49) { border-bottom-right-radius: 16px; }

.weather-widget { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1; border-radius: 26px; padding: 13px; color: #fff; background: linear-gradient(155deg, #273858, #40516c); }
.weather-widget[data-sky="night"] { background: linear-gradient(155deg, #1b2545, #2d395c); }
.weather-widget[data-sky="clear"] { background: linear-gradient(155deg, #1c2b4e, #354a6d); }
.weather-widget[data-sky="grey"] { background: linear-gradient(155deg, #303b50, #4a566c); }
.weather-city { display: flex; align-items: center; gap: 3px; font-size: 15px; font-weight: 600; line-height: 1.25; }
.weather-city svg { width: 11px; height: 11px; opacity: .9; }
.weather-temp { margin-top: 2px; font-size: 46px; font-weight: 200; line-height: 1.02; letter-spacing: -.01em; }
.weather-icon { display: block; width: 20px; height: 20px; }
.weather-line { font-size: 13px; font-weight: 500; line-height: 1.375; }
.weather-icon + .weather-line { margin-top: 3px; }

.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 12px; margin-top: 20px; padding: 0 12px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.app > span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.5; }
.app-icon { display: grid; place-items: center; width: 60px; aspect-ratio: 1; overflow: hidden; border-radius: 13px; box-shadow: 0 1px 2px 0 #0000000d; cursor: pointer; transition: transform .16s ease-out; }
.app-icon:active { transform: scale(.96); }
.app-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-icon:focus-visible, .github-widget:focus-visible, .search-pill:focus-visible, .back:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.glass {
  position: relative; isolation: isolate;
  -webkit-backdrop-filter: blur(24px) saturate(120%); backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 1.25px 0 0 -.75px var(--glass-edge-side), -1.25px 0 0 -.75px var(--glass-edge-side), 0 0 0 .5px var(--glass-edge-ring), 0 8px 15px #00000005, 0 12px 24px #00000014;
}
.glass::before, .glass::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; }
.glass::before { background: var(--glass-fill); mix-blend-mode: var(--glass-blend); }
.glass::after { box-shadow: inset 0 1.25px .25px var(--glass-rim-1), inset 0 -1.25px .25px var(--glass-rim-2), inset 0 40px 10px -40px var(--glass-rim-3), inset 0 -40px 10px -40px var(--glass-rim-4); }

.home-bottom { margin-top: auto; }
.home .glass {
  --glass-fill: #292a305c; --glass-blend: normal;
  --glass-edge-side: #ffffff24; --glass-edge-ring: #0000001c;
  --glass-rim-1: #ffffff3b; --glass-rim-2: #ffffff17;
  --glass-rim-3: transparent; --glass-rim-4: transparent;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.search-pill { display: flex; align-items: center; gap: 2px; width: fit-content; height: 30px; margin: 0 auto 16px; padding: 7px 12px; border-radius: 15px; color: #fff; font-size: 11.5px; font-weight: 590; line-height: 16px; }
.search-pill svg { width: 11px; height: 11px; }
.dock { display: flex; align-items: center; justify-content: space-between; height: 90px; margin: 0 8px; padding: 15px; border-radius: 31px; }

.app-layer { position: absolute; inset: 0; z-index: 10; isolation: isolate; }
.app-layer[hidden] { display: none; }
.app-layer::before { content: ''; position: absolute; inset: 0; background: var(--ios-bg); }
.app-content { position: relative; z-index: 1; width: 100%; height: 100%; transform-origin: 0 0; }
.icon-ghost { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; transform-origin: 0 0; }
.icon-ghost img { display: block; width: 100%; height: 100%; object-fit: fill; }
.app-screen { position: relative; display: flex; flex-direction: column; height: 100%; background: var(--ios-bg); --app-tint: var(--ios-accent); }
.app-screen[data-app="settings"] { --app-tint: var(--ios-blue); }
.app-bar { position: absolute; inset: calc(var(--top-inset) + 4px) 0 auto; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 20px; pointer-events: none; }
.back { display: grid; place-items: center; justify-self: start; width: 44px; height: 44px; border-radius: 22px; color: var(--app-tint); pointer-events: auto; transition: transform .15s; }
.back:active { transform: scale(.96); }
.back-face { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.back svg { width: 18px; height: 18px; }
.bar-title { display: flex; align-items: center; height: 36px; max-width: 100%; padding: 0 16px; border-radius: 18px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.app-screen.scrolled .bar-title { opacity: 1; }
.app-scroll { flex: 1; overflow-y: auto; padding: calc(var(--top-inset) + 52px) 20px 64px; scrollbar-width: none; outline: 0; overscroll-behavior: contain; }
.app-scroll::-webkit-scrollbar { display: none; }
.home-indicator { position: absolute; left: 50%; bottom: 0; z-index: 30; height: 18px; padding: 0 40px; transform: translateX(-50%); cursor: pointer; }
.home-indicator[hidden] { display: none; }
.home-indicator span { display: block; width: 134px; height: 5px; border-radius: 999px; background: var(--ios-text); }

/* App pages */
@font-face {
  font-family: Newsreader;
  font-weight: 400 600;
  font-display: swap;
  src: url('/css/fonts/newsreader-normal-latin.woff2') format('woff2');
}
@font-face {
  font-family: Newsreader;
  font-style: italic;
  font-display: swap;
  src: url('/css/fonts/newsreader-italic-latin.woff2') format('woff2');
}
.app-screen[data-app="research"] { background: var(--ios-surface); }
.research-page { font: 400 18px/1.7 Newsreader, Georgia, serif; }
.app-scroll .research-page :is(h1, h2) { margin: 0; padding: 0; font: inherit; font-weight: 600; letter-spacing: normal; text-transform: none; color: inherit; }
.research-page p { margin: 0; }
.research-page .site { margin-bottom: 24px; }
.research-page .site img { vertical-align: -2px; margin-right: 4px; }
.app-scroll .research-page h2 { margin-bottom: 4px; }
.app-scroll .research-page p + h2 { margin-top: 26px; }
.research-page .exp + .exp { margin-top: 14px; }
.research-page .d { color: var(--ios-text-secondary); }
.research-page a { text-decoration: underline; text-decoration-color: var(--ios-separator); text-underline-offset: 3px; }
.research-page a:hover { text-decoration-color: currentColor; }
.app-scroll h1 { margin: 0 0 16px; font-size: 34px; line-height: 1.5; font-weight: 700; letter-spacing: -.02em; }
.app-scroll h1.with-count { margin-bottom: 0; }
.count { margin: 2px 0 16px; font-size: 15px; line-height: 1.5; color: var(--ios-text-secondary); }
.lead { margin: 0 0 16px; font-size: 19px; font-weight: 500; line-height: 1.375; }
.app-scroll p.body { margin: 0 0 12px; font-size: 15px; line-height: 1.625; color: var(--ios-text-secondary); }
.app-scroll p.body a, .fine-print a { color: var(--ios-accent); text-decoration: underline; text-underline-offset: 2px; }
.app-scroll section { margin: 0 0 28px; }
.pad-top { margin-top: 28px; }
.app-scroll h2 { margin: 0 0 8px; padding: 0 16px; font-size: 13px; line-height: 1.5; font-weight: 500; text-transform: uppercase; letter-spacing: .025em; color: var(--ios-text-secondary); }
.app-scroll h2.month { padding: 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -.025em; text-transform: none; color: var(--ios-text); }
.group { overflow: hidden; border-radius: 26px; background: var(--ios-surface); }
.row { display: flex; align-items: center; gap: 12px; padding-left: 16px; }
a.row:active, .post:active, .profile:active { background: var(--ios-fill-pressed); }
.row-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px; overflow: hidden; border-radius: 7px; background: var(--ios-blue); color: #fff; font-size: 15px; font-weight: 700; }
.row-icon svg { width: 18px; height: 18px; }
.row-icon img { width: 100%; height: 100%; object-fit: cover; }
.row-icon.brand { background: white; }
.row-icon.brand img { object-fit: contain; padding: 2px; }
.row-main { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--ios-separator); font-size: 17px; line-height: 1.5; }
.row:last-child .row-main, .post:last-child, .field:last-child { border-bottom: 0; }
.row-main > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text { display: block; min-width: 0; }
.row-text span, .row-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { font-size: 15px; line-height: 1.5; color: var(--ios-text-secondary); }
.chevron { flex: none; color: var(--ios-text-secondary); }
.row.rich { align-items: flex-start; padding-top: 12px; }
.row.rich .row-icon { margin-top: 3px; }
.row.rich .row-main { display: block; padding: 0 16px 12px 0; }
.row.rich h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.375; }
.row.rich h3 .chevron { font-size: 15px; font-weight: 400; }
.row.rich p { margin: 0; font-size: 15px; line-height: 1.375; color: var(--ios-text-secondary); }
.row.rich p.meta { margin-top: 2px; font-size: 13px; color: var(--ios-text-tertiary); }
.post { display: block; padding: 12px 16px; border-bottom: 1px solid var(--ios-separator); }
.post strong { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; }
.post span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 3px; font-size: 15px; line-height: 1.375; color: var(--ios-text-secondary); }
.post span b { font-weight: 500; color: var(--ios-text); }
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; padding: 16px; border-radius: 26px; background: var(--ios-surface); }
.profile img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.profile div { flex: 1; min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { font-size: 20px; font-weight: 600; line-height: 1.4; }
.profile small { font-size: 15px; line-height: 1.5; color: var(--ios-text-secondary); }
.profile .chevron { font-size: 17px; color: var(--ios-text-tertiary); }
.switch { position: relative; flex: none; width: 51px; height: 31px; padding: 0; border: 0; border-radius: 999px; background: var(--ios-separator); cursor: pointer; transition: background-color .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ios-green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.name-line { margin: 0 0 24px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.fine-print { margin: 0 0 12px; padding: 0 16px; font-size: 13px; line-height: 1.5; color: var(--ios-text-secondary); }
.hero { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9.5; margin: 0 0 16px; border-radius: 26px; object-fit: cover; background: var(--ios-surface); }
.hero.square { width: 160px; aspect-ratio: 1; }
.pill-button { display: block; width: 100%; margin: 0 0 28px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--ios-accent); color: #fff; font-size: 16px; line-height: 1.5; font-weight: 600; text-align: center; cursor: pointer; transition: transform .15s; }
.pill-button:active { transform: scale(.98); }
.spotify-button { display: flex; align-items: center; justify-content: center; gap: 12px; background: #000; color: #fff; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 0 -20px 28px; }
.photo-grid a { position: relative; aspect-ratio: 1; overflow: hidden; }
.photo-grid a:active { opacity: .8; }
.photo-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-detail { display: block; width: calc(100% + 40px); max-width: none; margin: 0 -20px 16px; height: auto; }
.photo-nav { display: flex; gap: 12px; margin-bottom: 28px; }
.photo-nav button { flex: 1; padding: 12px; border: 0; border-radius: 999px; background: var(--ios-surface); color: var(--ios-accent); font-size: 16px; font-weight: 600; cursor: pointer; }
form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 12px; }
form .pill-button { margin: 0; }
.field { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ios-separator); }
.field label, .field > span:first-child { flex: none; width: 56px; font-size: 15px; color: var(--ios-text-secondary); }
.field input, .message-box { flex: 1; min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ios-text); font: inherit; font-size: 16px; }
.field .recipient { font-size: 16px; line-height: 1.5; }
.field input::placeholder, .message-box::placeholder { color: var(--ios-text-tertiary); }
.message-card { padding: 16px; border-radius: 26px; background: var(--ios-surface); }
.message-box { display: block; height: 156px; resize: none; line-height: 1.625; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.no-js { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; padding: 32px; background: #fff; color: #000; text-align: center; }
.no-js a { color: var(--ios-accent); text-decoration: underline; }

@media (min-width: 640px) and (prefers-reduced-motion: no-preference) {
  .device {
    transform: rotateX(var(--pitch, 0deg)) rotateY(var(--yaw, 0deg));
    transition: transform .5s ease-out;
    animation: arrive 1s cubic-bezier(.16,.84,.18,1);
  }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(82vh) rotateY(-25deg) rotateX(12deg) rotateZ(5deg) scale(.95); }
  }
}
/* Phones: the screen is the whole viewport, with no frame, status bar or island. */
@media (max-width: 639px) {
  :root { --top-inset: 16px; }
  .stage { padding: 0; }
  body { overflow: hidden; }
  .device { width: 100%; height: 100vh; height: 100dvh; aspect-ratio: auto; container-type: normal; }
  .device::before, .frame, .status-bar, .island { display: none; }
  .screen-box { inset: 0; border-radius: 0; }
  /* A screen too short for the whole home screen (a phone on its side) scrolls it. */
  .home { padding-top: calc(var(--top-inset) + 52px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .home::-webkit-scrollbar { display: none; }
  .widgets, .apps, .home-bottom { flex: none; }
  .home-bottom { padding-top: 20px; }
  .mode-btn { top: 20px !important; right: 16px !important; }
  /* Over the wallpaper the button sits on a frosted disc, so the sun stays black in light mode. */
  body:not(.app-open) .mode-btn { background: #ffffffb8; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  html[data-mode="dark"] body:not(.app-open) .mode-btn { background: #00000066; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
