/* mrpatrickso.com — designed and built by Patrick So */

:root {
  --bg: #f2f2ef;
  --tile: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e3e3de;
  --accent: #4b3cff;
  --lime: #d7f75b;
  --radius: 22px;
  --font: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); padding: 24px; }
a { color: inherit; text-decoration: none; }

.grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* tiles */
.t {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
  min-height: 150px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.t h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

/* top bar */
.bar { min-height: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 26px; }
.bar .name { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.bar nav { display: flex; gap: 22px; font-size: 15px; }
.bar nav a:hover { color: var(--accent); }

/* intro */
.intro { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; }
.intro h1 { font-size: clamp(38px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.intro h1 span { background: var(--lime); padding: 0 .12em; border-radius: 8px; }
.intro p { font-size: 18px; color: var(--muted); max-width: 460px; margin-top: 20px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: 99px; font-weight: 500;
  transition: background .2s, color .2s;
}
.pill:hover { background: var(--accent); }
.pill.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.pill.ghost:hover { border-color: var(--ink); }

.me { grid-row: span 2; padding: 0; min-height: 320px; }
.me img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% center; }
.me span { position: absolute; left: 14px; bottom: 14px; background: rgba(255,255,255,.92); padding: 6px 12px; border-radius: 99px; font-size: 13px; }

.now { background: var(--accent); color: #fff; }
.now h2 { color: rgba(255,255,255,.7); }
.now .role { font-size: 24px; font-weight: 700; line-height: 1.2; }
.now .org { opacity: .8; margin-top: 6px; }

.stat { display: flex; flex-direction: column; justify-content: space-between; }
.stat .big { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.stat .big small { font-size: 28px; }
.stat p { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* résumé request */
.resume { background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.resume h2 { color: rgba(255,255,255,.6); }
.resume h3 { font-size: 22px; line-height: 1.2; font-weight: 500; }
.resume a { background: var(--lime); color: var(--ink); padding: 10px 18px; border-radius: 99px; font-weight: 500; width: fit-content; transition: background .2s; }
.resume a:hover { background: #fff; }

/* experience */
.timeline ol { list-style: none; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .y { color: var(--muted); font-size: 14px; padding-top: 2px; }
.timeline b { display: block; font-weight: 500; }
.timeline small { color: var(--muted); font-size: 14px; }
.note { margin-top: 16px; font-size: 14px; color: var(--muted); }
.note a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* toolkit */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips + h2 { margin-top: 22px; }
.chips span { border: 1px solid var(--line); padding: 7px 14px; border-radius: 99px; font-size: 14px; transition: background .15s, border-color .15s; }
.chips span:hover { background: var(--lime); border-color: var(--lime); }

/* what I do */
.do { min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.do.d1 { background: linear-gradient(140deg, #ff8a5b, #e03d6e); }
.do.d2 { background: linear-gradient(140deg, #3a3a3a, #111); }
.do.d3 { background: linear-gradient(140deg, #5ec2b7, #2563eb); }
.do.d4 { background: linear-gradient(140deg, #a78bfa, #4b3cff); }
.do .icon { position: absolute; top: 22px; left: 26px; font-size: 26px; line-height: 1; }
.do h3 { font-size: 21px; font-weight: 500; line-height: 1.2; }
.do p { opacity: .85; font-size: 14px; margin-top: 6px; }

/* clickable experience tile */
a.timeline { display: block; transition: box-shadow .2s, transform .2s; }
a.timeline:hover { box-shadow: 0 0 0 2px var(--accent); }
.more { display: inline-block; margin-top: 16px; font-weight: 500; color: var(--accent); }
a.timeline:hover .more { text-decoration: underline; }

/* experience page */
.page-head { grid-column: span 3; grid-row: auto; }
.page-head-side { grid-column: span 1; }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.back:hover { color: var(--accent); }
.job { display: grid; grid-template-columns: 300px 1fr; gap: 36px; }
.job-side .role-line { padding: 10px 0; border-top: 1px solid var(--line); }
.job-side .role-line b { display: block; font-weight: 500; font-size: 18px; }
.job-side .role-line small { color: var(--muted); font-size: 14px; }
.job-side .chips { margin-top: 16px; }
.job-body h3 { font-size: 16px; font-weight: 700; margin: 4px 0 8px; }
.job-body ul + h3 { margin-top: 22px; }
.job-body ul { padding-left: 18px; }
.job-body li { padding: 4px 0; }
.job-body li::marker { color: var(--accent); }
.wins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.wins div { background: var(--lime); border-radius: 14px; padding: 14px 16px; }
.wins b { display: block; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.wins small { font-size: 13px; }

/* projects */
.proj-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.proj-card { display: block; border-radius: 16px; overflow: hidden; background: var(--bg); transition: box-shadow .2s; }
.proj-card:hover { box-shadow: 0 0 0 2px var(--accent); }
.proj-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; }
.proj-card div { padding: 14px 16px 16px; }
.proj-card b { display: block; font-weight: 500; font-size: 17px; line-height: 1.25; }
.proj-card small { color: var(--muted); font-size: 14px; }
.proj-head-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.proj-body h3 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.proj-body h3:first-child { margin-top: 0; }
.proj-body p { margin-bottom: 10px; }
.proj-body ul { padding-left: 18px; }
.proj-body li { padding: 3px 0; }
.proj-body li::marker { color: var(--accent); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.gallery figure { margin: 0; }
.gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption { font-size: 14px; color: var(--muted); padding: 8px 4px 0; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lightbox img { display: block; max-width: 96vw; max-height: 86vh; border-radius: 10px; }
.lightbox p { color: #fff; font-size: 15px; padding: 10px 2px 0; }
.lightbox .close { position: fixed; top: 16px; right: 20px; background: #fff; border: 0; border-radius: 99px; padding: 8px 14px; font: 500 15px var(--font); cursor: pointer; }
.disclaimer { font-size: 14px; color: var(--muted); }

/* education */
.edu h2.sub { margin-top: 22px; }
.edu ul { list-style: none; }
.edu li { padding: 10px 0; border-top: 1px solid var(--line); }
.edu li:first-child { border-top: 0; padding-top: 0; }
.edu b { display: block; font-weight: 500; }
.edu small { color: var(--muted); font-size: 14px; }

/* contact */
.contact { background: var(--lime); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.contact h3 { font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.contact p { margin-top: 10px; }
.contact a { font-weight: 500; font-size: 18px; border-bottom: 2px solid var(--ink); width: fit-content; word-break: break-all; }

footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; padding: 10px 6px; flex-wrap: wrap; gap: 8px; }

/* tablet */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .intro, .span-2, .page-head, .page-head-side { grid-column: 1 / -1; }
  .job { grid-template-columns: 1fr; gap: 20px; }
  .proj-row { grid-template-columns: 1fr 1fr; }
}

/* phone */
@media (max-width: 600px) {
  body { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .t { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .bar nav { display: none; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .do { min-height: 180px; }
  .wins { grid-template-columns: 1fr; }
  .proj-row, .gallery { grid-template-columns: 1fr; }
}
