/* ==========================================================================
   Portfolio — one calm column, small type, and the three apps as the pictures.
   ========================================================================== */

:root {
  color-scheme: light dark;
  --bg: light-dark(#fcfcfb, #0c0e0e);
  --ink: light-dark(#121514, #f1f3f2);
  --muted: light-dark(#626967, #98a09e);
  --panel: light-dark(#f3f4f2, #151918);
  --line: light-dark(#e4e6e5, #242928);
  --font: "Geist", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--font); letter-spacing: -.008em; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd { margin: 0; padding: 0; font-size: inherit; }
ul { list-style: none; }
p { text-wrap: pretty; }
img, svg { display: block; max-width: 100%; }
button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
[hidden] { display: none !important; }

.page { width: min(720px, 100% - 48px); margin-inline: auto; padding-block: 88px 72px; }
.muted { color: var(--muted); }
/* Your name can't be highlighted or copied. */
[data-bind="name"] { -webkit-user-select: none; user-select: none; }
section { margin-top: 64px; }
h2 { margin-bottom: 18px; color: var(--muted); font-size: 16px; font-weight: 400; }

/* ---------- Links ---------- */
.text-link, .nav a, .links a, .link, .email { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); text-decoration-thickness: 1px; text-underline-offset: 5px; transition: color .2s, text-decoration-color .2s; }
.text-link:hover, .nav a:hover, .links a:hover, .link:hover, .email:hover { color: var(--ink); text-decoration-color: currentColor; }
.links { display: flex; flex-wrap: wrap; gap: 0 20px; }

/* ---------- Header and intro ---------- */
.nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; }
.nav nav { display: flex; flex-wrap: wrap; gap: 0 20px; color: var(--muted); }
.nav a, .nav button { padding-block: 6px; }
.intro { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 32px; margin-top: 48px; }
#bio { flex: 0 1 620px; }
#bio p + p { margin-top: 18px; }
.photo { flex: none; margin-left: auto; width: 112px; height: 112px; border-radius: 16px; object-fit: cover; }

.now { margin: 48px -24px 0; padding: 22px 24px; border-radius: 16px; background: var(--panel); }
.now h2 { margin-bottom: 8px; }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 24px; }
dt { font-weight: 500; }
dd { color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: #1fa971; vertical-align: 1px; }

/* ---------- Projects ---------- */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; margin-bottom: 18px; color: var(--muted); }
.head h2 { margin: 0; }
.head p { font-size: 16px; }
#demos { position: absolute; }
#projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; }
.project { display: block; width: 100%; }
.cover { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--panel); }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; margin: auto; object-fit: contain; transition: transform .5s var(--ease); }
.project:hover .cover > img { transform: scale(1.05); }
.label { display: block; margin-top: 14px; }
.label b { font-weight: 500; }
.label b { margin-right: 4px; }
.label small { color: var(--muted); font-size: 15px; white-space: nowrap; }
.label > span { display: block; margin-top: 2px; color: var(--muted); font-size: 16px; line-height: 1.5; }

