/* ============================================================
   DR. YUSRI SALLEH — "DUAL PULSE"
   Where medicine meets technology.
   ============================================================ */

:root {
  --bg: #070907;
  --bg-soft: #0c0f0c;
  --ink: #e9ece6;
  --ink-dim: #9aa39a;
  --ink-faint: #4a534b;
  --accent: #3dffa0;
  --accent-deep: #0f8a52;
  --line: rgba(233, 236, 230, 0.10);
  --card: #f2f1ea;
  --card-ink: #11140f;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(20px, 5vw, 72px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #06130c; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
em { font-family: var(--font-serif); font-style: italic; }
.accent { color: var(--accent); }

/* ============ PRELOADER ============ */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.preloader__curtain {
  position: absolute; inset: 0; background: #0a0d0a;
}
.preloader__curtain--b { background: var(--bg-soft); transform: scaleY(0); }
.preloader__inner {
  position: relative; z-index: 2;
  width: min(92vw, 720px);
  display: flex; flex-direction: column; gap: 18px;
}
.preloader__row {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
}
.preloader__label { color: var(--ink); }
.preloader__label--dim { color: var(--ink-faint); }
.preloader__counter {
  font-size: clamp(80px, 18vw, 200px);
  font-weight: 700; line-height: 0.9; letter-spacing: -0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ============ CURSOR ============ */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none; }
  .cursor__dot {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); transform: translate(-50%, -50%);
  }
  .cursor__ring {
    position: absolute; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(61, 255, 160, 0.5);
    transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center;
    transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
                background-color 0.3s, border-color 0.3s;
  }
  .cursor__txt {
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em;
    color: #06130c; opacity: 0; transition: opacity 0.2s;
  }
  .cursor--link .cursor__ring { width: 56px; height: 56px; background: rgba(61,255,160,0.12); }
  .cursor--view .cursor__ring {
    width: 72px; height: 72px; background: var(--accent); border-color: var(--accent);
  }
  .cursor--view .cursor__txt { opacity: 1; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  mix-blend-mode: normal;
  transition: transform 0.5s var(--ease-out);
}
.nav.nav--hidden { transform: translateY(-110%); }
.nav::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(7,9,7,0.85), rgba(7,9,7,0));
  pointer-events: none;
}
.nav > * { position: relative; }
.nav__logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 15px; letter-spacing: 0.01em;
}
.nav__pulse { width: 44px; height: 16px; color: var(--accent); }
.nav__pulse path {
  stroke-dasharray: 70; stroke-dashoffset: 0;
  animation: pulse-draw 3.2s linear infinite;
}
@keyframes pulse-draw {
  0% { stroke-dashoffset: 70; opacity: 0.3; }
  35% { opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -70; opacity: 0.2; }
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-dim);
  transition: color 0.25s;
}
.nav__links a sup { color: var(--accent); margin-right: 4px; font-size: 9px; }
.nav__links a:hover { color: var(--ink); }
.nav__right { display: flex; align-items: center; gap: 16px; }
.nav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent); }
.nav__cta-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.nav__burger {
  display: none;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav__burger span {
  display: block; width: 16px; height: 1.5px; background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.3s;
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ============ MOBILE MENU ============ */
.menu {
  position: fixed; inset: 0; z-index: 90;
  visibility: hidden; pointer-events: none;
}
.menu.is-open { visibility: visible; pointer-events: auto; }
.menu__bg {
  position: absolute; inset: 0; background: var(--bg-soft);
  transform: translateY(-100%);
}
.menu__links {
  position: relative; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--pad); gap: 6px;
}
.menu__link {
  display: flex; align-items: baseline; gap: 14px;
  font-size: clamp(36px, 9vw, 64px); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.15; overflow: hidden;
}
.menu__link sup { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.menu__link span { display: inline-block; }
.menu__foot {
  position: absolute; bottom: 32px; left: var(--pad); right: var(--pad);
  display: flex; gap: 24px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
}

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
.hero__grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__inner {
  position: relative; z-index: 2;
  padding: clamp(88px, 12vh, 140px) var(--pad) 0;
  width: 100%;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: clamp(10px, 1.4vw, 12px);
  letter-spacing: 0.16em; color: var(--ink-dim);
  margin-bottom: clamp(16px, 3vh, 32px);
}
.hero__eyebrow-tag { color: var(--accent); }
.hero__title {
  font-size: clamp(56px, 13.5vw, 190px);
  line-height: 0.92; font-weight: 700; letter-spacing: -0.04em;
  text-transform: uppercase;
}
.hero__line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero__word { display: inline-block; will-change: transform; }
.hero__word--serif {
  font-family: var(--font-serif); font-weight: 400; font-style: italic;
  text-transform: none; font-size: 0.62em; line-height: 1;
}
.hero__word--outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
}
.hero__word--accent { color: var(--accent); }
.hero__word--accent.hero__word--serif { -webkit-text-stroke: 0; }
.hero__bottom {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
  margin: clamp(24px, 4vh, 48px) 0;
}
.hero__sub {
  max-width: 460px; color: var(--ink-dim);
  font-size: clamp(14px, 1.6vw, 17px); line-height: 1.65;
}
.hero__ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__meta {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding: 0 var(--pad);
}
.hero__meta-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 0; font-family: var(--font-mono);
}
.hero__meta-item span { font-size: 9px; letter-spacing: 0.18em; color: var(--ink-faint); }
.hero__meta-item strong { font-size: 12px; letter-spacing: 0.06em; color: var(--ink-dim); font-weight: 500; }
.hero__scroll-arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; color: var(--accent) !important; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ============ BUTTONS ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 28px; border-radius: 999px;
  transition: color 0.35s var(--ease-out), background-color 0.35s var(--ease-out),
              border-color 0.35s, transform 0.3s var(--ease-out);
  overflow: hidden;
}
.btn--solid { background: var(--accent); color: #06130c; font-weight: 500; }
.btn--solid:hover { background: #5fffb2; }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--xl {
  font-size: clamp(13px, 1.8vw, 16px);
  padding: clamp(20px, 3vw, 30px) clamp(34px, 5vw, 56px);
  background: var(--accent); color: #06130c; font-weight: 500;
}
.btn--xl:hover { background: #5fffb2; transform: scale(1.02); }
.btn__pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #06130c;
  animation: blink 1.4s ease-in-out infinite;
}
.btn__arrow { font-size: 1.2em; line-height: 0; }

/* ============ MARQUEE ============ */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 0; background: var(--bg-soft);
}
.marquee__track { display: inline-flex; will-change: transform; }
.marquee__item {
  font-size: clamp(18px, 3vw, 30px); font-weight: 500;
  letter-spacing: 0.04em; color: var(--ink-dim);
  text-transform: uppercase;
}
.marquee__item i { font-style: normal; color: var(--accent); margin: 0 14px; }

