/* projects.tjylab.com: one page, both themes, no web fonts, no third-party requests. */
:root {
  --bg: #f5f6f8; --card: #ffffff; --card-2: #eef0f3; --ink: #0c0e12; --muted: #555e6b; --faint: #7b8491;
  --line: rgba(12, 14, 18, .08); --stage: #e9ecf1; --win: #ffffff; --bezel: #101216;
  --shadow: 0 1px 2px rgba(12, 14, 18, .05), 0 10px 30px rgba(12, 14, 18, .06);
  --shadow-up: 0 2px 6px rgba(12, 14, 18, .06), 0 28px 60px rgba(12, 14, 18, .14);
  --glow-a: rgba(56, 189, 248, .16); --glow-b: rgba(139, 92, 246, .10);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b0d; --card: #121418; --card-2: #1a1d23; --ink: #f1f3f6; --muted: #a3abb6; --faint: #747d89;
    --line: rgba(255, 255, 255, .07); --stage: #0d0f13; --win: #16191e; --bezel: #23272e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 30px rgba(0, 0, 0, .25);
    --shadow-up: 0 2px 6px rgba(0, 0, 0, .5), 0 34px 70px rgba(0, 0, 0, .6);
    --glow-a: rgba(34, 211, 238, .13); --glow-b: rgba(139, 92, 246, .12);
  }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* A soft light at the top of the page, and a faint grid that fades out under it. */
body::before, body::after { content: ""; position: absolute; left: 0; right: 0; top: 0; pointer-events: none; z-index: -1 }
body::before {
  height: 760px;
  background: radial-gradient(42% 60% at 22% 0%, var(--glow-a), transparent 70%),
              radial-gradient(38% 52% at 82% 6%, var(--glow-b), transparent 70%);
}
body::after {
  height: 560px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(70% 90% at 50% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(70% 90% at 50% 0%, #000 10%, transparent 75%);
}

a { color: inherit }

.top { max-width: 1200px; margin: 0 auto; padding: 26px 24px 0; display: flex; align-items: center }
.mark { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; text-decoration: none }
.mark .slash { color: var(--faint); font-weight: 500; margin-left: -6px }
.mark .dot {
  width: 10px; height: 10px; border-radius: 50%; background: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .18), 0 0 14px rgba(34, 211, 238, .7);
}

main { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px }

.intro { padding: 72px 0 52px; max-width: 760px }
h1 { margin: 0; font-size: clamp(40px, 6.4vw, 64px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700 }
.intro p { margin: 20px 0 0; max-width: 640px; color: var(--muted); font-size: clamp(16px, 1.9vw, 18.5px); line-height: 1.6 }

/* ------------------------------------------------------------------ the tiles */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px }

.t-lab    { --accent: 34 211 238 }
.t-fired  { --accent: 16 185 129 }
.t-body   { --accent: 139 92 246 }
.t-atlas  { --accent: 217 160 60 }
.t-town   { --accent: 249 115 22 }
.t-garage { --accent: 59 130 246 }

.tile {
  position: relative; background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  animation: rise .9s var(--ease) backwards;
}
.tile:nth-child(2) { animation-delay: .07s } .tile:nth-child(3) { animation-delay: .14s }
.tile:nth-child(4) { animation-delay: .21s } .tile:nth-child(5) { animation-delay: .28s }
.tile:nth-child(6) { animation-delay: .35s }
@keyframes rise { from { opacity: 0; translate: 0 22px } }

/* Hover: the tile rises, a soft light follows the pointer, and a thin edge lights up near it. */
.tile::before, .tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .45s }
.tile::before { background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--accent) / .09), transparent 45%) }
.tile::after {
  padding: 1px;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgb(var(--accent) / .7), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@media (hover: hover) {
  .tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-up) }
  .tile:hover::before, .tile:hover::after { opacity: 1 }
  .tile:hover .win { transform: translateY(-5px) scale(1.012) }
  .tile:hover .phone { transform: translateY(-14px) }
  .tile:hover .duo .phone.a { transform: translateY(-10px) rotate(-1.6deg) }
  .tile:hover .duo .phone.b { transform: translateY(-16px) rotate(1.6deg) }
}

/* The stage: the screenshots, arranged on a tinted backdrop. A click opens them full size. */
.stage {
  all: unset; box-sizing: border-box; display: block; position: relative; overflow: hidden; cursor: zoom-in;
  width: calc(100% - 20px); margin: 10px 10px 0; border-radius: 17px; aspect-ratio: 16 / 11; isolation: isolate;
  background: radial-gradient(110% 85% at 50% 0%, rgb(var(--accent) / .32), transparent 64%),
              radial-gradient(70% 60% at 100% 100%, rgb(var(--accent) / .14), transparent 60%), var(--stage);
}
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: radial-gradient(rgb(var(--accent) / .35) 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%); mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.stage:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 3px }
.stage span { display: block }

