/* ============================================================
   LOW JING HONG — Portfolio
   CRT MONITOR · cream phosphor · ASCII sculpture · mono
   Reference language: kvs.services
   ============================================================ */

:root {
  --bone: #e7e4da;          /* phosphor cream screen */
  --bone-2: #ddd9cd;
  --ink: #16140d;           /* dark warm ink */
  --mute: #6f6a59;
  --line: rgba(22, 20, 13, 0.16);
  --line-soft: rgba(22, 20, 13, 0.09);
  --accent: #ff5500;        /* CRT orange-red (matched to reference) */
  --bezel: #07070a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --pad: clamp(1.1rem, 4.5vw, 5.5rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; background: var(--bezel); }

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bone-2); }
::-webkit-scrollbar-thumb { background: var(--mute); }

/* ============================================================
   LOADER
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 999; background: var(--bone);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  font-family: var(--mono);
}
.loader__txt { font-size: 0.7rem; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--mute); }
.loader__pct { font-size: clamp(3rem, 14vw, 8rem); font-weight: 300; line-height: 0.9; letter-spacing: -0.04em; }
.loader__hint { font-size: 0.62rem; letter-spacing: 0.35em; color: var(--accent); }

/* ============================================================
   CRT OVERLAY  (rounded screen + vignette + scanlines + flicker)
   ============================================================ */
.crt { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
.crt__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: multiply; opacity: 0.55;
}
.crt__vignette {
  position: absolute; inset: 0;
  /* refined modern frame: thin edge + gentle corner falloff (no heavy TV bezel) */
  box-shadow:
    inset 0 0 0 1px rgba(22,20,13,0.10),
    inset 0 0 220px 80px rgba(0,0,0,0.10);
  border-radius: clamp(10px, 2vw, 26px);
}
.crt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  /* slim surround that reads as a screen edge, not a chunky bezel */
  box-shadow: 0 0 0 100vmax var(--bezel);
  border-radius: clamp(10px, 2vw, 26px);
  margin: clamp(6px, 1vw, 14px);
}
.crt__glow {
  position: absolute; inset: 0; border-radius: clamp(10px, 2vw, 26px);
  background: radial-gradient(120% 90% at 50% 38%, rgba(255,255,255,0.06), transparent 62%);
  animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,100%{opacity:.6} 49%{opacity:.62} 50%{opacity:.5} 52%{opacity:.62} 96%{opacity:.6} }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.9rem,2vw,1.6rem) clamp(1.4rem,4vw,3rem);
}
.nav__logo { font-weight: 700; letter-spacing: 0.1em; font-size: 0.95rem; }
.nav__logo i { color: var(--accent); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav__links { display: flex; gap: clamp(1rem,2.2vw,2.4rem); }
.nav__links a {
  font-size: 0.66rem; letter-spacing: 0.16em; position: relative; padding: 0.3rem 0; color: var(--ink);
  opacity: 0.7; transition: opacity 0.3s var(--ease);
}
.nav__links a::after { content:""; position:absolute; left:0; bottom:0; height:1px; width:0; background: var(--accent); transition: width 0.4s var(--ease); }
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }
.nav__menu { display: none; background: none; border: 1px solid var(--line); border-radius: 100px; padding: 0.4rem 0.9rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; cursor: pointer; }
.menu {
  position: fixed; inset: 0; z-index: 88; background: var(--bone);
  display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; padding: var(--pad);
  transform: translateY(-100%); transition: transform 0.6s var(--ease);
}
.menu.open { transform: translateY(0); }
.menu a { font-family: var(--sans); font-size: clamp(2rem,9vw,3.4rem); font-weight: 300; letter-spacing: -0.02em; }
.menu a:hover { color: var(--accent); }

/* ============================================================
   HERO — CRT enter screen
   ============================================================ */
main { position: relative; z-index: 2; }
.hero {
  position: relative; min-height: 100vh; display: grid; place-items: center;
  padding: 0 var(--pad); overflow: hidden;
}
.hero__corner {
  position: absolute; z-index: 3; display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.58rem; letter-spacing: 0.18em; color: var(--mute);
}
.hero__corner--tl { top: clamp(4.5rem,9vh,6rem); left: clamp(1.4rem,4vw,3rem); }
.hero__corner--tr { top: clamp(4.5rem,9vh,6rem); right: clamp(1.4rem,4vw,3rem); text-align: right; }
.avail { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.avail i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255,85,0,0.5); animation: ping 2s var(--ease) infinite; }
@keyframes ping { 0%{box-shadow:0 0 0 0 rgba(255,85,0,0.5)} 70%,100%{box-shadow:0 0 0 7px rgba(255,85,0,0)} }

/* ASCII sculpture */
.ascii {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -62%);
  z-index: 1; font-family: var(--mono); font-weight: 700;
  color: var(--ink); line-height: 1; letter-spacing: 0; white-space: pre;
  user-select: none; text-shadow: 0 0 1px rgba(22,20,13,0.25);
}

