@font-face { font-family: "Areal"; src: url("../assets/fonts/ABCAreal-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; }
@font-face { font-family: "Areal"; src: url("../assets/fonts/ABCAreal-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; }
@font-face { font-family: "Areal"; src: url("../assets/fonts/ABCAreal-Bold.woff2") format("woff2"); font-weight: 600; font-style: normal; }

:root {
  --hero-bg: #79a8e6;
  --ink: #111;
  --muted: #777;
  --line: #e2e2dc;
  --font: "Areal", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--font); font-size: 12px; color: var(--ink); background: var(--hero-bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- hero ---------- */
.hero { position: fixed; inset: 0; background: var(--hero-bg); overflow: hidden; touch-action: none; }
.stage { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; perspective: 1200px; }
/* 3D memoji: a canvas wider than the figure so a turn never clips; its bottom sits on the page bottom */
.head3d { position: absolute; inset: 0; pointer-events: none; }
.icons {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  display: flex; gap: 28px; align-items: flex-start;
}
.icon { background: none; border: 0; padding: 0; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: #fff; }
.icon img { width: 100px; height: 100px; display: block; filter: drop-shadow(0 6px 10px rgba(10, 30, 80, .25)); transition: transform .18s ease; -webkit-user-drag: none; }
@media (hover: hover) { .icon:hover img { transform: translateY(-4px) scale(1.06); } }   /* lift only for mouse: touch screens keep :hover stuck */
.icon span { font-size: 11px; line-height: 1.2; text-align: center; text-shadow: 0 1px 6px rgba(10, 30, 80, .55); }

/* ---------- windows ---------- */
.win {
  position: fixed; z-index: 10; background: #fff; border: 1px solid rgba(0, 0, 0, .18); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 22px 60px rgba(10, 30, 80, .35), 0 2px 6px rgba(0, 0, 0, .12);
  animation: winpop .2s ease both;
}
@keyframes winpop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
.win-bar { height: 36px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #f3f3ef; border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-bar.dragging { cursor: grabbing; }
.win-close { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: #ff5f57; flex: none; }
.win-close:hover { filter: brightness(.9); }
.win-title { flex: 1; text-align: center; font-weight: 500; font-size: 12px; color: #444; margin-right: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-body { flex: 1; overflow: auto; position: relative; min-height: 0; }
.win-body.flush { overflow: hidden; }
.win iframe { width: 100%; height: 100%; border: 0; display: block; }

.doc { padding: 26px 28px 30px; line-height: 1.55; font-size: 13px; }
.doc p { margin: 0 0 18px; }
.doc .roles { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.doc .roles b { font-weight: 600; }
.doc .links { display: flex; gap: 16px; }
.doc .links a { font-weight: 500; }

.files { padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 22px 14px; }
.file { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.file .thumb { width: 96px; height: 120px; border-radius: 6px; overflow: hidden; background: #eee; box-shadow: 0 6px 16px rgba(0, 0, 0, .16); transition: transform .18s ease; }
@media (hover: hover) { .file:hover .thumb { transform: translateY(-3px); } }
.file .thumb.ico { background: none; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.file .thumb.ico img { width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(10, 30, 80, .22)); }
.file .thumb.ico svg { width: 72px; height: 72px; filter: drop-shadow(0 6px 10px rgba(10, 30, 80, .28)); }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file span { font-size: 11px; line-height: 1.25; max-width: 108px; }

/* ---------- project page inside a window ---------- */
.proj { padding: 32px 32px 56px; display: flex; gap: 48px; align-items: flex-start; }
.proj-left { flex: 0 0 280px; position: sticky; top: 0; align-self: flex-start; }
.proj-title { font-size: 34px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 16px; }   /* title case, as written in the copy */
.proj-tags { color: var(--muted); margin: 0 0 22px; }
.proj-resp { line-height: 1.7; margin: 0 0 22px; }
.proj-p { line-height: 1.6; margin: 0 0 16px; }
.proj-right { flex: 1 1 auto; min-width: 0; }
.proj-entry { margin-top: 64px; }
.proj-entry:first-child { margin-top: 0; }
.proj-asset img, .proj-asset video { display: block; width: 100%; height: auto; }
.proj-entry > .proj-asset video { width: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.proj-asset iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.proj-cap { color: var(--muted); line-height: 1.5; margin-top: 14px; display: none; }   /* captions hidden for now: delete "display: none" to show them again */
.proj-row-wrap { position: relative; }
.proj-grid { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 16px; align-items: start; }
.proj-row { display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.proj-row::-webkit-scrollbar { display: none; }
.proj-row-item { flex: 0 0 auto; width: 240px; }
.proj-row-nav { position: absolute; top: 40%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 12px; line-height: 1; z-index: 2; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.proj-row-nav.prev { left: -14px; } .proj-row-nav.next { right: -14px; }
.proj-row-nav[hidden] { display: none; }

/* ---------- band view (default project view) ---------- */
.band { min-height: 100%; padding: 30px 28px 56px; }
.band-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin-bottom: 34px; }
.band h2 { margin: 0; font-weight: 400; font-size: clamp(26px, 3.6vw, 44px); letter-spacing: -0.02em; line-height: 1.05; }
.band-meta { margin-top: 12px; line-height: 1.6; opacity: .7; }
.band-text { max-width: 440px; line-height: 1.55; }
.band-text p { margin: 0 0 12px; }
.collage { position: relative; width: 100%; }
.asset { position: absolute; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: transform .2s ease, box-shadow .2s ease; }
@media (hover: hover) { .asset:hover { transform: scale(1.025); z-index: 500 !important; box-shadow: 0 16px 44px rgba(0, 0, 0, .32); } }
.asset.dragging { cursor: grabbing; transition: none; transform: scale(1.03) !important; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.box { width: 100%; height: 100%; overflow: hidden; position: relative; }
.box img, .box video { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; -webkit-user-drag: none; }
.box .play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, .9); }
.box .play::before { content: ""; position: absolute; left: 18px; top: 14px; border: solid transparent; border-width: 9px 0 9px 15px; border-left-color: #111; }

/* ---------- enlarged asset ---------- */
.lb { position: fixed; inset: 0; background: rgba(8, 8, 8, .95); z-index: 1000; display: none; overflow-y: auto; overflow-x: hidden; padding: 64px 24px; }
.lb.on { display: block; }
.lb-row { display: flex; align-items: flex-start; justify-content: center; width: fit-content; max-width: 96vw; margin: 0 auto; }
.lb-media { position: relative; z-index: 1; line-height: 0; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); transform-origin: 0 0; animation: lbpop .28s ease backwards; }
.lb-media img { display: block; max-width: min(960px, calc(96vw - 340px)); height: auto; cursor: grab; -webkit-user-drag: none; user-select: none; }
.lb-media.panning img { cursor: grabbing; }
.lb-media video { display: block; max-width: min(960px, calc(96vw - 340px)); max-height: 86vh; }
.lb-media iframe { display: block; width: min(960px, calc(96vw - 340px)); aspect-ratio: 16 / 9; border: 0; }
.lb-cap { position: sticky; top: 72px; z-index: 0; width: 320px; margin-right: -56px; padding: 26px 84px 30px 26px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); animation: lbcap .45s .08s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes lbpop { from { transform: scale(.93); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lbcap { from { transform: translate(90px, 40px); opacity: 0; } to { transform: translate(0, 40px); opacity: 1; } }
.lb-x { position: fixed; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #fff; background: transparent; color: #fff; font-size: 16px; line-height: 1; z-index: 1001; display: none; }
.lb.on ~ .lb-x { display: block; }
.lb-hint { position: fixed; left: 16px; bottom: 14px; color: rgba(255, 255, 255, .6); z-index: 1001; display: none; pointer-events: none; }
.lb.on ~ .lb-hint.show { display: block; }

/* ---------- Apple Notes style (About + Resume) ---------- */
.win-note .win-body { background: #fff; }
.note { font-family: var(--font); font-size: 15px; line-height: 1.42; color: #1d1d1f; padding: 18px 36px 44px; -webkit-font-smoothing: antialiased; }
.note-date { text-align: center; color: #9a9a9e; font-size: 12.5px; margin: 0 0 22px; }
.note h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.2; margin: 0 0 16px; }
.note h2 { font-size: 19px; font-weight: 700; margin: 28px 0 6px; }
.note h3 { font-size: 15px; font-weight: 700; margin: 18px 0 0; }
.note h3 .role { font-weight: 400; }
.note .dates { color: #8a8a8e; margin: 1px 0 6px; }
.note p { margin: 0 0 14px; }
.note a.bio-link { text-decoration: none; }
.note strong { font-weight: 600; }
.note a { color: #e69a00; text-decoration: underline; text-underline-offset: 2px; }
.note .roles { margin: 0 0 14px; }
.note .roles div { margin: 0 0 5px; }
.note ul.dash { list-style: none; margin: 0 0 14px; padding: 0 0 0 4px; }
.note ul.dash li { position: relative; padding-left: 24px; margin: 0 0 5px; }
.note ul.dash li::before { content: "\2013"; position: absolute; left: 2px; }

/* ---------- phones: head fills the screen, icons in a centred grid, windows are floating cards ---------- */
@media (max-width: 720px) {
  /* still of the avatar shown until the 3D model has loaded */
  .head3d { background: var(--hero-bg) url("../assets/head3d/avatar-still.webp") center bottom / auto 100% no-repeat; }
  .head3d.ready { background: none; }
  .icons { flex-wrap: wrap; justify-content: center; width: 100vw; gap: 18px 2px; top: 34%; }
  .icon { width: 96px; }
  .icon img { width: 76px; height: 76px; }

  .win {
    left: 10px !important; right: 10px !important; width: auto !important; height: auto !important;
    top: 15dvh !important; max-height: calc(100dvh - 15dvh - 14px);
    border-radius: 20px; border: 1px solid rgba(255, 255, 255, .6);
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  /* project pages: solid white (not see-through) so screenshots with white backgrounds blend in instead of showing a frame */
  .win.win-page { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .win.win-tall { top: max(12px, env(safe-area-inset-top)) !important; height: calc(100dvh - 26px) !important; max-height: none; }
  .win-bar { height: 50px; background: transparent; border-bottom: 0; padding: 0 18px; gap: 10px; }
  .win-close { width: 16px; height: 16px; position: relative; }
  .win-close::after { content: ""; position: absolute; inset: -14px; }
  .win-title { font-size: 14px; text-align: left; margin-right: 0; }
  .win-body { padding-bottom: env(safe-area-inset-bottom); }
  .win iframe { height: 100%; }
  .files { padding: 14px 16px 24px; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .file .thumb { width: 100%; height: auto; aspect-ratio: 4 / 5; }
  .file span { max-width: 100%; font-size: 12px; }
  .file .thumb.ico { aspect-ratio: auto; height: 96px; }

  .proj { flex-direction: column; align-items: stretch; gap: 28px; padding: 6px 18px 40px; }
  .proj-left { position: static; flex-basis: auto; width: 100%; }
  .proj-right { width: 100%; max-width: 100%; }
  /* social carousels: swipe sideways */
  .proj-row { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; overflow-anchor: none; scroll-behavior: auto; margin-right: -18px; padding-right: 18px; }
  .proj-row-item { width: min(240px, 68vw); }
  .proj-row-nav { display: none; }
  .proj-grid { grid-template-columns: 1fr; gap: 20px; }
  .proj-title { font-size: 28px; }
  .proj-entry { margin-top: 36px; }
  .note { padding: 6px 22px 36px; font-size: 16px; }
  .note-date { margin-bottom: 16px; }
  .band { padding: 22px 14px 40px; }
  .band-head { flex-direction: column; gap: 14px; }
}

/* touch: no iOS "Save to Photos / Copy" menu when pressing a thumbnail or icon */
.file img, .icon img, .asset img, .asset video { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* touch: no grey flash box when tapping icons, folders or windows' buttons */
button, .icon, .file { -webkit-tap-highlight-color: transparent; }

/* project roles: light-grey rounded chips side by side (desktop only), shown as written (title case) */
@media (min-width: 721px) {
  .proj-resp { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1; margin: 0 0 24px; }
  .proj-resp > div { background: #f0f0ed; color: #333; border-radius: 999px; padding: 5px 7px 6px; font-size: 11px; }
}

/* project page (desktop): wider left column so the larger title fits, body copy stays at its narrower measure */
@media (min-width: 721px) {
  .proj { gap: 40px; }
  .proj-left { flex-basis: 340px; top: 32px; max-height: calc(88vh - 104px); overflow-y: auto; scrollbar-width: none; }   /* stays put while the images scroll; scrolls on its own if the text is taller than the window */
  .proj-left::-webkit-scrollbar { display: none; }
  .proj-tags, .proj-resp, .proj-p { max-width: 280px; }
}

/* ---------- resizable windows (desktop) ---------- */
.win-rs { position: absolute; z-index: 20; touch-action: none; }
.win-rs-n, .win-rs-s { left: 12px; right: 12px; height: 6px; cursor: ns-resize; }
.win-rs-n { top: 0; } .win-rs-s { bottom: 0; }
.win-rs-e, .win-rs-w { top: 12px; bottom: 12px; width: 6px; cursor: ew-resize; }
.win-rs-e { right: 0; } .win-rs-w { left: 0; }
.win-rs-ne, .win-rs-nw, .win-rs-se, .win-rs-sw { width: 14px; height: 14px; }
.win-rs-ne { top: 0; right: 0; cursor: nesw-resize; } .win-rs-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.win-rs-nw { top: 0; left: 0; cursor: nwse-resize; } .win-rs-se { bottom: 0; right: 0; cursor: nwse-resize; }
.win.resizing { user-select: none; -webkit-user-select: none; }
.win.resizing .win-body { pointer-events: none; }   /* the Copy Generator iframe must not swallow the drag */
@media (max-width: 720px) { .win-rs { display: none; } }

/* project pages: when the window is made narrow, stack the text above the images (same as phones) */
.win-page .win-body { container-type: inline-size; }
@container (max-width: 700px) {
  .proj { flex-direction: column; align-items: stretch; gap: 28px; padding: 24px 24px 40px; }
  .proj-left { position: static; flex-basis: auto; width: 100%; max-height: none; overflow: visible; }
  .proj-tags, .proj-resp, .proj-p { max-width: none; }
  .proj-right { width: 100%; max-width: 100%; }
  .proj-title { font-size: 28px; }
}
