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

html {
  scroll-behavior: smooth;
}

html, body {
  height: auto !important;
  overflow-y: auto !important;
}

body {
  font-size: 16px;
  font-family: var(--font-sans);
  font-weight: 300;
  margin:0;
}


/* Unlock scrolling for intro page */
.intro-layout {
  height: auto !important;
  overflow-y: auto !important;
}
body.intro-layout .section {
  height: auto;
  min-height: auto;
}
body.intro-layout .page-main {
  height: auto;
}

.intro-layout #content-rail {
  transform: none !important;
}

/* Kill desktop scroll lock override */
@media (hover: hover) and (pointer: fine) {
  body.intro-layout {
    overflow: auto;
  }
}

/* =========================
COMPONENTS
========================= */

.intro-layout .global-header {
  position: relative; /* required */
  width: 100svw;
}

.intro-layout .global-header::after {
  content: "";
  position: relative;
  left: 0;
  top: 0;
  width: 100%;
  height: 40px;
  
  pointer-events: none; /* important so it doesn't block clicks */
  
  background: linear-gradient(
  to bottom,
  rgba(255, 255, 255, 1),
  rgba(255, 255, 255, 0)
  );
}

.intro-layout .project-card img {
  /*width: 100%;
  height: 100%;
  */
  width: 400px;
  height: 300px;
  aspect-ratio: 4 / 3;
}

.intro-layout #project-list {
  height: auto !important;
  overflow: visible !important;
}

/* Prevent profile component flicker on index page load */

.intro-layout .profile {
  opacity: 0;
}

.profile.is-visible {
  opacity: 1;
  pointer-events: auto;
}


/* =========================
PATTERNS
========================= */

.intro-meta {
  color:#949494;
  margin: 0;
}

.intro-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.intro-description {
  font-size: var(--type-body-lg);
  font-weight: 200;
}

.stack-group {
  display: inline-flex;
}

.stack {
  display: inline;
  font-family: var(--font-sans);
  font-size: var(--type-hero);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  position: relative;
  z-index: 1;
}

.stack-group + .stack-group {
  margin-left: 0.5ch; /* real word space */
}

.accent-stack {
  flex: 0 0 100%; /* new line in wrap container */
  
  font-family: var(--font-serif-text);
  font-size: var(--type-hero-accent);
  font-style: italic;
  font-weight: 400;
  color: #ff4f87;
  text-transform: lowercase;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-script);
  margin-right: 15px;
  z-index: 2;
}

.intro-layout .about .heading--display .heading-accent {
  font-size: calc(var(--type-display) * 1);
}


/* =========================
VERTICAL CONTAINERS
========================= */

/* BEGIN // Main.css overrides */
.intro-layout .page-main {
  display: block;
  padding: 125px 40px 0;
}

.intro-layout .projects-wrapper--column #project-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-4);
}

.intro-layout .project-card .section-heading, 
.layer-3 .section-heading {
  flex-direction: row;
}



.intro-layout .global-header {
  position: fixed;
  top:0;
  left: 0;
  /*
  top: var(--frame-pad);
  left: var(--frame-pad);
  */
  right: var(--frame-pad);
  height: 140px;
  z-index: 100;
  
  /* THIS is the key */
  display: flex;
  place-items: center;
  flex-direction: column;
}

/* TODO: Move and merge to components.css */
.intro-layout .global-header .header-inner {
  width: 100%;              /* fill the frame */
  padding: var(--gap-2) 4vw;          /* your internal spacing */
  display: flex;
  justify-content: space-between;
  align-items: end;
  background-color: #fff;
}


.intro-layout .intro-hide {
  display: none;
}
body.show-section-nav .intro-hide {
  display: block;
}

.intro-layout .content-flow {
  padding-top: var(--gap-5);
}

@media (max-width:480px) {
  .intro-layout .content-flow {
    padding-top: 0;
  }
}

.intro-layout .section {
  scroll-margin-top: 160px;
  padding-bottom: 80px;
}


.intro-layout section > .container {
  display: block;         /* kills grid behavior from main.css */
  align-items: initial;    /* reset */
  place-items: initial;    /* reset */
}

.intro-stage {
  position: relative;
  min-height: 80dvh;
  
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Intro section */
.intro-top {
  padding-bottom: 80px;
  margin:0;
}

.intro-middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  flex: 1; /* fills available height */
}

