/* =====================================================
   DUANN GP — Portfolio
   style.css
   ===================================================== */

/* --- Tokens --- */
:root {
  --bg:        #07070c;
  --surface:   #0f0f16;
  --accent:    #d4ff57;
  --white:     #f0ede6;
  --muted:     #5a5a6e;
  --border:    rgba(255,255,255,0.07);
  --ff-display: 'Syne', sans-serif;
  --ff-body:    'Inter', sans-serif;
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* =====================================================
   CURSOR
   ===================================================== */
#cursor { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; }

#cursor-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
}

#cursor-ring {
  position: absolute;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(212,255,87,0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.3s;
}

body.cursor-hover #cursor-ring {
  width: 64px; height: 64px;
  opacity: 0.6;
}

body.cursor-hover #cursor-dot {
  transform: translate(-50%, -50%) scale(1.8);
}

/* =====================================================
   LOADER
   ===================================================== */
#loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  transition: opacity 0.8s var(--ease-out);
}

#loader.hide { opacity: 0; pointer-events: none; }

.loader-inner { text-align: center; }

.loader-logo {
  font-family: var(--ff-display);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 32px;
}

.loader-bar-wrap {
  width: 200px; height: 2px;
  background: rgba(255,255,255,0.1);
  margin: 0 auto 12px;
  overflow: hidden;
  border-radius: 2px;
}

#loader-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 2px;
}

.loader-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-family: var(--ff-display);
}

/* =====================================================
   NAV
   ===================================================== */
#nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 40px;
  z-index: 500;
  mix-blend-mode: normal;
  transition: padding 0.3s var(--ease-out);
}

#nav.scrolled { padding: 16px 40px; }

.nav-logo {
  font-family: var(--ff-display);
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.nav-right { display: flex; align-items: center; gap: 28px; }

/* Lang toggle */
.lang-switch {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em;
}

.lang-sep { color: var(--muted); }

.lang-btn {
  background: none; border: none; cursor: none;
  color: var(--muted);
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px 2px;
  transition: color 0.2s;
}
.lang-btn.active,
.lang-btn:hover { color: var(--accent); }

/* Menu toggle */
.menu-toggle {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; cursor: none;
  color: var(--white);
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em;
  padding: 4px;
}

.hamburger {
  display: flex; flex-direction: column;
  gap: 5px; width: 22px;
}
.hamburger span {
  display: block; height: 1.5px;
  background: var(--white);
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}

body.menu-open .hamburger span:first-child {
  transform: translateY(6.5px) rotate(45deg);
}
body.menu-open .hamburger span:last-child {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* =====================================================
   OVERLAY MENU
   ===================================================== */
.overlay {
  position: fixed; inset: 0;
  z-index: 400;
  pointer-events: none;
}

.overlay-bg {
  position: absolute; inset: 0;
  background: var(--bg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.7s var(--ease-out);
}

body.menu-open .overlay { pointer-events: auto; }
body.menu-open .overlay-bg { transform: scaleY(1); }

.overlay-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 120px 80px 80px;
  opacity: 0;
  transition: opacity 0.4s 0.3s;
}

body.menu-open .overlay-inner { opacity: 1; }

.overlay-links {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}

.ol-link {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: clamp(40px, 7vw, 88px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--muted);
  transition: color 0.3s, transform 0.3s var(--ease-out);
  cursor: none;
}

.ol-link:hover {
  color: var(--accent);
  transform: translateX(12px);
}

.overlay-footer {
  position: absolute; bottom: 48px; left: 80px; right: 80px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 13px; color: var(--muted);
}

.overlay-footer a {
  color: var(--white);
  font-family: var(--ff-display);
  font-weight: 600;
  transition: color 0.2s;
}
.overlay-footer a:hover { color: var(--accent); }

/* =====================================================
   HERO
   ===================================================== */
#hero {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

#webgl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  pointer-events: none;
}

.hero-label {
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeIn 0.8s 2.5s var(--ease-out) forwards;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: clamp(72px, 13vw, 180px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--white);
  display: flex; flex-direction: column; align-items: center;
}

.t-line {
  display: block; overflow: hidden;
}

.t-inner {
  display: block;
  transform: translateY(110%);
  animation: slideUp 1s var(--ease-out) forwards;
}

.t-line:first-child .t-inner { animation-delay: 1.8s; }
.t-line:last-child  .t-inner { animation-delay: 2.0s; }

.hero-scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 1s 3s var(--ease-out) forwards;
  pointer-events: none;
}

