/* ============================================================
   Reset & base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  background: #0d0d0d;
  color: #ffffff;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

ul {
  margin: 0;
  padding-left: 24px;
}

p {
  margin: 0 0 0.9em 0;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

/* ============================================================
   Phone-shell wrapper (centered column on desktop)
   ============================================================ */
:root {
  --phone-w: 393px;
  --phone-pad: 20px;
  --col-pad: 17px;
}

.phone {
  width: 100%;
  max-width: var(--phone-w);
  margin: 0 auto;
  padding: 0;
  position: relative;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 29px clamp(16px, 3vw, 40px) 0;
  font-size: 12.167px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 300;
  color: #ffffff;
}

/* ============================================================
   Hero
   ============================================================ */
/* ============================================================
   Hero — full viewport width, ~full viewport height
   SALUT and EU SUNT MAX scale to span the viewport width,
   matching the carousel between them.
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.hero-word {
  font-family: "Archivo Black", "Inter", sans-serif;
  font-weight: 900;
  color: #e9e9e9;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin: 0;
  white-space: nowrap;
  text-align: center;
  padding: 0 clamp(8px, 1.5vw, 24px);
  position: relative;
  z-index: 1;
}

/* SALUT — span the full viewport width.
   Archivo Black "SALUT" (5 chars) at ~24vw fills the viewport with mild padding.
   margin-bottom negative pulls the carousel up so SALUT bottom slips under it. */
.hero-word--top {
  font-size: 24vw;
  margin-bottom: -0.18em;
}

/* EU SUNT MAX — span the full viewport width.
   margin-top negative pulls EU SUNT MAX up under the carousel's bottom edge. */
.hero-word--bottom {
  font-size: 11.4vw;
  margin-top: -0.2em;
}

/* Carousel of 4 looping clips — sits ON TOP of the text overlap zones */
.hero-band {
  position: relative;
  z-index: 2;
  width: 100%;
  height: clamp(110px, 17vw, 220px);
  overflow: hidden;
  background: #000;
  filter: grayscale(1) contrast(1.08);
}

.hero-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 0;
  height: 100%;
  width: max-content;
  will-change: transform;
  animation: marquee 48s linear infinite;
}

.hero-clip {
  height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
  background: #111;
  flex-shrink: 0;
}

/* The track contains 2 identical sets of clips. Translating by -50%
   (one full set width) lands us back on a frame that looks identical
   to the start frame — provided the duplicate clips are kept in sync
   (handled in script.js). */
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-track { animation: none; }
}

/* ============================================================
   Hero caption — connected directly under EU SUNT MAX
   ============================================================ */
