/* ── DESIGN TOKENS ── */
:root {
  --bg:       #FAFAF8;
  --text:     #111111;
  --accent:   #35528c;
  --muted:    #888888;
  --surface:  #F2F1ED;
  --nav-h:    72px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
body.touch-device { cursor: auto; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── CUSTOM CURSOR ── */
#cursor {
  width: 12px; height: 12px;
  background: var(--text);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .2s ease-out, height .2s ease-out, background .2s ease-out;
  will-change: transform;
}
#cursor.link-hover { width: 44px; height: 44px; background: var(--accent); }
.touch-device #cursor { display: none; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 56px; }

/* ── NAVBAR ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background .35s ease, backdrop-filter .35s ease, box-shadow .35s ease;
}
.navbar.scrolled {
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0,0,0,.07);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 56px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: .9375rem;
  letter-spacing: -.01em;
  color: var(--text);
  z-index: 1001;
  display: flex; align-items: center;
}
.navbar-logo-img {
  display: none;
  height: 32px;
  width: auto;
}
.navbar-links {
  display: flex; gap: 40px; align-items: center;
}
.navbar-links a {
  font-size: .875rem; font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
  position: relative;
  transition: color .2s ease-out;
}
.navbar-links a::after {
  content: ''; position: absolute;
  bottom: -5px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s ease-out;
}
.navbar-links a:hover { color: var(--text); }
.navbar-links a:hover::after,
.navbar-links a.active::after { width: 100%; }
.navbar-links a.active { color: var(--text); }

.navbar-ds-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color .2s ease-out;
  position: relative;
}
.navbar-ds-icon::after {
  content: ''; position: absolute;
  bottom: -5px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s ease-out;
}
.navbar-ds-icon:hover { color: var(--text); }
.navbar-ds-icon:hover::after,
.navbar-ds-icon.active::after { width: 100%; }
.navbar-ds-icon.active { color: var(--text); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none;
  cursor: none; z-index: 1001; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  transition: transform .3s ease, opacity .3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay nav */
.mobile-nav {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 999;
  flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav a {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 2.75rem;
  letter-spacing: -.03em;
  text-align: center;
  transition: color .2s ease;
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--accent); }

/* ── SECTION LABEL ── */
.section-label {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 56px;
}
.section-label::before {
  content: ''; display: inline-block;
  width: 32px; height: 1px; background: var(--muted);
}

/* ── HERO ── */
.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: var(--nav-h); padding-bottom: 80px;
  overflow: hidden;
}
.hero-inner {
  padding: 0 56px;
  width: 100%;
}

/* ── NAME MARQUEE ── */
.name-marquee {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.name-row { overflow: hidden; }
.name-inner {
  display: inline-block;
  white-space: nowrap;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(4.5rem, 18vw, 15rem);
  line-height: 1.0;
  letter-spacing: -.04em;
  color: var(--text);
  will-change: transform;
  animation: marquee-right var(--speed, 10s) linear infinite;
}
.name-word {
  display: inline-block;
  padding-right: 20vw;
}
.name-inner--accent { color: var(--accent); }
@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0%); }
}

.hero-meta {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 40px;
  flex-wrap: wrap;
}
.hero-subtitle {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 1.8vw, 1.375rem);
  color: var(--accent);
  letter-spacing: .01em;
}
.hero-tagline {
  max-width: 380px;
  font-size: .9375rem;
  color: var(--muted);
  line-height: 1.75;
}

/* ── SECTIONS ── */
.section { padding: 100px 0; }

/* ── FEATURED CARDS (HOME) ── */
.featured-list { display: flex; flex-direction: column; }

.feat-card {
  display: grid;
  grid-template-columns: 72px 1fr 380px;
  gap: 40px; align-items: center;
  padding: 36px 0;
  border-top: 1px solid rgba(0,0,0,.09);
  color: var(--text);
  overflow: hidden;
  transition: background .2s ease;
}
.feat-card:last-child { border-bottom: 1px solid rgba(0,0,0,.09); }

.feat-num {
  font-family: 'Syne', sans-serif;
  font-size: .8125rem; font-weight: 800;
  color: var(--muted); letter-spacing: .06em;
}
.feat-info h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.875rem);
  letter-spacing: -.03em;
  margin-bottom: 8px;
  transition: color .2s ease-out;
}
.feat-card:hover .feat-info h3 { color: var(--accent); }
.feat-info p { font-size: .875rem; color: var(--muted); line-height: 1.6; }

.feat-img {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: var(--surface);
}
.feat-img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%);
  transition: filter .45s ease-out, transform .55s ease-out;
}
.feat-card:hover .feat-img img { filter: grayscale(0%); transform: scale(1.06); }

.cta-wrap { margin-top: 60px; }
.cta-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1rem;
  letter-spacing: -.01em;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  transition: color .2s ease, gap .25s ease-out;
}
.cta-link:hover { color: var(--accent); gap: 18px; }