/* the open project: live app on the left, its story on the right */
.open { order: 1; grid-column: 1 / -1; display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: center; gap: 32px 40px; margin-inline: -24px; padding: 32px; border-radius: 24px; overflow: hidden; background: var(--tint, var(--panel)); animation: rise .5s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.open h3 { margin-bottom: 8px; font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.open p + p { margin-top: 12px; }
.open .links { margin-top: 18px; }
.open .links > * { padding-block: 6px; }
.shot { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Resume and footer ---------- */
.entry { display: flex; justify-content: space-between; gap: 24px; }
.entry + .entry { margin-top: 10px; }
.entry b { margin-right: 12px; font-weight: 500; }
.entry span { display: inline-block; }
.entry time { flex: none; }
.entry span, .entry time { color: var(--muted); }
#resume section { margin-top: 48px; }
footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px 24px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); }
footer .link { justify-self: end; }
#place { grid-column: 1 / -1; }
.email { justify-self: start; color: var(--ink); font-weight: 500; }

.icon { display: grid; place-items: center; width: 76px; aspect-ratio: 1; margin-inline: auto; border-radius: 23%; overflow: hidden; background: var(--tile, none); color: #fff; font-weight: 600; }
.icon img { width: 100%; height: 100%; object-fit: contain; }
.icon.padded { padding: 8px; }

/* ---------- Device frame ---------- */
.device { position: relative; background: #0a0d0d; }
.device.phone {
  width: min(100%, 300px); aspect-ratio: 300 / 650; padding: 10px; border-radius: 46px;
  box-shadow: 0 0 0 1px #2e3434, inset 0 0 0 2px #1c2121, 0 30px 60px -24px rgb(10 20 25 / .45), 0 8px 20px -10px rgb(10 20 25 / .3);
}
.device.phone .device-screen { border-radius: 36px; }
.notch { position: absolute; top: 19px; left: 50%; z-index: 7; width: 28%; height: 24px; transform: translateX(-50%); border-radius: 20px; background: #0a0d0d; pointer-events: none; }
.device.browser { width: 100%; border-radius: 12px; overflow: hidden; }
.device.browser .device-screen { aspect-ratio: 16 / 10; height: auto; }
.browser-bar { padding: 8px 14px; color: #a9b5b4; font-size: 14px; }
.device-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; overflow: clip; background: #0a0d0d; color: #fff;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.device-screen > video, .device-screen > iframe, .slides img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }
.message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.message .icon { width: 76px; }

.slides img { opacity: 0; transition: opacity .5s ease; }
.slides img.on { opacity: 1; }
.slide-dots { position: absolute; bottom: 12px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; }
.slide-dots button { width: 24px; height: 24px; padding: 8px; border: 0; background: rgba(255,255,255,.5) content-box; border-radius: 50%; }
.slide-dots button.on { background-color: #fff; }

/* ---------- Live app inside the device frame ---------- */
.vp { position: absolute; top: 0; left: 0; transform-origin: 0 0; display: flex; flex-direction: column; background: #000; }
.vp iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.safe-bottom { flex: none; height: 34px; background: #000; }
.statusbar {
  flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 30px 0 46px; background: #000; color: #fff;
  font: 600 17px -apple-system, "SF Pro Text", var(--font); letter-spacing: -.01em;
}
.vp.sb-overlay .statusbar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; background: transparent; pointer-events: none; }
.sb-icons { display: inline-flex; align-items: center; gap: 6px; }
.sb-icons svg { fill: currentColor; }
.home-indicator { position: absolute; left: 50%; bottom: 8px; z-index: 4; width: 36%; height: 4px; transform: translateX(-50%); border-radius: 4px; background: rgba(255,255,255,.85); pointer-events: none; }
.touch-dot {
  position: absolute; top: 0; left: 0; z-index: 6; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
  background: rgba(150,150,160,.35); border: 1.5px solid rgba(255,255,255,.75); box-shadow: 0 1px 4px rgba(0,0,0,.35);
  pointer-events: none; opacity: 0; transition: opacity .15s ease, width .1s ease, height .1s ease, margin .1s ease;
}
.touch-dot.on { opacity: 1; }
.touch-dot.down { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: rgba(120,120,135,.6); }
.vp-loading { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #0a0d0d center / cover; }
.vp-loading::before { content: ""; position: absolute; inset: 0; background: rgb(8 12 12 / .45); }
.spinner { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.device.browser { grid-column: 1 / -1; }

/* ---------- Narrow screens ---------- */
@media (max-width: 680px) {
  .page { width: calc(100% - 40px); padding-block: 40px 48px; }
  section { margin-top: 52px; }
  .intro { flex-direction: column; gap: 24px; margin-top: 36px; }
  #bio { flex: none; }
  .photo { margin-left: 0; }
  .now { margin: 40px -8px 0; padding: 18px 20px; }
  /* one project per row: small picture on the left, words on the right */
  #projects { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .project { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 18px; }
  .cover { border-radius: 12px; }
  .label { margin-top: 0; }
  .open { order: 0; grid-template-columns: minmax(0, 1fr); margin-inline: -8px; padding: 24px 20px; }
  .open .device { margin-inline: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .open { animation: none; }
  .spinner { animation-duration: 3s; }
}