.scroll-bar {
  width: 1px; height: 48px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}

.scroll-fill {
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scrollAnim 2s 3.5s ease-in-out infinite;
  transform: translateY(-100%);
}

.hero-corner {
  position: absolute; right: 40px; bottom: 40px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-size: 11px; color: var(--muted); letter-spacing: 0.12em;
  z-index: 2; pointer-events: none;
  opacity: 0; animation: fadeIn 1s 3s var(--ease-out) forwards;
}

/* =====================================================
   COMMON SECTION STYLES
   ===================================================== */
section {
  position: relative;
  padding: 120px 80px;
}

.section-index {
  position: absolute; top: 48px; right: 80px;
  font-family: var(--ff-display);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.section-index.light { color: rgba(255,255,255,0.3); }

.section-title {
  font-family: var(--ff-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--white);
}

/* Scroll reveal */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   ABOUT
   ===================================================== */
#about {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 32px;
}

.about-text {
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.55;
  color: var(--white);
  font-weight: 300;
  margin-bottom: 24px;
  margin-top: 24px;
}

.about-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

.about-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
}

.about-tags span {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px; font-family: var(--ff-display); font-weight: 500;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s;
}

.about-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =====================================================
   WORK
   ===================================================== */
#work {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: 80px;
}

.work-header {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding-top: 32px;
}

.work-sub {
  font-size: 15px; color: var(--muted);
  margin-top: 12px;
}

/* Work list — editorial index style */
.work-list {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.work-row {
  display: grid;
  grid-template-columns: 48px 1fr auto 40px;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  cursor: none;
  position: relative;
  overflow: hidden;
  transition: padding-left 0.4s var(--ease-out);
}

/* accent bar sliding from left on hover */
.work-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s var(--ease-out);
}

.work-row:hover { padding-left: 20px; }
.work-row:hover::before { transform: scaleY(1); }

.wr-num {
  font-family: var(--ff-display);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--muted);
  transition: color 0.3s;
}

.work-row:hover .wr-num { color: var(--accent); }

.wr-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wr-service {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.8vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1;
  transition: color 0.3s;
}

.work-row:hover .wr-service { color: var(--accent); }

.wr-desc {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--ff-body);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 0.4s var(--ease-out), opacity 0.35s, transform 0.35s var(--ease-out);
}

.work-row:hover .wr-desc {
  max-height: 40px;
  opacity: 1;
  transform: translateY(0);
}

.wr-year {
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.3s;
}

.work-row:hover .wr-year { color: rgba(255,255,255,0.5); }

.wr-arrow {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease-out);
}

.wr-arrow svg {
  width: 14px; height: 14px;
  stroke: var(--muted);
  transition: stroke 0.3s;
}

.work-row:hover .wr-arrow {
  border-color: var(--accent);
  background: var(--accent);
  transform: rotate(45deg);
}

.work-row:hover .wr-arrow svg { stroke: #07070c; }

/* =====================================================
   CAPABILITIES
   ===================================================== */
#capabilities {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-left: 0; padding-right: 0;
  overflow: hidden;
}

#capabilities .section-title,
#capabilities .section-index { padding-left: 80px; }
#capabilities .section-index { right: 80px; }

.marquee-wrap {
  margin-top: 48px; margin-bottom: 64px;
  display: flex; flex-direction: column; gap: 0;
}

.marquee-track {
  width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  overflow: hidden;
}

.marquee-track + .marquee-track { border-top: none; }

.marquee-inner {
  display: flex; gap: 0; white-space: nowrap;
  animation: marqueeLeft 20s linear infinite;
}

.m-reverse .marquee-inner { animation: marqueeRight 22s linear infinite; }

.marquee-inner span {
  font-family: var(--ff-display);
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 32px;
  transition: color 0.2s;
  position: relative;
}

.marquee-inner span::after {
  content: '·';
  position: absolute; right: 0;
  color: var(--border);
}

.marquee-inner span:hover { color: var(--accent); }

.cap-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  max-width: 100%;
  padding: 0 80px;
}

