/* Cliff Li portfolio - Apple-style product page layout. No framework, no build step. */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --white: #ffffff; --paper: #f5f5f7; --ink: #1d1d1f; --black: #000000;
  --blue: #0066cc; --blue-dark: #2997ff;
  --radius-lg: 28px; --radius-md: 18px; --radius-sm: 12px;
  --maxw: 1080px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 52px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.47; font-size: 17px; letter-spacing: -0.022em; overflow-x: hidden; }
img { max-width: 100%; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 300; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 980px; text-decoration: none; font-size: 14px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.theme-dark :focus-visible { outline-color: var(--blue-dark); }

/* themes */
.theme-light { --bg: var(--white); --fg: var(--ink); --muted: #6e6e73; --link: var(--blue); --line: #d2d2d7; --chip: #f5f5f7; background: var(--bg); color: var(--fg); }
.theme-alt   { --bg: var(--paper); --fg: var(--ink); --muted: #6e6e73; --link: var(--blue); --line: #d2d2d7; --chip: #ffffff; background: var(--bg); color: var(--fg); }
.theme-dark  { --bg: var(--black); --fg: #f5f5f7; --muted: #a1a1a6; --link: var(--blue-dark); --line: #424245; --chip: #1d1d1f; background: var(--bg); color: var(--fg); }

/* global nav */
.globalnav { position: sticky; top: 0; z-index: 200; height: 48px; background: rgba(250,250,252,0.8); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0,0,0,0.08); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; height: 100%; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; color: var(--ink); }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 12.5px; color: rgba(29,29,31,0.8); text-decoration: none; letter-spacing: -0.01em; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--ink); }
.nav-links a[aria-current="true"] { font-weight: 600; }
.nav-toggle { display: none; width: 44px; height: 44px; margin-right: -12px; border: 0; background: none; cursor: pointer; position: relative; }
.nav-toggle .bars, .nav-toggle .bars::before { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); border-radius: 1px; transition: transform 0.3s; }
.nav-toggle .bars { top: 18px; }
.nav-toggle .bars::before { content: ''; left: 0; right: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .bars { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(-7px) rotate(-90deg); }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 48px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 22px 22px; background: rgba(250,250,252,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,0.08); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; font-size: 22px; font-weight: 600; padding: 10px 0; color: var(--ink); letter-spacing: -0.02em; }
}

/* buttons and links */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 22px; border-radius: 980px; font-size: 17px; font-weight: 400; letter-spacing: -0.022em; text-decoration: none; transition: background 0.2s, transform 0.2s; }
.pill-primary { background: var(--blue); color: #fff; }
.pill-primary:hover { background: #0077ed; }
.pill-primary:active { transform: scale(0.98); }
.theme-dark .pill-primary { background: var(--blue); }
.pill i { font-size: 0.85em; }
.link-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--link, var(--blue)); text-decoration: none; font-size: 17px; }
.link-more::after { content: '\203A'; font-size: 1.35em; line-height: 1; margin-left: 2px; transform: translateY(-1px); transition: transform 0.2s; }
.link-more:hover { text-decoration: underline; }
.link-more:hover::after { transform: translate(3px, -1px); }
.link-more i { font-size: 0.85em; }