/* ============ SECTIONS ============ */
.section { padding: clamp(90px, 14vh, 160px) var(--pad); }
.section__head {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: clamp(40px, 7vh, 72px);
  font-family: var(--font-mono);
}
.section__head--inset { margin-bottom: 0; }
.section__num { color: var(--accent); font-size: 12px; }
.section__name { font-size: 12px; letter-spacing: 0.22em; color: var(--ink-dim); }
.section__rule { flex: 1; height: 1px; background: var(--line); }

/* ============ ABOUT ============ */
.about__grid {
  display: grid; grid-template-columns: minmax(260px, 420px) 1fr;
  gap: clamp(36px, 6vw, 90px); align-items: start;
}
.about__card {
  background: var(--card); border-radius: 14px; padding: 14px;
  transform: rotate(-2deg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.about__card-frame { border-radius: 8px; overflow: hidden; background: #fff; }
.about__card-frame img { width: 100%; }
.about__card-meta {
  display: flex; justify-content: space-between; padding: 12px 4px 2px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--card-ink);
}
.about__card-meta .blink { color: #c33; animation: blink 1.4s infinite; }
.about__text {
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.32; font-weight: 400; letter-spacing: -0.015em;
}
.about__text .w { opacity: 0.14; transition: opacity 0.3s linear; }
.about__tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 36px; }
.tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}

/* ============ EXPLORATIONS ============ */
.explore__intro {
  max-width: 560px; color: var(--ink-dim);
  font-size: clamp(15px, 1.8vw, 18px); line-height: 1.65;
  margin-bottom: clamp(36px, 6vh, 64px);
}
.explore__list { border-top: 1px solid var(--line); }
.explore__item { border-bottom: 1px solid var(--line); }
.explore__row {
  display: grid;
  grid-template-columns: 56px minmax(200px, 1.1fr) 1.6fr 60px;
  align-items: center; gap: 20px;
  padding: clamp(22px, 3.6vh, 38px) 8px;
  position: relative;
  transition: padding 0.4s var(--ease-out);
}
.explore__row::before {
  content: ""; position: absolute; inset: 0 -8px;
  background: rgba(61, 255, 160, 0.05);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.4s var(--ease-out);
}
.explore__num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.explore__title {
  font-size: clamp(22px, 3.4vw, 40px); font-weight: 500; letter-spacing: -0.02em;
  transition: transform 0.4s var(--ease-out), color 0.3s;
}
.explore__desc {
  color: var(--ink-dim); font-size: clamp(13px, 1.5vw, 15px); line-height: 1.55;
  max-width: 480px;
}
.explore__arrow {
  font-size: 22px; color: var(--accent); justify-self: end;
  transform: translateX(-12px); opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.3s;
}
@media (hover: hover) {
  .explore__row:hover::before { transform: scaleY(1); }
  .explore__row:hover .explore__title { transform: translateX(10px); color: var(--accent); }
  .explore__row:hover .explore__arrow { transform: translateX(0); opacity: 1; }
}

/* ============ DUALITY ============ */
.duality { padding: 0; }
.duality__pin {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(90px, 12vh, 140px) var(--pad);
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(61, 255, 160, 0.07), transparent),
    var(--bg-soft);
}
.duality__stage {
  position: relative;
  flex: 1; display: flex; align-items: center;
  min-height: 50vh;
}
.duality__phrase {
  position: absolute; left: 0; right: 0;
  font-size: clamp(52px, 11vw, 160px);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.04em;
  text-transform: uppercase;
}
.duality__phrase em {
  font-size: 0.5em; font-weight: 400; text-transform: none;
  color: var(--ink-dim); margin: 0 0.1em;
}
.duality__phrase--day { color: var(--ink); }
.duality__phrase--night { color: var(--accent); }
.duality__sun, .duality__moon {
  display: inline-block; font-size: 0.45em; vertical-align: super; margin-left: 0.25em;
}
.duality__sun { color: #ffd35c; }
.duality__moon { color: var(--accent); }
.duality__note {
  font-family: var(--font-mono); font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.06em; color: var(--ink-dim); max-width: 420px; line-height: 1.7;
}

/* ============ CONTACT ============ */
.contact { text-align: left; }
.contact__title {
  font-size: clamp(54px, 12vw, 170px);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: clamp(36px, 6vh, 64px);
}
.contact__title em { text-transform: none; font-weight: 400; font-size: 0.7em; }
.contact__line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.05em; }
.contact__line > span { display: inline-block; }
.contact__actions { margin-bottom: clamp(48px, 9vh, 96px); }
.contact__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  border-top: 1px solid var(--line); padding-top: 32px;
}
.contact__cell { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.contact__cell a { color: var(--ink); transition: color 0.25s; }
.contact__cell a:hover { color: var(--accent); }
.contact__label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-faint);
}

