/* ============================================================
   Lawrence Liu — Portfolio
   Refined dark "developer" theme
   ============================================================ */

:root {
  /* color */
  --bg: #0b0f17;
  --bg-elev: #121a26;
  --bg-elev-2: #172230;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6edf3;
  --text-muted: #9aa7b8;
  --text-dim: #6b7888;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent-2: #22d3ee;
  --on-accent: #042521;

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --container: 1080px;
  --pad-x: clamp(1.25rem, 5vw, 3rem);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 64px;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elev-2);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--accent-hover);
}
strong { color: var(--text); font-weight: 600; }

.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad-x); }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent); color: var(--on-accent);
  padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 200; transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* ---------- icons ---------- */
.icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.15rem; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(45, 212, 191, 0.25); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn .icon { width: 1.05rem; height: 1.05rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(11, 15, 23, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 1rem; }
.nav__logo { color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.nav__logo-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.nav__menu { display: flex; align-items: center; gap: 1.75rem; }
.nav__links { display: flex; gap: 1.4rem; }
.nav__link {
  position: relative; color: var(--text-muted);
  font-size: 0.92rem; font-weight: 500; transition: color 0.2s;
}
.nav__link:hover { color: var(--text); }
.nav__link--active { color: var(--accent); }
.nav__link--active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px;
  background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav--open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav--open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-top: var(--nav-h); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -25%; right: -10%;
  width: 55%; height: 90%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.10), transparent 60%);
  pointer-events: none; z-index: 0;
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; width: 100%; padding-block: 2rem; }
.hero__terminal { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.4rem; }
.hero__prompt { color: var(--accent); }
.hero__name {
  font-size: clamp(2.6rem, 7vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; margin: 0.2rem 0 0.6rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  width: fit-content;
}
.hero__subline { font-size: clamp(0.95rem, 2vw, 1.15rem); color: var(--text-muted); margin-bottom: 1.25rem; }
.hero__typed::after {
  content: ""; display: inline-block; width: 0.55ch; height: 1.05em;
  vertical-align: -0.15em; margin-left: 2px; background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
.hero__tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text); max-width: 46ch; line-height: 1.6; margin-bottom: 1.25rem; }
.hero__location { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.social { display: inline-flex; gap: 0.6rem; }
.social__link {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-muted); transition: color 0.18s, border-color 0.18s, transform 0.18s;
}
.social__link:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social__link .icon { width: 20px; height: 20px; }

.hero__photo { position: relative; justify-self: center; }
.hero__img {
  width: clamp(210px, 26vw, 300px); aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.07), 0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative; z-index: 1;
}
.hero__photo::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 1px solid rgba(45, 212, 191, 0.35); pointer-events: none;
}

/* ---------- sections ---------- */
.section { padding-block: clamp(4rem, 10vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4rem); }
section[id] { scroll-margin-top: 80px; }
.section__head { margin-bottom: 2.5rem; }
.section__kicker { color: var(--accent); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; }
.section__title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }

/* ---------- about ---------- */
.about { max-width: 68ch; display: grid; gap: 1.1rem; color: var(--text-muted); font-size: 1.075rem; }
.about strong { color: var(--text); }

/* ---------- experience timeline ---------- */
.timeline { position: relative; display: grid; gap: 2.5rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.exp { position: relative; padding-left: 2.25rem; }
.exp__dot {
  position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 12px rgba(45, 212, 191, 0.4);
}
.exp__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.exp__role { font-size: 1.25rem; }
.exp__date { color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }
.exp__org { color: var(--accent); font-weight: 500; margin-top: 0.15rem; font-size: 0.98rem; }
.exp__loc { color: var(--text-dim); font-weight: 400; }
.exp__bullets { display: grid; gap: 0.55rem; margin-top: 0.9rem; }
.exp__bullets li { position: relative; padding-left: 1.25rem; color: var(--text-muted); }
.exp__bullets li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- tags & chips ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-muted);
  background: var(--bg-elev-2); border: 1px solid var(--border); padding: 0.25rem 0.6rem; border-radius: 6px;
}

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.project {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.6rem);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.project__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.project__title { font-size: 1.3rem; }
.project__links { display: flex; gap: 0.75rem; }
.project__link { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); transition: color 0.18s; }
.project__link:hover { color: var(--accent); }
.project__tagline { color: var(--text-dim); font-size: 0.85rem; margin: 0.35rem 0 0.9rem; }
.project__bullets { display: grid; gap: 0.5rem; }
.project__bullets li { position: relative; padding-left: 1.25rem; color: var(--text-muted); font-size: 0.97rem; }
.project__bullets li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.project .tags { margin-top: auto; padding-top: 1rem; }

/* ---------- skills ---------- */
.skills { display: grid; gap: 1.75rem; }
.skill-group__label { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-size: 0.92rem; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border);
  padding: 0.45rem 0.85rem; border-radius: var(--radius-sm); transition: border-color 0.18s, color 0.18s, transform 0.18s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ---------- education & leadership ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem); }
.card__text { color: var(--text-muted); margin-top: 0.8rem; font-size: 0.97rem; }
.card .exp__bullets { margin-top: 0.9rem; }

/* ---------- languages ---------- */
.lang-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip--lang { background: var(--accent-dim); border-color: rgba(45, 212, 191, 0.3); color: var(--accent-hover); font-family: var(--font-mono); font-size: 0.88rem; }
.chip--lang:hover { transform: translateY(-2px); color: var(--accent-hover); }

/* ---------- footer / contact ---------- */
.footer { border-top: 1px solid var(--border); background: linear-gradient(180deg, transparent, rgba(45, 212, 191, 0.03)); padding-block: clamp(3.5rem, 8vw, 6rem); }
.footer__inner { text-align: center; display: grid; justify-items: center; gap: 0.6rem; }
.footer .section__kicker { margin-bottom: 0.25rem; }
.footer__title { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; }
.footer__lead { color: var(--text-muted); max-width: 44ch; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.25rem; }
.footer__note { color: var(--text-dim); font-size: 0.8rem; margin-top: 2rem; }

/* ---------- reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- animations ---------- */
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
  .hero__photo { order: -1; }
  .hero__name { margin-inline: auto; }
  .hero__tagline { margin-inline: auto; }
  .hero__terminal, .hero__subline, .hero__location { text-align: center; }
  .hero__cta { justify-content: center; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.5rem;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 1.25rem var(--pad-x);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .nav--open .nav__menu { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links { flex-direction: column; gap: 0.25rem; }
  .nav__link { display: block; padding: 0.6rem 0; font-size: 1rem; }
  .nav__link--active::after { display: none; }
  .nav__cta { align-self: flex-start; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .hero__cta { gap: 0.6rem; }
  .btn { width: 100%; justify-content: center; }
  .social { width: 100%; justify-content: center; }
  .contact__links .btn { width: auto; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__typed::after, .nav__logo-cursor { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