.cap-item {
  padding: 40px 32px;
  border-right: 1px solid var(--border);
  transition: background 0.3s;
}

.cap-item:last-child { border-right: none; }
.cap-item:hover { background: rgba(255,255,255,0.02); }

.cap-num {
  font-family: var(--ff-display); font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em; color: var(--accent);
  display: block; margin-bottom: 16px;
}

.cap-item h3 {
  font-family: var(--ff-display); font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--white);
  margin-bottom: 10px;
}

.cap-item p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* =====================================================
   CONTACT
   ===================================================== */
#contact {
  background: var(--surface);
  border-top: 1px solid var(--border);
  min-height: 70vh;
  display: flex; align-items: center;
}

.contact-inner {
  max-width: 900px;
  padding-top: 32px;
}

.contact-title {
  font-family: var(--ff-display);
  font-size: clamp(42px, 7vw, 96px);
  font-weight: 800; letter-spacing: -0.04em;
  line-height: 0.95; color: var(--white);
  margin-bottom: 24px;
}

.contact-sub {
  font-size: 17px; color: var(--muted);
  margin-bottom: 48px;
}

.email-link {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--ff-display);
  font-size: clamp(22px, 3.5vw, 42px);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
  transition: border-color 0.3s, gap 0.3s;
  cursor: none;
}

.email-link:hover {
  border-color: var(--accent);
  gap: 20px;
}

.email-arrow { font-size: 0.7em; }

.contact-social {
  display: flex; gap: 24px; margin-top: 48px;
}

.contact-social a {
  font-family: var(--ff-display); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--muted);
  text-transform: uppercase;
  transition: color 0.2s;
  cursor: none;
}

.contact-social a:hover { color: var(--white); }

/* =====================================================
   FOOTER
   ===================================================== */
#footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 32px 80px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  font-family: var(--ff-display); letter-spacing: 0.06em;
}

.back-top {
  font-family: var(--ff-display); font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--muted);
  transition: color 0.2s;
  cursor: none;
}
.back-top:hover { color: var(--accent); }

/* =====================================================
   MAGNETIC BUTTON (JS adds class)
   ===================================================== */
.magnetic { display: inline-block; }

/* =====================================================
   KEYFRAMES
   ===================================================== */
@keyframes slideUp {
  to { transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes scrollAnim {
  0%   { transform: translateY(-100%); }
  50%  { transform: translateY(0%); }
  100% { transform: translateY(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 20px 20px; }
}

@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  section { padding: 96px 48px; }
  #nav { padding: 20px 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .work-row { grid-template-columns: 36px 1fr auto 36px; gap: 20px; }
  .cap-grid { grid-template-columns: repeat(3, 1fr); padding: 0 48px; }
  #capabilities .section-title { padding-left: 48px; }
  #footer { padding: 28px 48px; }
  .overlay-inner { padding: 100px 48px 60px; }
  .overlay-footer { left: 48px; right: 48px; }
}

@media (max-width: 768px) {
  body { cursor: auto; }
  #cursor { display: none; }
  section { padding: 80px 24px; }
  #nav { padding: 20px 24px; }
  #nav.scrolled { padding: 14px 24px; }
  .hero-title { font-size: clamp(60px, 16vw, 100px); }
  .work-row { grid-template-columns: 32px 1fr 36px; gap: 16px; }
  .wr-year { display: none; }
  .cap-grid { grid-template-columns: 1fr 1fr; padding: 0 24px; }
  .cap-item { padding: 28px 20px; }
  #capabilities .section-title { padding-left: 24px; }
  #capabilities .section-index { right: 24px; }
  .section-index { right: 24px; }
  #footer { padding: 24px; flex-direction: column; gap: 12px; text-align: center; }
  .overlay-inner { padding: 80px 24px 48px; }
  .overlay-footer { left: 24px; right: 24px; flex-direction: column; gap: 8px; text-align: center; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-inner { max-width: 100%; }
  .hero-corner { display: none; }
}

@media (max-width: 480px) {
  .cap-grid { grid-template-columns: 1fr; }
  .work-row { padding: 24px 0; }
  .wr-service { font-size: 20px; }
  .ol-link { font-size: clamp(32px, 10vw, 60px); }
}