/* ── PAGE HEADER ── */
.page-header {
  padding-top: calc(var(--nav-h) + 96px);
  padding-bottom: 0;
}
.page-title {
  font-size: clamp(3rem, 7vw, 8rem);
  letter-spacing: -.05em;
  line-height: .95;
}

/* ── PROJECTS LIST ── */
.projects-list { margin-top: 80px; }

.proj-card {
  display: grid; grid-template-columns: 72px 1fr;
  gap: 40px; padding: 60px 0;
  border-top: 1px solid rgba(0,0,0,.09);
  color: var(--text);
}
.proj-card:last-child { border-bottom: 1px solid rgba(0,0,0,.09); }

.proj-num {
  font-family: 'Syne', sans-serif;
  font-size: .8125rem; font-weight: 800;
  color: var(--muted); letter-spacing: .06em;
  padding-top: 6px;
}
.proj-body {
  display: grid; grid-template-columns: 1fr 420px;
  gap: 60px; align-items: start;
}
.proj-text h2 {
  font-size: clamp(1.75rem, 3vw, 3rem);
  letter-spacing: -.04em;
  margin-bottom: 18px;
  transition: color .2s ease-out;
}
.proj-card:hover .proj-text h2 { color: var(--accent); }
.proj-summary {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 28px;
}
/* ── WIP BADGE ── */
.wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.wip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: wip-pulse 1.8s ease-in-out infinite;
}
@keyframes wip-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: .6875rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  padding: 5px 12px; border-radius: 2px;
}

.proj-img-wrap {
  position: relative; overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4/3;
}
.proj-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(100%);
  transition: filter .45s ease-out, transform .55s ease-out;
}
.proj-card:hover .proj-img-wrap img { filter: grayscale(0%); transform: scale(1.06); }

/* ── CAROUSEL ── */
.carousel { overflow: hidden; background: var(--bg); }
.carousel .carousel-track {
  position: relative;
  width: 100%; height: 100%;
}
.carousel .carousel-track img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity .6s ease, filter .45s ease-out;
}
.carousel .carousel-track img.carousel-active { opacity: 1; }
.proj-card:hover .carousel .carousel-track img { filter: grayscale(0%); }
.carousel-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 7px;
  z-index: 2;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.45);
  transition: background .25s ease, transform .25s ease;
  cursor: none;
}
.carousel-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* ── IMAGE CONTAIN (phone mockups) ── */
.proj-img-contain { background: var(--surface); }
.proj-img-contain img { object-fit: contain !important; transform: none !important; }

/* ── ABOUT ── */
.about-intro {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 100px; align-items: start;
  padding-top: calc(var(--nav-h) + 96px);
  padding-bottom: 100px;
}
.about-bio {
  font-size: 1.125rem; line-height: 1.85; color: var(--text);
}
.about-bio p + p { margin-top: 1.5em; }
.about-heading {
  font-size: clamp(2.5rem, 5vw, 5rem);
  letter-spacing: -.05em;
  margin-bottom: 48px;
}
.about-details { display: flex; flex-direction: column; gap: 36px; }
.detail-label {
  font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.detail-val {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1.0625rem;
  letter-spacing: -.01em;
}

/* ── EXPERIENCE ── */
.exp-list { display: flex; flex-direction: column; }
.exp-item {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 40px; padding: 40px 0;
  border-top: 1px solid rgba(0,0,0,.09);
}
.exp-item:last-child { border-bottom: 1px solid rgba(0,0,0,.09); }
.exp-period {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding-top: 4px;
}
.exp-role {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1.125rem;
  letter-spacing: -.01em; margin-bottom: 4px;
}
.exp-company {
  font-size: .875rem; color: var(--accent);
  font-weight: 500; margin-bottom: 14px;
}
.exp-desc {
  font-size: .9375rem; color: var(--muted);
  line-height: 1.75; max-width: 560px;
}
@media (max-width: 768px) {
  .exp-item { grid-template-columns: 1fr; gap: 12px; }
}

.skills-section { padding: 80px 0; border-top: 1px solid rgba(0,0,0,.09); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2px;
  margin-top: 0;
}
.skill {
  padding: 22px 24px;
  background: var(--surface);
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: .9375rem;
  letter-spacing: -.01em;
  transition: background .2s ease, color .2s ease;
}
.skill:hover { background: var(--text); color: var(--bg); }

/* ── CONTACT ── */
.contact-section {
  min-height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 80px;
}
.contact-headline {
  font-size: clamp(3rem, 8vw, 9.5rem);
  letter-spacing: -.05em; line-height: .92;
  margin-bottom: 72px;
}
.contact-rows { display: flex; flex-direction: column; }
.contact-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 32px 0;
  border-top: 1px solid rgba(0,0,0,.09);
  color: var(--text);
  transition: padding-left .25s ease-out;
}
.contact-row:last-child { border-bottom: 1px solid rgba(0,0,0,.09); }
.contact-row:hover { padding-left: 20px; }
.contact-type {
  font-size: .7rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); min-width: 80px;
}
.contact-val {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  letter-spacing: -.025em;
  transition: color .2s ease-out;
  min-width: 0;
  overflow-wrap: break-word;
}
.contact-row:hover .contact-val { color: var(--accent); }
.contact-arrow {
  font-size: 1.375rem;
  transition: transform .25s ease-out;
}
.contact-row:hover .contact-arrow { transform: translate(10px, -10px); }

