/* ============================================================
   Marcus Lam — personal site (static, no WordPress).
   Keeps the original teal (#1ccdca) identity, warmed up and modernised.
   Display: Sora · Body: Inter
   ============================================================ */

:root {
  --teal:      #1ccdca;
  --teal-deep: #12a8a5;
  --teal-dark: #0b6664;
  --teal-wash: #ecfbfa;
  --teal-wash2:#dbf5f4;
  --coral:     #ff6f61;

  --ink:   #1a2226;
  --slate: #4f5961;
  --mute:  #8a939b;

  --bg:    #ffffff;
  --warm:  #fbf8f3;     /* warm off-white, echoes the portrait */
  --card:  #ffffff;
  --line:  #ebe6dd;
  --line-cool: #e1edec;

  --display: "Sora", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;

  --maxw: 1140px;
  --gutter: clamp(1.1rem, 0.5rem + 2.6vw, 2.5rem);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.4, 0.16, 0.18, 1);
  --shadow: 0 10px 30px -16px rgba(20,40,45,0.25);
  --shadow-lg: 0 24px 60px -24px rgba(15,60,60,0.32);

  --s1: clamp(1.05rem,1rem+0.3vw,1.2rem);
  --s2: clamp(1.3rem,1.15rem+0.7vw,1.65rem);
  --s3: clamp(1.7rem,1.4rem+1.4vw,2.4rem);
  --s4: clamp(2.2rem,1.7rem+2.4vw,3.4rem);
  --s5: clamp(2.8rem,2rem+3.6vw,4.6rem);
}

*,*::before,*::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }
body {
  font-family: var(--body); color: var(--slate); background: var(--bg);
  font-size: 1rem; line-height: 1.7; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--teal); color: #fff; }
h1,h2,h3,h4 { font-family: var(--display); color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 2.4rem + 5vw, 6.5rem); position: relative; }
.section--warm { background: var(--warm); }
.section--teal { background: linear-gradient(180deg, var(--teal-wash), #fff); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--display); font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal-dark);
}
.eyebrow::before { content:""; width: 26px; height: 2px; background: var(--teal); border-radius: 2px; }

.sec-head { max-width: 56ch; margin-bottom: clamp(2rem,1.4rem+2vw,3rem); }
.sec-head h2 { font-size: var(--s3); margin-top: 0.9rem; }
.sec-head p { color: var(--slate); font-size: var(--s1); margin-top: 0.9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--display); font-weight: 600; font-size: 0.95rem;
  padding: 0.78em 1.35em; border-radius: 100px; border: 1.5px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn--primary { background: var(--teal); color: #06302f; box-shadow: 0 12px 26px -12px rgba(28,205,202,0.8); }
.btn--primary:hover { background: var(--teal-deep); transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(28,205,202,0.9); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-dark); transform: translateY(-2px); }
.btn--ondark { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.35); color: #fff; backdrop-filter: blur(6px); }
.btn--ondark:hover { background: rgba(255,255,255,0.24); transform: translateY(-2px); }

.linkline { font-family: var(--display); font-weight: 600; font-size: 0.9rem; color: var(--teal-dark); display: inline-flex; align-items: center; gap: 0.4em; }
.linkline .arr { transition: transform .25s var(--ease); }
.linkline:hover .arr { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, #fff 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.nav.stuck { border-bottom-color: var(--line); background: color-mix(in srgb, #fff 92%, transparent); }
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 0.6em; }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: 0.3rem; }
.nav__links a { font-family: var(--display); font-weight: 500; font-size: 0.92rem; color: var(--slate); padding: 0.5em 0.85em; border-radius: 100px; transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--teal-dark); background: var(--teal-wash); }
.nav__cta { margin-left: 0.4rem; }
.burger { display: none; flex-direction: column; gap: 5px; padding: 0.5em; }
.burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2){ opacity: 0; }
.burger.open span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 800px){
  .nav__links { display: none; }
  .nav__links.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 66px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 0.6rem var(--gutter) 1.1rem; }
  .nav__links.open a { padding: 0.8em 0.4em; }
  .nav__links.open .nav__cta { margin: 0.4rem 0 0; justify-content: center; }
  .burger { display: flex; }
}

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero__img { position: absolute; inset: 0; z-index: -2; }
.hero__img img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 38%; }
.hero__veil { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(95deg, rgba(251,248,243,0.97) 0%, rgba(251,248,243,0.9) 34%, rgba(251,248,243,0.5) 56%, rgba(251,248,243,0.12) 78%, rgba(251,248,243,0) 100%); }
.hero__in { padding-block: clamp(3.5rem,2.5rem+7vw,7rem); min-height: min(82vh, 720px); display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: var(--s5); font-weight: 700; margin: 1rem 0 0; letter-spacing: -0.035em; }
.hero__role { font-family: var(--display); font-weight: 600; font-size: var(--s2); color: var(--teal-dark); margin-top: 0.5rem; }
.hero__role .sep { color: var(--teal); }
.hero p.lead { max-width: 42ch; margin-top: 1.3rem; font-size: var(--s1); color: var(--slate); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 2rem; }
.hero__chips a { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.92rem; color: var(--slate); font-weight: 500; }
.hero__chips svg { width: 17px; height: 17px; color: var(--teal-dark); }
.hero__chips a:hover { color: var(--teal-dark); }
@media (max-width: 640px){
  .hero__img img { object-position: 64% 30%; }
  .hero__veil { background: linear-gradient(180deg, rgba(251,248,243,0.92) 0%, rgba(251,248,243,0.86) 40%, rgba(251,248,243,0.95) 100%); }
}

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(2rem,1rem+4vw,4rem); align-items: center; }
.about__body p { font-size: var(--s1); color: var(--slate); }
.about__body p + p { margin-top: 1rem; }
.about__body .pull { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: var(--s2); letter-spacing: -0.02em; }
.about__stats { display: grid; gap: 0.8rem; }
.about__stats div { border-left: 3px solid var(--teal); padding: 0.3rem 0 0.3rem 1rem; }
.about__stats b { display: block; font-family: var(--display); font-size: 1.6rem; color: var(--ink); font-weight: 700; }
.about__stats span { font-size: 0.9rem; color: var(--mute); }
@media (max-width: 760px){ .about__grid { grid-template-columns: 1fr; } }

