/* Adrian Ng portfolio — white, clean, one warm accent. Matches the Subframe design. */

:root {
  --bg: #ffffff;
  --soft: #f7f6f3;
  --ink: #111111;
  --ink-2: #555555;
  --muted: #6b6b6b;
  --line: #e6e4df;
  --accent: #b5472a;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -60px; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 6px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.brand { font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 28px; font-size: 0.92rem; }
.nav a { text-decoration: none; color: var(--muted); transition: color 0.2s; }
.nav a:hover, .nav a.is-active { color: var(--ink); }
@media (max-width: 720px) { .nav { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.92rem; font-weight: 500; text-decoration: none;
  transition: transform 0.3s var(--ease), border-color 0.2s, background-color 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--small { padding: 8px 16px; font-size: 0.85rem; }

/* hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(40px, 6vh, 72px);
  display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__photo { order: -1; max-width: 280px; }
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero__title { font-size: clamp(2.2rem, 5.6vw, 4rem); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; }
.hero__title span { color: var(--muted); font-weight: 500; }
.hero__lede { max-width: 52ch; margin: 24px 0 0; font-size: 1.1rem; color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero__photo { margin: 0; }
.hero__photo img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 28px;
  border: 1px solid var(--line); box-shadow: 0 24px 48px -24px rgba(17, 17, 17, 0.25);
}

/* stats */
.stats { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.stats dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 720px) { .stats dl { grid-template-columns: repeat(2, 1fr); } }
.stats dl > div { padding: 22px 20px 22px 0; }
.stats dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stats dd { margin: 6px 0 0; font-size: 1.9rem; font-weight: 600; letter-spacing: -0.03em; }

/* sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 10vh, 112px) var(--gutter) 0; }
.section__head { display: grid; gap: 12px; margin-bottom: 44px; }
.rule { display: block; width: 40px; height: 2px; background: var(--accent); }
.section__title { font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.08; font-weight: 600; letter-spacing: -0.03em; }
.section__sub { max-width: 62ch; margin: 0; color: var(--muted); font-size: 1.05rem; }

/* project cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; }
.card__link {
  display: flex; flex-direction: column; width: 100%; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit;
  transition: border-color 0.25s, transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
a.card__link:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 18px 36px -22px rgba(17, 17, 17, 0.3); color: inherit; }
.card__media { aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
a.card__link:hover .card__media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 20px 24px 24px; }
.card__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.74rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); min-height: 18px; }
.arrow { color: #8a8a8a; transition: transform 0.3s var(--ease), color 0.2s; flex: none; }
a.card__link:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }
.card h3 { font-size: 1.4rem; line-height: 1.22; font-weight: 500; letter-spacing: -0.02em; }
.card p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.tags li { font-size: 0.74rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: #4a4a4a; }

/* experience */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; gap: 4px; } }
.row__when { font-size: 0.85rem; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.row h3 { font-size: 1.1rem; font-weight: 500; }
.row h3 small { font-size: inherit; font-weight: 400; color: var(--muted); }
.row p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.95rem; max-width: 70ch; }

/* awards */
.awards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
@media (max-width: 900px) { .awards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .awards { grid-template-columns: 1fr; } }
.awards li { background: var(--bg); padding: 22px 24px; display: grid; gap: 2px; font-size: 0.9rem; color: var(--muted); }
.awards span { font-size: 0.74rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.awards strong { font-weight: 500; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }

/* contact */
.contact { max-width: var(--max); margin: clamp(72px, 12vh, 140px) auto 0; padding: clamp(56px, 9vh, 96px) var(--gutter); border-top: 1px solid var(--line); }
.contact__title { font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1; font-weight: 600; letter-spacing: -0.04em; max-width: 14ch; }
.contact__sub { margin: 20px 0 32px; color: var(--muted); font-size: 1.1rem; }
.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.contact__email { font-size: clamp(1.15rem, 2.6vw, 1.8rem); font-weight: 500; letter-spacing: -0.02em; text-decoration: none; border-bottom: 2px solid var(--line); transition: border-color 0.25s; }
.contact__email:hover { border-color: var(--accent); }
.copy { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.82rem; transition: all 0.2s; }
.copy:hover { border-color: var(--ink); }
.copy.is-done { background: var(--accent); border-color: var(--accent); color: #fff; }
.contact__links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 36px; font-size: 0.92rem; }
.contact__links a { color: var(--muted); text-decoration: none; }
.contact__links a:hover { color: var(--accent); }

.site-footer { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer a { text-decoration: none; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* a lone final card spans the full row as a wide feature */
@media (min-width: 961px) {
  .grid > .card:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
  .grid > .card:last-child:nth-child(3n + 1) .card__link { flex-direction: row; }
  .grid > .card:last-child:nth-child(3n + 1) .card__media { width: 42%; aspect-ratio: auto; flex: none; min-height: 260px; }
  .grid > .card:last-child:nth-child(3n + 1) .card__body { justify-content: center; padding: 32px 40px; }
  .grid > .card:last-child:nth-child(3n + 1) h3 { font-size: 1.8rem; }
  .grid > .card:last-child:nth-child(3n + 1) p { font-size: 1rem; max-width: 56ch; }
}