.hero-caption {
  font-size: 12.167px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
  text-align: center;
  margin: clamp(14px, 2.5vh, 28px) 0 0;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Scroll arrow — absolutely pinned to the bottom edge of the viewport */
.scroll-arrow {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3vh, 36px);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  color: #ffffff;
  opacity: 0.85;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   Projects (shared)
   ============================================================ */
.projects {
  margin-top: 80px;
  padding: 0 var(--col-pad) 80px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}

.project {
  display: flex;
  flex-direction: column;
  gap: 38px;
  position: relative;
}

.project-logo {
  width: 216px;
  height: auto;
  max-width: 100%;
}

.project-logo--astrazeneca {
  width: 216px;
}

.project-logo--mtdew {
  width: 124px;
  height: auto;
}

.project-text {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
  color: #ffffff;
}

.project-text p + p {
  margin-top: 1.1em;
}

.project-text ul {
  margin: 0.4em 0;
}

.project-text li {
  margin-bottom: 0.3em;
}

.project-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.project-heading {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #ffffff;
  line-height: 1.25;
  margin: 0;
}

.project-heading--lg {
  font-size: 26px;
  line-height: 1.1;
}

.project-heading--sm {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.meta-line {
  font-size: 16px;
  font-weight: 300;
  margin: 0;
}

.meta-line strong {
  font-weight: 600;
}

.meta-line--sm {
  font-size: 12px;
  font-weight: 600;
  margin-top: -0.6em;
}

.text-danger { color: #f44336; }
.text-success { color: #4cff00; }

/* ============================================================
   Media (clickable image / video tiles)
   ============================================================ */
.media {
  display: block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  position: relative;
  aspect-ratio: 356 / 179;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.media img,
.media .media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb {
  pointer-events: none;
}

.media:hover,
.media:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  outline: none;
}

.media--portrait {
  aspect-ratio: 480 / 848;
}

.media--portrait-img {
  aspect-ratio: 356 / 474;
}

.media--wide {
  aspect-ratio: 3326 / 1280;
}

.media--16x9 {
  aspect-ratio: 16 / 9;
}

.media--strip {
  aspect-ratio: 360 / 51;
}

/* Video placeholders */
.media--video,
.media[data-video-placeholder] {
  background: #0f0f12 linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 60%);
}

.video-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.video-cover svg {
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

/* ============================================================
   Badges (info / warning chips)
   ============================================================ */
.badges {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #1d1d1d;
  border: 1px solid #787878;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.4;
}

.badge svg {
  flex-shrink: 0;
}

.badge--warn {
  background: #28200f;
  border-color: #838048;
}

/* ============================================================
   CTA Button (Vezi full screen)
   ============================================================ */
.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background: #4f46e5;
  color: #f8fafc;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background 180ms ease, transform 120ms ease;
}

.btn-cta:hover,
.btn-cta:focus-visible {
  background: #4338ca;
  outline: none;
}

.btn-cta:active {
  transform: translateY(1px);
  background: #3730a3;
}

.btn-cta svg {
  flex-shrink: 0;
}

/* ============================================================
   Brand background (F1 swoosh on AstraZeneca / MtDew)
   ============================================================ */
.project--astrazeneca,
.project--mountain-dew {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.brand-bg {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 92%;
  max-width: 360px;
  height: 180px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  transform: translateX(-50%) rotate(-18.46deg);
  transform-origin: center;
}

.brand-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.7;
}

/* ============================================================
   About
   ============================================================ */
.about {
  position: relative;
  margin-top: 24px;
  padding-top: 78px;
}

.about-avatar {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -80px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #ffffff;
  padding: 8px;
  z-index: 2;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.about-card {
  background: #131313;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 92px 16px 32px;
  text-align: center;
}

.about-title {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1.3;
  margin: 0 0 24px 0;
  color: #ffffff;
}

.about-bio {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: #ffffff;
  margin: 0 0 1em 0;
}

.about-bio:last-child {
  margin-bottom: 0;
}

.about-bio--bold {
  font-weight: 600;
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100;
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 220ms ease;
  touch-action: none;
  overscroll-behavior: contain;
}

.lightbox[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-back {
  position: absolute;
  top: 29px;
  left: 23px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  z-index: 2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 180ms ease;
}

.lightbox-back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lightbox-img,
.lightbox-video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 0;
  display: block;
}

.lightbox-img[hidden],
.lightbox-video[hidden] { display: none; }

.lightbox-video {
  background: #000;
}

.lightbox-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: rgba(255, 255, 255, 0.65);
}

.lightbox-placeholder[hidden] { display: none; }

/* ============================================================
   Responsive — tablet & desktop
   The phone column scales up gracefully on larger screens
   ============================================================ */
@media (min-width: 600px) {
  :root {
    --phone-w: 480px;
    --phone-pad: 28px;
    --col-pad: 24px;
  }

  .topbar {
    padding-top: 40px;
    font-size: 13px;
  }

  .scroll-cue-text {
    font-size: 13px;
  }

  .projects {
    margin-top: 110px;
    gap: 120px;
  }

  .project {
    gap: 44px;
  }

  .project-heading {
    font-size: 28px;
  }

  .project-heading--lg {
    font-size: 30px;
  }

  .project-text {
    font-size: 17px;
  }

  .about-title {
    font-size: 38px;
  }

  .about-bio {
    font-size: 17px;
  }

  .about-avatar {
    width: 180px;
    height: 180px;
  }

  .about {
    padding-top: 90px;
  }

  .about-card {
    padding: 102px 24px 36px;
  }
}

/* ============================================================
   Desktop — keep the same centered phone-style column,
   just slightly wider and with bigger typography.
   ============================================================ */
@media (min-width: 900px) {
  :root {
    --phone-w: 560px;
    --phone-pad: 32px;
    --col-pad: 28px;
  }

  body {
    background:
      radial-gradient(ellipse at top, rgba(79, 70, 229, 0.06) 0%, transparent 55%),
      #0d0d0d;
    background-attachment: fixed;
  }

  .projects {
    gap: 140px;
  }

  .project-heading {
    font-size: 30px;
  }

  .about-title {
    font-size: 42px;
  }

  .about-avatar {
    width: 200px;
    height: 200px;
    margin-left: -100px;
  }

  .about {
    padding-top: 100px;
  }

  .about-card {
    padding: 112px 28px 40px;
  }
}

@media (min-width: 1200px) {
  :root {
    --phone-w: 640px;
  }
}

/* ============================================================
   Scroll reveal — IntersectionObserver toggles .is-visible
   Applied on every viewport.
   ============================================================ */
.reveal-text,
.reveal-media,
.reveal-pop {
  opacity: 0;
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-text   { transform: translateY(28px); }
.reveal-media  { transform: translateY(40px) scale(0.97); }
.reveal-pop    { transform: scale(0.9); }

.reveal-text.is-visible,
.reveal-media.is-visible,
.reveal-pop.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Custom cursor (pointer-fine devices only)
   ============================================================ */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 200ms ease, transform 120ms cubic-bezier(0.22, 1, 0.36, 1),
              width 220ms ease, height 220ms ease, background-color 220ms ease;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  margin: -3px 0 0 -3px;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid #ffffff;
  margin: -18px 0 0 -18px;
  transition-duration: 320ms;
}

.cursor-dot.is-active,
.cursor-ring.is-active {
  opacity: 1;
}

/* Hover state — over interactive things */
.cursor-ring.is-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(255, 255, 255, 0.08);
}

.cursor-dot.is-hover {
  width: 0;
  height: 0;
  margin: 0;
}

/* Hide custom cursor on touch devices — fall back to system cursor */
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring { display: none !important; }
}

/* On pointer-fine devices, hide the native cursor so only our custom one shows */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, [data-src], [data-video], [data-video-placeholder] { cursor: none; }
}

/* ============================================================
   Accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal-text,
  .reveal-media,
  .reveal-pop {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

:focus-visible {
  outline: 2px solid #7b61ff;
  outline-offset: 3px;
  border-radius: 4px;
}