/* ============ FOOTER ============ */
.footer { border-top: 1px solid var(--line); overflow: hidden; }
.footer__big {
  padding: clamp(20px, 4vh, 40px) var(--pad) 0;
  font-size: clamp(60px, 14.5vw, 220px);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(233, 236, 230, 0.16);
  white-space: nowrap; text-align: center;
  user-select: none;
}
.footer__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 24px var(--pad) 28px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--ink-dim); flex-wrap: wrap;
}
.footer__bar a:hover { color: var(--accent); }

/* ============ REVEAL DEFAULTS ============ */
[data-reveal] { opacity: 0; transform: translateY(28px); }
.no-js [data-reveal], .reduced [data-reveal] { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__cta { display: none; }
  .hero__meta { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }
  .hero__meta-item { padding: 12px 0; }
  .about__grid { grid-template-columns: 1fr; }
  .about__card { max-width: 360px; margin: 0 auto; }
  .explore__row {
    grid-template-columns: 40px 1fr 36px;
    grid-template-areas: "num title arrow" ". desc .";
    row-gap: 8px;
  }
  .explore__num { grid-area: num; }
  .explore__title { grid-area: title; }
  .explore__desc { grid-area: desc; }
  .explore__arrow { grid-area: arrow; opacity: 1; transform: none; }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .hero__title { font-size: clamp(48px, 16vw, 80px); }
  .hero__bottom { margin-bottom: 16px; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__bar { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