/* ---------- domains / what I do ---------- */
.domains { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(0.8rem,0.4rem+1.2vw,1.3rem); }
@media (max-width:860px){ .domains{ grid-template-columns: repeat(2,1fr);} }
@media (max-width:460px){ .domains{ grid-template-columns: 1fr;} }
.domain { background: var(--card); border: 1px solid var(--line-cool); border-radius: var(--radius); padding: clamp(1.3rem,1rem+1vw,1.7rem); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.domain:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--teal); }
.domain .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--teal-wash); color: var(--teal-dark); display: grid; place-items: center; margin-bottom: 1rem; }
.domain .ic svg { width: 23px; height: 23px; }
.domain h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.domain p { font-size: 0.92rem; color: var(--slate); }

/* ---------- work ---------- */
.work { display: grid; gap: clamp(1.2rem,0.8rem+1.6vw,2rem); }
.proj { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem,0.8rem+3vw,3.5rem); align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.proj--flip .proj__media { order: 2; }
.proj__media { background: var(--warm); align-self: stretch; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.proj__media img { width: 100%; height: 100%; object-fit: cover; }
.proj__media.contain { padding: clamp(1rem,0.5rem+2vw,2.2rem); }
.proj__media.contain img { object-fit: contain; max-height: 320px; }
.proj__body { padding: clamp(1.5rem,1rem+2vw,2.6rem); }
.proj__tag { font-family: var(--display); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal-dark); display: inline-flex; align-items: center; gap: 0.5em; }
.proj__tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.proj__body h3 { font-size: var(--s2); margin: 0.7rem 0 0.7rem; }
.proj__body p { color: var(--slate); }
.proj__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0; }
.proj__meta span { font-family: var(--display); font-weight: 500; font-size: 0.76rem; color: var(--slate); background: var(--teal-wash); padding: 0.3em 0.7em; border-radius: 100px; }
.proj__cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
@media (max-width:760px){ .proj { grid-template-columns: 1fr; } .proj--flip .proj__media { order: 0; } .proj__media { min-height: 200px; } }