.intro-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  
  /* Intro middle child constraints */
  flex: 1;
  max-width: 560px;
  margin-top: -40px; /* subtle lift */
}
.intro-buttons {
  display: flex;
  gap: 20px;
  align-items: center;
}




.intro-bottom {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.intro-logo {
  width: 120px;
  opacity: 0.15;
  padding-bottom: 10px;
}

.content-flow {
  display: flex;
  flex-direction: column;
  gap: var(--gap-5);
}

.intro-layout .about {
  display: grid;
  grid-template-columns: 1fr; /* single column */
  grid-template-rows: auto auto;
  /*gap: var(--gap-3);*/
}

.intro-layout .about p {
  max-width: 60ch;
}

.intro-layout .about p {
  padding: 0;
}

.media {
  gap: 0;
}

/* =========================
COMPONENTS
========================= */

/* PRIMARY BUTTON */
.primary-btn.intro {
  padding: 10px 40px;
  font-size: 1.5rem;
  display: inline-block;
}


/* HERO VISUAL */

/* visual container */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  position: relative;
  max-width: 900px;
  
  /* Prevent stacking bugs if anything looks wrong:
  .hero-visual {
  isolation: isolate;
  }
  */
}
.hero-visual::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  
  height: 120px;
  
  background: linear-gradient(
  to bottom,
  rgba(255,255,255,0) 0%,
  rgba(255,255,255,1) 100%
  );
  
  z-index: 3; /* ← add this */
  
  pointer-events: none;
}

.mockup-base {
  width: 100%;
  height: auto;
  display: block;
  z-index: 2;
}

/* mockup overlay screen container */
.screen {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  
  /* border: 1px solid red; [debugging] */
}
/* Laptop screen */
.screen--laptop {
  top: 0.011428574%;
  left: 0.714285714%;
  width: 57.1428571%;
  height: 68.4782609%;
}
/* Stagger image animation */
.screen--laptop img:nth-child(1) {
  animation: fadeCycle 9s infinite;
}

.screen--laptop img:nth-child(2) {
  animation: fadeCycle 9s infinite;
  animation-delay: 3s;
}

.screen--laptop img:nth-child(3) {
  animation: fadeCycle 9s infinite;
  animation-delay: 6s;
}

/* Phone screen */
.screen--phone {
  top: 23.714286%;
  right: 1.15%;
  width: 16.4736842%;
  height: 39.1304348%;
}
/* Stagger image animation */
.screen--phone img:nth-child(1) {
  animation: fadeCycle 9s infinite;
}

.screen--phone img:nth-child(2) {
  animation: fadeCycle 9s infinite;
  animation-delay: 3s;
}

.screen--phone img:nth-child(3) {
  animation: fadeCycle 9s infinite;
  animation-delay: 6s;
}

/* Screen content */
.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  
  opacity: 0;
}

/* Fade animation */
@keyframes fadeCycle {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  30%  { opacity: 1; }
  35%  { opacity: 0; }
  100% { opacity: 0; }
}



/* =========================
WORK FEATURE - (LANDING PAGE ONLY)
===================== */