.hero__center { position: absolute; z-index: 3; left: 0; right: 0; bottom: clamp(2.2rem, 7vh, 4.5rem); text-align: center; pointer-events: none; }
.hero__name { font-family: var(--mono); font-size: clamp(0.8rem, 1.8vw, 1.05rem); font-weight: 700; letter-spacing: 0.4em; text-indent: 0.4em; }
.hero__role { font-size: 0.6rem; letter-spacing: 0.42em; color: var(--mute); margin-top: 0.55rem; }
.hero__enter { margin-top: clamp(1.1rem,3vh,2rem); display: flex; flex-direction: column; align-items: center; gap: clamp(1rem,2.4vh,1.6rem); pointer-events: auto; }
.hero__tag { font-family: var(--sans); font-size: clamp(0.8rem,1.5vw,1rem); font-weight: 300; letter-spacing: 0.01em; color: var(--mute); max-width: 34ch; }
.scrollcue { display: inline-flex; flex-direction: column; align-items: center; gap: 0.55rem; font-size: 0.54rem; letter-spacing: 0.34em; color: var(--mute); transition: color 0.3s var(--ease); }
.scrollcue i { width: 1px; height: 34px; background: linear-gradient(var(--accent), transparent); position: relative; overflow: hidden; }
.scrollcue i::after { content: ""; position: absolute; left: 0; top: -34px; width: 1px; height: 34px; background: var(--accent); animation: cue 1.8s var(--ease) infinite; }
.scrollcue:hover { color: var(--ink); }
@keyframes cue { 0%{transform:translateY(0)} 100%{transform:translateY(68px)} }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee { position: relative; z-index: 2; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: clamp(0.9rem,2.2vw,1.5rem) 0; background: var(--bone); }
.marquee__track { display: inline-flex; align-items: center; gap: 2.2rem; white-space: nowrap; animation: marquee 26s linear infinite; }
.marquee__track span { font-family: var(--sans); font-size: clamp(1.4rem,4vw,2.6rem); font-weight: 400; letter-spacing: -0.01em; }
.marquee__track i { color: var(--accent); font-style: normal; font-size: 0.9rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   BRACE VOICE  (reference signature: {phrase})
   ============================================================ */
.brace { color: var(--mute); }
.brace::before { content: "{ "; color: var(--accent); }
.brace::after { content: " }"; color: var(--accent); }

.statement {
  position: relative; z-index: 2; background: var(--bone);
  padding: clamp(3rem,9vh,7rem) var(--pad); border-bottom: 1px solid var(--line);
}
.statement p {
  font-size: clamp(0.95rem,2.4vw,1.55rem); line-height: 1.7; letter-spacing: 0.02em;
  max-width: 30ch; color: var(--ink);
}
.statement .brace::before, .statement .brace::after { display: inline; }
.statement b { font-weight: 400; color: var(--accent); }

/* ============================================================
   CRT MONITOR  (embedded showreel video)
   ============================================================ */
.monitor { position: relative; margin-top: clamp(2.5rem,6vw,5rem); }
.monitor__screen {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: clamp(10px,1.6vw,22px); background: #0b0b0a;
  box-shadow: inset 0 0 0 1px rgba(22,20,13,0.25);
}
.monitor__screen video { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(0.15) contrast(1.05); }
.monitor__scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0.18) 0, rgba(0,0,0,0.18) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: multiply; opacity: 0.5;
}
.monitor__vig {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 120px 18px rgba(0,0,0,0.55);
}
.monitor__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.7rem 0.1rem 0; font-size: 0.6rem; letter-spacing: 0.2em; color: var(--mute);
}
.monitor__bar .rec { color: var(--accent); display: inline-flex; align-items: center; gap: 0.4rem; }
.monitor__bar .rec::before { content: "●"; animation: blink 1.2s steps(2) infinite; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: clamp(5rem,14vh,12rem) var(--pad); position: relative; background: var(--bone); }
.section__head { margin-bottom: clamp(2.2rem,5vw,4.5rem); }
.idx { display: inline-block; font-size: 0.66rem; letter-spacing: 0.28em; color: var(--accent); margin-bottom: 1.3rem; }
.section__title { font-family: var(--sans); font-size: clamp(2.1rem,7vw,5.2rem); font-weight: 300; line-height: 0.98; letter-spacing: -0.035em; }
.accent { color: var(--accent); }

/* ABOUT */
.about__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem,6vw,6rem); align-items: start; }
.about__lead { font-family: var(--sans); font-size: clamp(1.35rem,3vw,2.3rem); font-weight: 300; line-height: 1.3; letter-spacing: -0.02em; }
.about__lead em { color: var(--accent); font-style: italic; }
.about__meta { margin-top: clamp(2rem,4vw,3rem); display: grid; gap: 0; border-top: 1px solid var(--line); }
.about__meta > div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line-soft); }
.about__meta dt { font-size: 0.6rem; letter-spacing: 0.18em; color: var(--mute); padding-top: 0.15rem; }
.about__meta dd { font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink); }
.about__stats { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.4rem,3vw,2.4rem); }
.stat { border-top: 1px solid var(--line); padding-top: 0.9rem; }
.stat__num { display: block; font-family: var(--sans); font-size: clamp(2rem,4vw,3.1rem); font-weight: 300; letter-spacing: -0.03em; }
.stat__label { font-size: 0.62rem; letter-spacing: 0.14em; color: var(--mute); }