/* ---------- writing ---------- */
.posts { display: grid; gap: 0.4rem; }
.post { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: baseline; padding: 1.15rem 0.4rem; border-bottom: 1px solid var(--line); transition: padding-left .25s var(--ease); }
.post:hover { padding-left: 1rem; }
.post .date { font-family: var(--display); font-size: 0.8rem; color: var(--mute); white-space: nowrap; }
.post h3 { font-size: var(--s1); font-weight: 600; color: var(--ink); transition: color .2s; }
.post:hover h3 { color: var(--teal-dark); }
.post .go { color: var(--teal); transition: transform .25s var(--ease); }
.post:hover .go { transform: translateX(4px); }
@media (max-width:620px){ .post { grid-template-columns: 1fr auto; } .post .date { grid-column: 1 / -1; order: -1; } }

/* ---------- video facade ---------- */
.video { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16/9; background: #000; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: 0.82; transition: opacity .3s, transform .5s var(--ease); }
.video:hover img { opacity: 0.95; transform: scale(1.03); }
.video__play { position: absolute; inset: 0; display: grid; place-items: center; }
.video__play span { width: 78px; height: 78px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.4); transition: transform .25s var(--ease); }
.video:hover .video__play span { transform: scale(1.08); }
.video__play svg { width: 30px; height: 30px; color: #06302f; margin-left: 4px; }
.video__cap { position: absolute; left: 1.2rem; bottom: 1rem; color: #fff; font-family: var(--display); font-weight: 600; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }

/* ---------- contact ---------- */
.contact { background: linear-gradient(135deg, var(--teal-dark), #0e7e7b 60%, var(--teal-deep)); color: #fff; border-radius: clamp(20px,3vw,32px); padding: clamp(2rem,1.4rem+4vw,4.5rem); position: relative; overflow: hidden; }
.contact::before { content:""; position:absolute; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,0.08); top: -120px; right: -80px; }
.contact h2 { color: #fff; font-size: var(--s4); position: relative; }
.contact p { color: rgba(255,255,255,0.9); font-size: var(--s1); max-width: 46ch; margin-top: 1rem; position: relative; }
.contact__row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; position: relative; }
.contact__links { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 2.2rem; position: relative; font-family: var(--display); font-weight: 500; }
.contact__links a { color: #eafdfc; display: inline-flex; align-items: center; gap: 0.5em; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 2px; }
.contact__links a:hover { border-color: #fff; }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: #aeb7bd; }
.foot__in { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding-block: clamp(2.6rem,2rem+2vw,3.6rem); }
.foot .brand b { color: #fff; }
.foot img { filter: invert(1) brightness(1.6); }
.foot p { font-size: 0.9rem; margin-top: 0.9rem; max-width: 32ch; }
.foot h4 { color: #fff; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 1rem; font-family: var(--display); }
.foot ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.foot a { font-size: 0.92rem; transition: color .2s; }
.foot a:hover { color: var(--teal); }
.foot__legal { border-top: 1px solid #2a3238; padding-block: 1.3rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; color: #79828a; }
@media (max-width:680px){ .foot__in { grid-template-columns: 1fr 1fr; } .foot .brand { grid-column: 1/-1; } }

/* ---------- reveal ---------- */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"]{ transition-delay: .08s; } .reveal[data-d="2"]{ transition-delay: .16s; } .reveal[data-d="3"]{ transition-delay: .24s; }
@media (prefers-reduced-motion: reduce){ .reveal,.js .reveal{ opacity:1; transform:none; transition:none;} * { animation: none !important; } }

.preview-ribbon { position: fixed; bottom: 14px; left: 14px; z-index: 90; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.04em; padding: 0.5em 0.9em; border-radius: 100px; box-shadow: var(--shadow); opacity: 0.92; }
.preview-ribbon b { color: var(--teal); }