.intro-layout .work-feature {
  display: flex;
  min-height: 80vh;
  align-items: center;
  gap: 48px;
  
  margin-bottom: 80px;
  
  /* Initial state */
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

/* When visible */
.intro-layout .work-feature.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.intro-layout .work-feature__copy {
  flex: 0 0 35%;
  max-width: 420px;
  
  display: flex;
  flex-direction: column;
  gap: 16px;
  
  z-index: 2;
}

.intro-layout p.work-feature__impact {
  margin: 0;
}

.intro-layout .work-feature__media {
  flex: 1;
  display: flex;
  align-items: center;
  
  justify-content: flex-end; /* default: push to right */
  /*justify-content: flex-start;*/ /* or end depending on layout */
}

.intro-layout .work-feature.right-mode .work-feature__media {
  justify-content: flex-start;
}

.intro-layout .work-feature__media img {
  width: auto;
  height: auto;
  max-height: 100vh; /* THIS is your guardrail */
  
  border-radius: 16px;
  overflow: hidden;
  /*box-shadow: 0 20px 60px rgba(0,0,0,0.08);*/ /* causing white background behind transparent images */
}

.intro-layout .work .container {
  overflow: visible; /* Allow breakout (prevent clipping) */
}

.intro-layout .work-feature.right-mode {
  flex-direction: row-reverse;
}

/* PAYMENTS → wide system UI should feel expansive */
.feature--payments .work-feature__media img {
  max-width: 900px;
  transform: scale(1.15);
}

.feature--payments .work-feature__media {
  overflow: visible;
}

.feature--payments img {
  margin-right: -80px;
}

/* PRIVACY → component needs punch (not tiny card) */
.feature--privacy .work-feature__media img {
  max-width: 800px;
  transform: scale(1.2);
}

.feature--privacy .work-feature__media {
  align-items: center;
  gap: 40px;
}

.feature--privacy img {
  object-fit: contain;
}

@media (max-width:480px) {
  .feature--payments .work-feature__media {
    width: 80svw;
    height: 500px;
    object-fit: cover;
    border-radius: 24px;
    padding: 0;
    margin: 30px 0 0;
    margin-left: 0px;
    overflow: hidden;
    
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 5px rgba(0, 0, 0, 0.06), 0 1px 10px rgba(0, 0, 0, 0.10);
  }
  
  .feature--payments .work-feature__media img {
    height: 500px;
    object-fit: cover;
    display: block;
    position: relative;
    margin: -30px 0 0;
    object-position: -600px;
  }
}

/* =========================
BREAKPOINT QUERIES
========================= */

@media (max-width: 768px) {
  .frame {
    border: 12px solid #d9d9d9;
  }
  
  .intro-stage {
    gap: 80px;
  }
  
  .intro-middle {
    gap: 32px;
  }
  
  .intro-title {
    flex-direction: column;
  }
  
  
  .stack-group {
    flex-direction: column;
  }
  
  .intro-description {
    max-width: 30ch;
  }
  
  .primary-btn {
    width: 100%;
    text-align: center;
  }
  
  .intro-bottom img {
    display: none;
  }
  
  .intro-middle {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero-visual {
    display: none; /* or stack later if needed */
  }
  
  .intro-layout .intro-middle {
    margin-top: auto;
    margin-bottom: auto;
  }
  .intro-layout .global-header {
    width: calc(100dvw - var(--frame-thickness) *2 );
  }  
  .intro-layout .global-header .header-inner {
    align-items: center;
    flex-direction: column;
  }  
  .intro-layout .section {
    padding-bottom: 0;
  }
  .intro-layout #work {
    margin-top: 130px;
  }
  .intro-layout .work {
    padding-top: 0;
  }
  .intro-layout .project-card .section-heading, 
  .layer-3 .section-heading {
    flex-direction: row;
    --heading-main-size: 1.75rem;
    --heading-accent-size: 1.6875rem;
  }
  .intro-layout section.services {
    padding-top: 0 !important;
  }
  .intro-layout .intro-buttons {
    flex-direction: column;
  }
  .intro-layout .section:last-of-type {
    padding-bottom: 0;
  }
}



@media (max-width: 480px) {
  .intro-top {
    padding-bottom: 20px;
  }
  .intro-stage {
    padding: 20px;
  }
  
  .intro-stage .heading--display .heading-main {
    font-size: 50px !important;
  }

  .intro-layout .section-callout {
    display: none;
  }
  
  .intro-layout .global-header {
    width: 100%;
    height: auto;
  }
  
  .intro-layout .global-nav__button span {
    display: none;
  }
  
  .intro-layout .global-nav__button {
    width: auto;
  }
  
  .intro-layout .global-links {
    flex-direction: row;
  }
  
  .intro-layout .page-main {
    padding: 170px 20px 0;
  }
  
  .intro-description {
    font-size: 24px;
    line-height: 27px;
    margin: 0.3rem 0 2rem 0;
  }
  
  .intro-layout .section > .container {
    padding: 20px;
  }

  .intro-layout .work .layout-section-header {
    padding-bottom: 100px;
  }
  
  .intro-layout .work-feature {
    gap: 0;
  }
  
  .intro-layout .work-feature.right-mode {
    flex-direction: column;
  }
  
  .intro-layout .work-feature {
    flex-direction: column;
  }
  
  /*.feature--payments .work-feature__media img {
  
  }*/
}