.win {
  position: absolute; left: 7%; top: 11%; width: 80%; border-radius: 11px; overflow: hidden; background: var(--win);
  box-shadow: 0 0 0 1px var(--line), 0 22px 50px rgba(0, 0, 0, .28);
  transition: transform .7s var(--ease); transform-origin: 50% 100%;
}
.win .chrome { height: 20px; display: flex; gap: 6px; align-items: center; padding: 0 10px; background: var(--win); border-bottom: 1px solid var(--line) }
.win .chrome i { width: 7px; height: 7px; border-radius: 50%; background: rgba(128, 128, 128, .38) }
.win img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center }

.phone {
  position: absolute; right: 5%; top: 25%; width: 21%; overflow: hidden;
  border: 4px solid var(--bezel); border-radius: 16% / 7.4%; background: var(--bezel);
  box-shadow: 0 26px 50px rgba(0, 0, 0, .38); transition: transform .7s var(--ease);
}
.phone img { display: block; width: 100%; height: auto }
.duo .phone { width: 29%; top: 9% }
.duo .phone.a { left: 19%; right: auto }
.duo .phone.b { left: 52%; right: auto; top: 16% }

.info { position: relative; padding: 22px 26px 26px }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
h2 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650 }
.pill { font-size: 12px; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted) }
.pill.open { background: rgb(var(--accent) / .16); color: color-mix(in srgb, rgb(var(--accent)) 62%, var(--ink)) }
.blurb { margin: 12px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.6 }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 16px 0 0 }
.tags li { font-size: 12.5px; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--card-2) }
.note { margin: 12px 0 0; font-size: 12.5px; color: var(--faint) }
.acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 15px; border-radius: 11px;
  font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; background: var(--card-2); color: var(--ink);
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px) }
.btn.primary { background: var(--ink); color: var(--bg) }
.btn.primary:hover { box-shadow: 0 8px 22px rgb(var(--accent) / .35) }
.btn:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px }

/* Wide tiles: screenshots on the left, words on the right. */
.tile.wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center }
.tile.wide .stage { margin: 10px; aspect-ratio: 16 / 10.4 }
.tile.wide .info { padding: 28px 40px 28px 22px }
.tile.wide h2 { font-size: 26px }
.tile.wide .blurb { font-size: 16px }
.tile.wide .win { width: 78%; left: 6%; top: 10% }
.tile.wide .phone { width: 19%; top: 22% }

.foot { max-width: 1200px; margin: 0 auto; padding: 18px 24px 56px; color: var(--faint); font-size: 13px }

/* ------------------------------------------------------------------ the viewer */
dialog#lb { border: 0; padding: 0; background: transparent; color: #fff; width: min(1320px, 94vw); max-width: none; max-height: 94vh; overflow: visible }
dialog#lb::backdrop { background: rgba(4, 5, 7, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px) }
dialog#lb[open] { animation: pop .35s var(--ease) }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985) } }
.lb-wrap { display: flex; flex-direction: column; gap: 14px }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.lb-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em }
.lb-close {
  all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px;
}
.lb-close:hover { background: rgba(255, 255, 255, .2) }
.lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px }
.lb-body { display: flex; gap: 20px; align-items: flex-start; justify-content: center; max-height: calc(94vh - 60px); overflow: auto }
.lb-body figure { margin: 0 }
.lb-body img { display: block; width: 100%; height: auto }
.lb-desk { flex: 1 1 auto; max-width: 1000px; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .5) }
.lb-phone { flex: 0 0 auto; width: min(320px, 27vw); border-radius: 30px; overflow: hidden; border: 5px solid #23272e; background: #23272e }
.lb-body.duo .lb-phone { width: min(360px, 40vw) }

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; gap: 22px }
  .tile.wide { display: block }
  .tile.wide .stage { margin: 10px 10px 0 }
  .tile.wide .info { padding: 22px 26px 26px }
  .tile.wide h2 { font-size: 22px }
  .tile.wide .blurb { font-size: 15.5px }
  .intro { padding: 56px 0 40px }
}
@media (max-width: 560px) {
  .top { padding: 20px 18px 0 }
  main { padding: 0 14px 28px }
  .intro { padding: 44px 4px 32px }
  .stage, .tile.wide .stage { aspect-ratio: 4 / 3.3; width: calc(100% - 16px); margin: 8px 8px 0; border-radius: 15px }
  .win, .tile.wide .win { width: 86%; left: 5%; top: 9% }
  .phone, .tile.wide .phone { width: 26%; top: 27%; right: 4%; border-width: 3px }
  .duo .phone { width: 37%; top: 8% }
  .duo .phone.a { left: 10% }
  .duo .phone.b { left: 53%; top: 15% }
  .info, .tile.wide .info { padding: 18px 18px 22px }
  .tile { border-radius: 20px }
  .foot { padding: 14px 18px 44px }
  .lb-body { flex-direction: column; align-items: center }
  .lb-phone, .lb-body.duo .lb-phone { width: 78vw }
  .lb-desk { width: 100% }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .win, .phone, .btn, dialog#lb[open] { animation: none; transition: none }
  .tile:hover, .tile:hover .win, .tile:hover .phone, .tile:hover .duo .phone.a, .tile:hover .duo .phone.b { transform: none }
}
