/* Automatic Dark / Light Mode based on User's Browser/OS */
:root {
  --bg: #0a0a0b;
  --surface: #131315;
  --ink: #f4f1ea;
  --muted: #98948c;
  --border: rgba(244, 241, 234, 0.14);
  --accent: #ff3b00;
  --header-h: 64px;

  --font-display: "Syne", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f1ea;
    --surface: #e9e4d9;
    --ink: #0a0a0b;
    --muted: #58544d;
    --border: rgba(10, 10, 11, 0.16);
    --accent: #ff3b00;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Important: keeps sticky headers working while grain scrolls with page */
.page-wrapper {
  position: relative;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1400px, 94%);
  margin: 0 auto;
}

.accent {
  color: var(--accent);
}

.mono-muted {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Liquid Glass Top Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: linear-gradient(
    180deg,
    rgba(24, 24, 28, 0.62) 0%,
    rgba(12, 12, 14, 0.46) 100%
  );
  -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.08);
  backdrop-filter: blur(24px) saturate(190%) brightness(1.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 10px 30px rgba(0, 0, 0, 0.28);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.22s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* HERO (Full first screen with ticker pinned at bottom) */
.hero {
  height: calc(100vh - var(--header-h));
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-stage {
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: 0 0 0 max(3%, calc((100vw - 1400px) / 2));
}

.hero-copy {
  align-self: center;
  padding: 2rem 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 6.8vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 0 0 1.6rem;
  text-transform: uppercase;
}

.hero-title > span {
  display: block;
}

/* Clean outline text (fixes Syne overlapping internal paths) */
.outline-text {
  color: var(--bg);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  max-width: 50ch;
  margin: 0 0 2rem;
  color: var(--muted);
}

.hero-lead strong {
  color: var(--ink);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-visual {
  height: 100%;
  min-height: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.hero-photo-wrap {
  height: 100%;
  width: auto;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.hero-photo {
  height: 100%;
  width: auto;
  max-width: 42vw;
  display: block;
  object-fit: contain;
  object-position: bottom right;
  /* Soft feather on BOTH the bottom edge and the left edge */
  -webkit-mask-image:
    linear-gradient(to bottom, #000 68%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 18%, #000 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, #000 68%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 18%, #000 100%);
  mask-composite: intersect;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.95rem 1.4rem;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
}

/* Sections + Sticky Section Headers */
.section {
  position: relative;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5rem;
}

.section-alt {
  background: var(--surface);
}

.sticky-head {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  padding: 1.35rem 0;
  background: linear-gradient(
    180deg,
    rgba(28, 28, 32, 0.52) 0%,
    rgba(14, 14, 16, 0.38) 100%
  );
  -webkit-backdrop-filter: blur(22px) saturate(185%) brightness(1.06);
  backdrop-filter: blur(22px) saturate(185%) brightness(1.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 28px rgba(0, 0, 0, 0.22);
}

.section-alt .sticky-head {
  background: linear-gradient(
    180deg,
    rgba(32, 32, 36, 0.56) 0%,
    rgba(18, 18, 21, 0.42) 100%
  );
}

/* Automatic Light Mode Liquid Glass */
@media (prefers-color-scheme: light) {
  .site-header {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.68) 0%,
      rgba(244, 241, 234, 0.48) 100%
    );
    -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.04);
    backdrop-filter: blur(24px) saturate(190%) brightness(1.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      inset 0 -1px 0 rgba(10, 10, 11, 0.08),
      0 8px 24px rgba(10, 10, 11, 0.08);
  }

  .sticky-head,
  .section-alt .sticky-head {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.58) 0%,
      rgba(244, 241, 234, 0.42) 100%
    );
    border-bottom: 1px solid rgba(10, 10, 11, 0.1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.8),
      0 10px 24px rgba(10, 10, 11, 0.06);
  }
}

.sticky-head-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.section-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  text-transform: uppercase;
}

.section-sub {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-body {
  padding-top: 2.75rem;
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 0.45rem;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Video Grids (Separated cleanly by 16:9 Long-Form and 9:16 Shorts) */
.video-group + .video-group {
  margin-top: 3rem;
}

.video-group-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.video-grid-short {
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.video-card[data-type="short"] .video-thumb-wrap {
  aspect-ratio: 9 / 16;
}

.video-card {
  position: relative;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  z-index: 1;
}

.video-card:hover {
  transform: scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.video-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--border);
}

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

.hover-player {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
}

.hover-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

/* Transparent overlay ensures clicking the hovering preview opens the full modal */
.video-click-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.play-badge {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
}

.video-meta {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.video-meta-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
}

.video-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.video-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Process */
.process-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.process-card {
  padding: 2rem;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.2s ease;
}

.process-card:hover {
  border-color: var(--accent);
}

.step-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: 0.85rem;
}

.process-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.65rem;
}

.process-card p {
  margin: 0;
  color: var(--muted);
}

.process-card strong {
  color: var(--ink);
}

/* Graphics Grouped & Adaptive */
.gallery-group + .gallery-group {
  margin-top: 3.25rem;
}

.gallery-group-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Auto-Aligned Justified Gallery (edge-to-edge rows, equal height, any ratio, any count) */
.posts-masonry {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: stretch;
}

.posts-masonry .graphic-card {
  display: flex;
  flex-direction: column;
  flex: var(--ar, 1) 1 calc(var(--ar, 1) * 260px);
  max-width: calc(var(--ar, 1) * 420px);
  min-width: 0;
  margin: 0;
}

.posts-masonry .protected-media {
  width: 100%;
  height: auto;
  background: #000;
}

.posts-masonry .protected-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.posts-masonry .graphic-caption {
  width: 100%;
  white-space: nowrap;
}

.posts-masonry .graphic-caption strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.graphic-card {
  border: 1px solid var(--border);
  background: var(--surface);
}

.protected-media {
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.protected-canvas {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.media-shield {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.graphic-caption {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

/* Toolkit & Experience */
.sub-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin: 0 0 1.25rem;
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.software-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

.sw-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid currentColor;
}

.sw-pr { color: #9999ff; background: rgba(153, 153, 255, 0.1); }
.sw-ae { color: #d291ff; background: rgba(210, 145, 255, 0.1); }
.sw-dr { color: #ff6b4a; background: rgba(255, 107, 74, 0.1); }
.sw-ps { color: #31a8ff; background: rgba(49, 168, 255, 0.1); }

.software-card h4 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.software-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.software-card strong {
  color: var(--ink);
}

.exp-list {
  display: grid;
  gap: 1.25rem;
}

.exp-item {
  padding: 1.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

.exp-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.exp-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Centered Contact Stage — fills the full screen so Section 04 scrolls completely away */
.contact-stage {
  min-height: calc(100vh - var(--header-h) - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-bottom: 1px solid var(--border);
  padding: 4rem 0;
  scroll-margin-top: var(--header-h);
}

.contact-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.5vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0.5rem 0 2.5rem;
  text-transform: uppercase;
}

.social-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.social-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.social-icon svg {
  width: 22px;
  height: 22px;
}

.social-icon:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

/* Footer */
.site-footer {
  padding: 1.6rem 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-cv-link {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  z-index: 2;
  width: min(940px, 100%);
  background: #111113;
  color: #f4f1ea;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.modal-dialog.is-short {
  width: min(400px, 100%);
}

.modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-ext {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.modal-frame-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-dialog.is-short .modal-frame-wrap {
  aspect-ratio: 9 / 16;
}

.modal-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .hero {
    height: auto;
    min-height: calc(100vh - var(--header-h));
  }
  .hero-stage {
    width: 92%;
    margin: 0 auto;
    padding: 2rem 0 0;
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-copy {
    padding: 0;
  }
  .hero-visual {
    height: auto;
    justify-content: center;
  }
  .hero-photo-wrap {
    height: auto;
    width: min(380px, 90%);
  }
  .hero-photo {
    height: auto;
    width: 100%;
    max-width: 100%;
  }
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-grid-short {
    grid-template-columns: repeat(3, 1fr);
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .video-grid,
  .process-grid,
  .thumbs-grid,
  .software-grid {
    grid-template-columns: 1fr;
  }
  .video-grid-short {
    grid-template-columns: repeat(2, 1fr);
  }
  .posts-masonry .graphic-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}