/* ── FOOTER ── */
footer {
  background: #1c2e52;
  padding: 80px 0 0;
}
.footer-inner {
  padding: 0 48px;
}
.footer-headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 12vw, 12rem);
  color: #fff;
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin-bottom: 56px;
}
.footer-lower {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 32px 48px 48px;
}
.footer-copy { font-size: .8rem; color: rgba(255,255,255,0.4); }
.footer-right { display: flex; gap: 24px; }
.footer-right a { font-size: .8rem; color: rgba(255,255,255,0.5); transition: color .2s ease; }
.footer-right a:hover { color: #fff; }

/* ── SCROLL FADE-IN ── */
.fade-up {
  opacity: 0; transform: translateY(36px);
  transition: opacity .7s ease-out, transform .7s ease-out;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .proj-body { grid-template-columns: 1fr; gap: 28px; }
  .proj-img-wrap { aspect-ratio: 16/9; max-width: 100%; }
  .about-intro { grid-template-columns: 1fr; gap: 56px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .navbar-inner { padding: 0 24px; }
  .hamburger { display: flex; }
  .navbar-links { display: none; }
  .mobile-nav { display: flex; }
  .navbar-logo-text { display: none; }
  .navbar-logo-img { display: block; }
  .mobile-nav a[href="design-system.html"] { font-size: 1.75rem; }

  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 12px); padding-bottom: 16px; }
  .name-marquee { flex: 0 0 auto; padding: 8px 0 80px; }
  .hero-inner { padding: 0 24px; }
  .hero-name { font-size: clamp(3rem, 14vw, 5.5rem); letter-spacing: -.04em; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 16px; }

  .section { padding: 64px 0; }

  .feat-card { grid-template-columns: 56px 1fr; gap: 20px; }
  .feat-img { display: none; }

  .page-header { padding-top: calc(var(--nav-h) + 56px); }
  .page-title { font-size: clamp(2.5rem, 11vw, 4rem); }

  .proj-card { grid-template-columns: 1fr; gap: 16px; padding: 44px 0; }
  .proj-num { display: inline-block; margin-bottom: -8px; }
  .proj-body { grid-template-columns: 1fr; gap: 24px; }

  .about-intro { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 64px; }
  .about-heading { font-size: clamp(2rem, 11vw, 3.5rem); }

  .contact-headline { font-size: clamp(2.5rem, 12vw, 5rem); }
  .contact-row { flex-wrap: wrap; gap: 4px 16px; padding: 24px 0; }
  .contact-val { font-size: clamp(1rem, 5.5vw, 1.5rem); width: 100%; }
  .contact-type { min-width: unset; }
  .contact-arrow { margin-left: auto; }

  footer { padding: 56px 0 0; }
  .footer-inner { padding: 0 24px; }
  .footer-headline { margin-bottom: 40px; }
  .footer-lower { flex-direction: column; gap: 16px; align-items: flex-start; padding: 28px 24px 36px; }
}

/* ── CHAT WIDGET ── */
#chat-btn {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 1100;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(53,82,140,.35);
  transition: transform .2s ease, background .2s ease;
}
#chat-btn:hover { transform: scale(1.08); background: #2a4275; }
#chat-btn.open { background: #2a4275; }

#chat-panel {
  position: fixed; bottom: 92px; right: 28px;
  z-index: 1099;
  width: 340px;
  background: var(--bg);
  border: 1px solid rgba(0,0,0,.09);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.14);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
}
#chat-panel.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-header {
  background: #1c2e52;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.chat-header-name { color: #fff; font-size: .85rem; font-weight: 500; line-height: 1.2; }
.chat-header-sub  { color: rgba(255,255,255,.5); font-size: .75rem; line-height: 1.2; }
.chat-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: .85rem; padding: 4px;
  transition: color .15s ease;
}
.chat-close:hover { color: #fff; }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 20px 16px; display: flex; flex-direction: column; gap: 10px;
  min-height: 200px; max-height: 320px;
}
.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .85rem; line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--surface); color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.typing {
  display: flex; align-items: center; gap: 5px;
  padding: 12px 16px;
}
.chat-msg.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: chat-bounce .9s infinite ease-in-out;
}
.chat-msg.typing span:nth-child(2) { animation-delay: .15s; }
.chat-msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(0,0,0,.07);
}
#chat-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif; font-size: .85rem;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color .2s ease;
}
#chat-input:focus { border-color: var(--accent); }
#chat-send {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s ease;
}
#chat-send:hover { background: #2a4275; }
#chat-send:disabled { background: var(--muted); cursor: default; }

@media (max-width: 480px) {
  #chat-panel { right: 16px; left: 16px; width: auto; bottom: 84px; }
  #chat-btn { right: 16px; bottom: 20px; }
}