/* WORK */
.work__list { border-top: 1px solid var(--line); }
.proj { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(1.4rem,4vw,4rem); padding: clamp(1.8rem,4vw,3rem) 0; border-bottom: 1px solid var(--line); position: relative; transition: padding-left 0.5s var(--ease); }
.proj::before { content:""; position:absolute; left:-100%; top:0; bottom:0; width:100%; background: linear-gradient(90deg, transparent, rgba(255,59,0,0.07)); transition: left 0.6s var(--ease); }
.proj:hover { padding-left: clamp(0.5rem,2vw,2rem); }
.proj:hover::before { left: 0; }
.proj__no { font-size: 0.72rem; color: var(--mute); letter-spacing: 0.1em; align-self: start; padding-top: 0.5rem; }
.proj__name { font-family: var(--sans); font-size: clamp(1.7rem,5vw,3.4rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1; margin-bottom: 0.85rem; transition: color 0.3s var(--ease); }
.proj:hover .proj__name { color: var(--accent); }
.proj__desc { color: var(--mute); max-width: 60ch; font-size: clamp(0.78rem,1.3vw,0.9rem); line-height: 1.6; margin-bottom: 1rem; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.proj__tags span { font-size: 0.58rem; letter-spacing: 0.08em; color: var(--mute); border: 1px solid var(--line); padding: 0.28rem 0.65rem; border-radius: 100px; }
.proj__go { font-size: 1.5rem; color: var(--mute); transition: transform 0.4s var(--ease), color 0.3s var(--ease); }
.proj:hover .proj__go { color: var(--accent); transform: translate(5px,-5px); }

/* STACK */
.stack__grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap { background: var(--bone); padding: clamp(1.5rem,3vw,2.4rem) clamp(1.2rem,2.5vw,1.9rem); transition: background 0.4s var(--ease); }
.cap:hover { background: var(--bone-2); }
.cap h4 { font-family: var(--sans); font-size: clamp(1rem,2vw,1.3rem); font-weight: 500; margin-bottom: 0.7rem; letter-spacing: 0.02em; }
.cap:hover h4 { color: var(--accent); }
.cap p { font-size: 0.66rem; line-height: 1.8; color: var(--mute); letter-spacing: 0.02em; }

/* PATH */
.timeline { border-top: 1px solid var(--line); }
.tl { display: grid; grid-template-columns: 150px 1fr; gap: clamp(1.4rem,4vw,4rem); padding: clamp(1.6rem,3.5vw,2.6rem) 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.tl__year { font-size: 0.85rem; color: var(--accent); letter-spacing: 0.1em; }
.tl__body h4 { font-family: var(--sans); font-size: clamp(1.15rem,2.6vw,1.7rem); font-weight: 400; letter-spacing: -0.02em; margin-bottom: 0.45rem; }
.tl__body p { color: var(--mute); font-size: clamp(0.72rem,1.3vw,0.85rem); }

/* CONTACT */
.contact__big { font-family: var(--sans); font-size: clamp(3rem,12vw,9.5rem); font-weight: 300; line-height: 0.9; letter-spacing: -0.045em; margin-bottom: clamp(2.4rem,6vw,4.5rem); }
.contact__rows { border-top: 1px solid var(--line); }
.crow { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 1.4rem; padding: clamp(1.1rem,2.5vw,1.7rem) 0; border-bottom: 1px solid var(--line); transition: padding-left 0.4s var(--ease); }
.crow:hover { padding-left: 1.2rem; }
.crow span { font-size: 0.62rem; letter-spacing: 0.16em; color: var(--mute); }
.crow b { font-family: var(--sans); font-weight: 400; font-size: clamp(1.05rem,2.4vw,1.65rem); letter-spacing: -0.01em; transition: color 0.3s var(--ease); }
.crow:hover b { color: var(--accent); }
.crow i { font-style: normal; color: var(--mute); transition: transform 0.4s var(--ease), color 0.3s var(--ease); }
.crow:hover i { color: var(--accent); transform: translate(4px,-4px); }

/* FOOTER */
.foot { position: relative; z-index: 2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.8rem var(--pad); border-top: 1px solid var(--line); font-size: 0.6rem; letter-spacing: 0.12em; color: var(--mute); background: var(--bone); }

/* REVEAL */
[data-reveal] { opacity: 0; transform: translateY(26px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .stack__grid { grid-template-columns: repeat(2,1fr); }
  .hero__corner { display: none; }
}
@media (max-width: 680px) {
  .nav__links { display: none; }
  .nav__menu { display: block; }
  .proj { grid-template-columns: auto 1fr; }
  .proj__go { display: none; }
  .stack__grid { grid-template-columns: 1fr; }
  .tl { grid-template-columns: 70px 1fr; gap: 1rem; }
  .crow { grid-template-columns: 80px 1fr; }
  .crow i { display: none; }
  .foot__mid { display: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