/* hero */
.hero { padding: 120px 22px 110px; text-align: center; }
.hero-inner { max-width: 880px; margin: 0 auto; }
.hero-label { font-size: 21px; font-weight: 600; color: var(--muted); letter-spacing: 0.004em; margin-bottom: 10px; }
.hero-name { font-size: clamp(64px, 12vw, 136px); font-weight: 700; line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 14px; }
.hero-name span { background: linear-gradient(180deg, #1d1d1f 40%, #3a3a3c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-role { font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 22px; }
.hero-role em { font-style: normal; color: var(--blue); }
.hero-desc { font-size: clamp(17px, 2vw, 21px); color: var(--muted); max-width: 640px; margin: 0 auto 34px; line-height: 1.45; letter-spacing: 0.004em; }
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 14px 28px; flex-wrap: wrap; }
.hero-stats { max-width: 760px; margin: 84px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 34px; }
.stat-num { font-size: clamp(48px, 7vw, 80px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 8px; letter-spacing: -0.01em; }

/* section heads */
.section-head { text-align: center; padding: 110px 22px 20px; }
.projects > .section-head { padding-bottom: 90px; }
.section-num { display: block; font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.section-title { font-size: clamp(44px, 7vw, 80px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }

/* project sections */
.project { padding: 110px 22px 120px; }
.project-intro { max-width: 760px; margin: 0 auto; text-align: center; }
.eyebrow { font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.eyebrow i { margin-right: 4px; font-size: 0.9em; }
.project-title { font-size: clamp(40px, 6.2vw, 72px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.06; margin-bottom: 18px; }
.project-desc { font-size: clamp(17px, 1.9vw, 21px); line-height: 1.5; color: var(--muted); letter-spacing: 0.004em; }
.project-desc code { font-family: var(--mono) !important; font-size: 0.88em !important; color: var(--fg) !important; background: var(--chip); padding: 1px 6px; border-radius: 6px; }
.project-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px 0 0; }
.tag { font-size: 13px; padding: 5px 12px; border-radius: 980px; background: var(--chip); color: var(--fg); border: 1px solid var(--line); letter-spacing: -0.01em; }
.theme-light .tag { background: var(--paper); border-color: transparent; }
.project-actions { margin-top: 28px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 28px; }

/* skills bento */
.skills { padding-bottom: 120px; }
.bento { max-width: var(--maxw); margin: 50px auto 0; padding: 0 22px; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "prog prog" "sec sys" "net tools"; gap: 20px; }
.tile-prog { grid-area: prog; } .tile-sec { grid-area: sec; } .tile-sys { grid-area: sys; } .tile-net { grid-area: net; } .tile-tools { grid-area: tools; }
.skill-block { background: #fff; border-radius: var(--radius-lg); padding: 40px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.tile-prog { background: var(--ink); color: #f5f5f7; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: 24px 48px; padding: 48px; }
.tile-prog .skill-block-label { margin-bottom: 12px; }
.skill-block-desc { font-size: 17px; line-height: 1.45; color: #a1a1a6; max-width: 380px; }
.skill-block-label { font-size: clamp(26px, 3vw, 36px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 24px; }
.skill-items { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-chip { font-size: 15px; padding: 9px 16px; border-radius: 980px; background: var(--paper); color: var(--ink); transition: background 0.2s, color 0.2s; }
.skill-chip:hover { background: #e8e8ed; }
.tile-prog .skill-chip { background: #2c2c2e; color: #f5f5f7; }
.tile-prog .skill-chip:hover { background: #3a3a3c; }
@media (max-width: 760px) { .bento { grid-template-columns: 1fr; grid-template-areas: "prog" "sec" "sys" "net" "tools"; gap: 14px; } .skill-block { padding: 28px; } .tile-prog { grid-template-columns: 1fr; gap: 22px; padding: 28px; } }

/* contact */
.contact { padding-bottom: 120px; }
.contact-grid { max-width: 760px; margin: 30px auto 0; padding: 0 22px; text-align: center; }
.contact-headline { font-size: clamp(36px, 5vw, 56px); font-weight: 700; letter-spacing: -0.03em; margin-bottom: 16px; }
.contact-text { font-size: clamp(17px, 1.9vw, 21px); color: var(--muted); line-height: 1.5; margin-bottom: 44px; }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; text-align: left; }
.contact-link { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 18px 22px; border-radius: var(--radius-md); background: #1d1d1f; color: #f5f5f7; text-decoration: none; font-size: 17px; transition: background 0.2s; overflow-wrap: anywhere; }
a.contact-link::after { content: '\203A'; margin-left: auto; font-size: 1.5em; color: var(--blue-dark); line-height: 1; }
a.contact-link:hover { background: #2c2c2e; }
.contact-link i { color: var(--blue-dark); width: 20px; text-align: center; }
.contact-link.is-static { color: var(--muted); }
.contact-link.is-static i { color: var(--muted); }
@media (max-width: 600px) { .contact-links { grid-template-columns: 1fr; } }

/* footer */
.footer { background: var(--paper); color: #6e6e73; font-size: 12px; letter-spacing: -0.01em; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px; text-align: center; border-top: 1px solid #d2d2d7; }

/* scroll reveals */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1); }
.reveal.reveal-media { transform: translateY(48px) scale(0.96); }
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 72px 20px 80px; }
  .hero-label { font-size: 17px; }
  .hero-stats { margin-top: 56px; padding-top: 26px; }
  .section-head { padding: 80px 20px 10px; }
  .projects > .section-head { padding-bottom: 60px; }
  .project { padding: 80px 20px 90px; }
  .pill, .link-more { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.reveal-media { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* nav over dark sections */
.globalnav { transition: background 0.3s, border-color 0.3s; }
.globalnav.on-dark { background: rgba(22,22,23,0.8); border-bottom-color: rgba(255,255,255,0.08); }
.globalnav.on-dark .nav-logo, .globalnav.on-dark .nav-links a[aria-current="true"], .globalnav.on-dark .nav-links a:hover { color: #f5f5f7; }
.globalnav.on-dark .nav-links a { color: rgba(245,245,247,0.8); }
.globalnav.on-dark .nav-toggle .bars, .globalnav.on-dark .nav-toggle .bars::before { background: #f5f5f7; }
.globalnav.on-dark :focus-visible { outline-color: var(--blue-dark); }
@media (max-width: 760px) { .globalnav.on-dark .nav-links { background: rgba(22,22,23,0.97); border-bottom-color: rgba(255,255,255,0.08); } .globalnav.on-dark .nav-links a { color: #f5f5f7; } }

/* programming hero tile */
.tile-prog .skill-block-label { font-size: clamp(36px, 4.6vw, 56px); }
.tile-prog .skill-chip { font-size: 21px; padding: 12px 22px; }
@media (max-width: 760px) { .tile-prog .skill-chip { font-size: 17px; padding: 9px 16px; } }

/* secondary pill + nav resume button */
.pill-secondary { background: transparent; color: var(--link, var(--blue)); box-shadow: inset 0 0 0 1px currentColor; }
.pill-secondary:hover { background: rgba(0,102,204,0.06); }
.pill-secondary:active { transform: scale(0.98); }
.nav-links { align-items: center; }
.nav-links a.nav-cta { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 12px; border-radius: 980px; background: var(--blue); color: #fff; font-weight: 500; }
.nav-links a.nav-cta:hover { background: #0077ed; color: #fff; }
.globalnav.on-dark .nav-links a.nav-cta { color: #fff; }
@media (max-width: 760px) {
  .nav-links { align-items: stretch; }
  .nav-links .nav-cta-item { margin-top: 10px; }
  .nav-links a.nav-cta, .globalnav.on-dark .nav-links a.nav-cta { display: flex; justify-content: center; min-height: 44px; font-size: 17px; padding: 10px 18px; color: #fff; }
}

/* education + experience cards */
.edu, .exp { padding-bottom: 120px; }
.cards { max-width: var(--maxw); margin: 50px auto 0; padding: 0 22px; display: grid; gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { border-radius: var(--radius-lg); padding: 40px; background: var(--chip); }
.theme-light .card { background: var(--paper); }
.theme-dark .card { background: #1d1d1f; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.card-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.12; margin-bottom: 6px; }
.card-sub { font-size: 17px; color: var(--link); margin-bottom: 26px; }
.card-desc { font-size: 17px; line-height: 1.5; margin: -8px 0 18px; }
.card-label { margin: 22px 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card-sub + .card-label { margin-top: 0; }
.course-list li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.course-list li:last-child { border-bottom: 1px solid var(--line); }
.course-list b { font-weight: 600; }
.course-list .code { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 980px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: 1px; white-space: nowrap; }
.course-list .note { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }
.card-bullets li { position: relative; padding-left: 18px; font-size: 17px; line-height: 1.5; color: var(--muted); }
.card-bullets li + li { margin-top: 10px; }
.card-bullets li::before { content: ''; position: absolute; left: 2px; top: 0.66em; width: 6px; height: 6px; border-radius: 50%; background: var(--link); }
.lang-row { width: calc(100% - 44px); max-width: calc(var(--maxw) - 44px); margin: 20px auto 0; padding: 28px 40px; border-radius: var(--radius-lg); background: var(--paper); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.lang-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.028em; }
.lang-list { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-list li { font-size: 17px; padding: 10px 18px; border-radius: 980px; background: #fff; }
.lang-list li span { color: var(--muted); font-size: 14px; margin-left: 4px; }
.lang-list li span::before { content: '('; } .lang-list li span::after { content: ')'; }
.contact-links li:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .cards-2 { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 28px; }
  .lang-row { padding: 26px 28px; }
  .edu, .exp { padding-bottom: 90px; }
}

/* ---- Round 2 additions ---- */
.hero-seeking { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 8px 18px; border-radius: 980px; background: #fff; box-shadow: inset 0 0 0 1px var(--line, #d2d2d7); font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.seek-dot { width: 9px; height: 9px; border-radius: 50%; background: #1f9d55; box-shadow: 0 0 0 4px rgba(31,157,85,0.18); flex: none; }
.hero-stats .stat { padding: 0 12px; }
.hero-stats .stat-num { font-size: clamp(36px, 5.4vw, 62px); white-space: nowrap; }
.hero-stats .stat-label { max-width: 220px; margin-left: auto; margin-right: auto; line-height: 1.35; }
@media (max-width: 600px) {
  .hero-stats { grid-template-columns: 1fr; gap: 22px; }
  .hero-stats .stat-num { font-size: 44px; }
  .hero-seeking { font-size: 15px; padding: 8px 14px; }
}
.course-list .note .code { margin: 0 2px 0 0; }
.card-facts { margin: -8px 0 22px; display: grid; gap: 6px; }
.card-facts li { font-size: 15px; line-height: 1.45; color: var(--muted); }
.card-facts b { color: var(--fg); font-weight: 600; }
.card-bullets code { font-family: var(--mono); font-size: 0.86em; color: var(--fg); background: var(--paper); padding: 1px 6px; border-radius: 6px; }
.card-tags { justify-content: flex-start; margin: 22px 0 14px; }
.card-tags + .link-more { margin-top: 2px; }
.skill-chip .ev { margin-left: 6px; font-size: 12px; font-weight: 500; opacity: 0.6; letter-spacing: 0; }
.tile-prog .skill-chip .ev { font-size: 13px; }
.tile-lang { grid-area: lang; }
.tile-lang .skill-block-desc { max-width: 640px; margin: -8px 0 20px; }
.bento { grid-template-areas: "prog prog" "sec sys" "net tools" "lang lang"; }
@media (max-width: 760px) { .bento { grid-template-areas: "prog" "sec" "sys" "net" "tools" "lang"; } }

/* other projects */
.other { padding: 20px 22px 120px; }
.other-head { text-align: center; padding: 70px 0 40px; }
.other-title { font-size: clamp(32px, 4.4vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.other-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.other-card { background: #fff; border-radius: var(--radius-lg); padding: 24px 24px 28px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); min-width: 0; }
.other-card .shot button, .other-card .yt-poster { border-radius: 16px; }
.other-card .other-shot { margin: 0 0 20px; }
.other-card-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 8px; }
.other-desc { font-size: 16px; line-height: 1.5; color: var(--muted); }
.other-card .project-tags { justify-content: flex-start; margin-top: 16px; }
.other-actions { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.other-actions .pill { min-height: 40px; padding: 8px 18px; font-size: 15px; }
.other-actions .link-more { font-size: 15px; }
.other-card .more { margin-top: 14px; }
.other-card .more > summary { margin: 0; }
.other-card .shots { margin-top: 0; gap: 10px; }
.other-card .shots .shot button { aspect-ratio: 16 / 10; }
.yt-wrap { margin: 0 0 20px; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.yt-poster { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; }
.yt-poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(0,0,0,0.62); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; padding-left: 4px; transition: transform 0.2s, background 0.2s; backdrop-filter: blur(4px); }
.yt-poster:hover .yt-play { transform: scale(1.08); background: rgba(0,102,204,0.9); }
.yt-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) { .other-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .other { padding: 10px 16px 90px; } .other-head { padding: 56px 0 28px; } .other-card { padding: 16px 16px 24px; } }
.yt-wide { max-width: 760px; margin: 0 auto 6px; }
.more-video > .yt-wrap { box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.12); }
