/* ==========================================================
   TOKENS — edit colours and per-breakpoint sizes here
   ========================================================== */
:root {
  --bg: #0C0C0C;
  --ice: #D7E2EA;
  --white: #FFFFFF;

  --radius: 40px;
  --pad-x: 1.25rem;
  --section-y: 5rem;
  --card-top: 6rem;
  --overlap: -2.5rem;

  --h1-size: 11vw;
  --h1-top: 1.5rem;
  --nav-size: .875rem;
  --portrait-w: 280px;
  --btn-pad: .75rem 2rem;
  --btn-size: .75rem;
  --live-size: .875rem;

  --about-gap: 4rem;
  --about-text-gap: 2.5rem;
  --services-title-gap: 4rem;
  --svc-pad: 2rem;

  --deco-edge-top: 1%;
  --deco-edge-bottom: 3%;
  --deco-a: 120px;
  --deco-b: 100px;
  --deco-c: 130px;
}
@media (min-width: 640px) {
  :root {
    --radius: 50px; --pad-x: 2rem; --section-y: 6rem; --overlap: -3rem;
    --h1-size: 12vw; --h1-top: 1rem; --portrait-w: 360px;
    --btn-pad: .875rem 2.5rem; --btn-size: .875rem; --live-size: 1rem;
    --about-gap: 5rem; --about-text-gap: 3.5rem; --services-title-gap: 5rem; --svc-pad: 2.5rem;
    --deco-edge-top: 2%; --deco-edge-bottom: 6%; --deco-a: 160px; --deco-b: 140px; --deco-c: 170px;
  }
}
@media (min-width: 768px) {
  :root {
    --radius: 60px; --pad-x: 2.5rem; --section-y: 8rem; --card-top: 8rem; --overlap: -3.5rem;
    --h1-size: 12.8vw; --h1-top: -1.25rem; --nav-size: 1.125rem; --portrait-w: 440px;
    --btn-pad: 1rem 3rem; --btn-size: 1rem;
    --about-gap: 6rem; --about-text-gap: 4rem; --services-title-gap: 7rem; --svc-pad: 3rem;
    --deco-edge-top: 4%; --deco-edge-bottom: 10%; --deco-a: 210px; --deco-b: 180px; --deco-c: 220px;
  }
}
@media (min-width: 1024px) {
  :root { --h1-size: 14vw; --nav-size: 1.4rem; --portrait-w: 520px; }
}

/* ==========================================================
   BASE
   ========================================================== */
html { scroll-behavior: smooth; }
section { scroll-margin-top: 1rem; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ice); font-family: 'Kanit', sans-serif; }
main { background: var(--bg); overflow-x: clip; }
img { display: block; }

.gradient-text {
  background: linear-gradient(180deg, #646973 0%, #BBCCD7 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-title {
  font-size: clamp(3rem, 12vw, 160px);
  font-weight: 900; text-transform: uppercase; text-align: center;
  line-height: 1; letter-spacing: -.025em;
}
.number { font-size: clamp(3rem, 10vw, 140px); font-weight: 900; line-height: 1; }

/* Fade-in: tweak per element with --x, --y, --delay, --duration */
.fade {
  opacity: 0;
  transform: translate(var(--x, 0), var(--y, 30px));
  transition: opacity var(--duration, .7s) cubic-bezier(.25, .1, .25, 1) var(--delay, 0s),
              transform var(--duration, .7s) cubic-bezier(.25, .1, .25, 1) var(--delay, 0s);
}
.fade.is-visible { opacity: 1; transform: none; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none; white-space: nowrap;
  font: 500 var(--btn-size) 'Kanit', sans-serif; text-transform: uppercase; letter-spacing: .1em;
  padding: var(--btn-pad); border-radius: 9999px;
}
.btn--contact {
  color: var(--white); border: 0;
  background: linear-gradient(123deg, #18011F 7%, #B600A8 37%, #7621B0 72%, #BE4C00 100%);
  box-shadow: 0 4px 4px rgba(181, 1, 167, .25), 4px 4px 12px #7721B1 inset;
  outline: 2px solid var(--white); outline-offset: -3px;
}
.btn--live {
  color: var(--ice); background: none; border: 2px solid var(--ice);
  font-size: var(--live-size); transition: background .2s;
}
.btn--live:hover { background: rgba(215, 226, 234, .1); }

/* ==========================================================
   HERO
   ========================================================== */
.hero { position: relative; height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
.hero nav { position: relative; z-index: 30; display: flex; justify-content: space-between; padding: 1.5rem var(--pad-x) 0; }
.hero nav a {
  color: var(--ice); text-decoration: none; font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; font-size: var(--nav-size); transition: opacity .2s;
}
.hero nav a:hover { opacity: .7; }
.hero__title-wrap { width: 100%; overflow: hidden; margin-top: var(--h1-top); }
.hero h1 {
  width: 100%; text-align: center; white-space: nowrap; font-size: var(--h1-size);
  font-weight: 900; text-transform: uppercase; line-height: 1; letter-spacing: -.025em;
}
.hero__portrait {
  position: absolute; z-index: 10; left: 50%; top: 50%; width: var(--portrait-w);
  transform: translate(-50%, -50%);
}
.hero__portrait img { width: 100%; }
@media (min-width: 640px) {
  .hero__portrait { top: auto; bottom: 0; transform: translateX(-50%); }
}
.magnet {
  will-change: transform; -webkit-user-drag: none; user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: none;            /* a finger on the portrait drags it instead of scrolling the page */
  cursor: grab; -webkit-touch-callout: none;
}
.magnet.is-dragging { cursor: grabbing; }
.magnet img { pointer-events: none; -webkit-user-drag: none; }
.hero__bottom {
  position: relative; z-index: 20; margin-top: auto;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 var(--pad-x) 1.75rem;
}
.hero__bottom p {
  max-width: 160px; font-size: clamp(.75rem, 1.4vw, 1.5rem);
  font-weight: 300; text-transform: uppercase; letter-spacing: .025em; line-height: 1.25;
}
@media (min-width: 640px) { .hero__bottom { padding-bottom: 2rem; }   .hero__bottom p { max-width: 220px; } }
@media (min-width: 768px) { .hero__bottom { padding-bottom: 2.5rem; } .hero__bottom p { max-width: 260px; } }

/* ==========================================================
   MARQUEE
   ========================================================== */
.marquee {
  overflow: hidden; padding: 6rem 0 2.5rem;
  cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;           /* up/down scrolls the page, sideways drags the tiles */
}
.marquee.is-dragging { cursor: grabbing; }
@media (min-width: 640px) { .marquee { padding-top: 8rem; } }
@media (min-width: 768px) { .marquee { padding-top: 10rem; } }
.marquee__row { min-height: calc(var(--tile-w, 420px) * 9 / 16); display: flex; gap: var(--tile-gap, 12px); width: max-content; will-change: transform; }
.marquee__row + .marquee__row { margin-top: var(--tile-gap, 12px); }
.marquee__site {
  position: relative; flex: none; width: var(--tile-w, 420px); aspect-ratio: 16 / 9;
  border-radius: 1rem; overflow: hidden; background: #0D0A22;
}
/* the site renders at a full 1440x810 (16:9) screen, then scales down to fit the 420px tile,
   so nothing is cropped */
.marquee__site iframe {
  position: absolute; top: 0; left: 0; width: 1440px; height: 810px; border: 0;
  transform: scale(var(--tile-scale, .2917)); transform-origin: 0 0; pointer-events: none;
}
.marquee__row img {
  background: #141414; flex: none; width: var(--tile-w, 420px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: 1rem;
  pointer-events: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
/* tiles show a soft shimmer until their picture has arrived, then fade in */
.marquee__row img:not(.is-loaded) { background: linear-gradient(100deg, #141414 30%, #232323 50%, #141414 70%) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.marquee__row img.is-loaded { animation: tileIn .3s ease-out; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes tileIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .marquee__row img:not(.is-loaded), .marquee__row img.is-loaded { animation: none; } }

/* ==========================================================
   ABOUT
   ========================================================== */
.about {
  position: relative; min-height: 100vh; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--about-gap); padding: 5rem var(--pad-x);
}
.about__text { display: flex; flex-direction: column; align-items: center; gap: var(--about-text-gap); }
.about__copy { max-width: 560px; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 500; line-height: 1.625; }
.about__copy .word { display: inline-block; white-space: nowrap; }

.deco { position: absolute; }
.deco--moon  { top: 4%;    left: var(--deco-edge-top);     width: var(--deco-a); }
.deco--lego  { top: 4%;    right: var(--deco-edge-top);    width: var(--deco-a); }
.deco--obj   { bottom: 8%; left: var(--deco-edge-bottom);  width: var(--deco-b); }
.deco--group { bottom: 8%; right: var(--deco-edge-bottom); width: var(--deco-c); }

/* ==========================================================
   SERVICES
   ========================================================== */
.services {
  background: var(--white); color: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0; padding: var(--section-y) var(--pad-x);
}
.services .section-title { margin-bottom: var(--services-title-gap); }
.services__list { max-width: 64rem; margin: 0 auto; }
.service {
  display: flex; align-items: flex-start; gap: clamp(1rem, 3vw, 3rem);
  padding: var(--svc-pad) 0; border-top: 1px solid rgba(12, 12, 12, .15);
}
.service:last-child { border-bottom: 1px solid rgba(12, 12, 12, .15); }
.service .number { flex: none; width: 1.75em; } /* keeps every title lined up */
.service h3 { margin-bottom: .5rem; font-size: clamp(1rem, 2.2vw, 2.1rem); font-weight: 500; text-transform: uppercase; }
.service p { max-width: 42rem; font-size: clamp(.85rem, 1.6vw, 1.25rem); font-weight: 300; line-height: 1.625; opacity: .6; }

/* ==========================================================
   PROJECTS (sticky stacking cards)
   ========================================================== */
.projects {
  position: relative; z-index: 10; margin-top: var(--overlap);
  background: var(--bg); border-radius: var(--radius) var(--radius) 0 0;
  padding: var(--section-y) var(--pad-x) 6rem;
}
.projects .section-title { margin-bottom: 3rem; }
.projects__stack { max-width: 80rem; margin: 0 auto; }
.project-slot { height: 85vh; }
.project {
  position: sticky; top: calc(var(--card-top) + var(--i) * 28px);
  padding: calc(var(--radius) / 2.5); border: 2px solid var(--ice);
  border-radius: var(--radius); background: var(--bg);
  transform-origin: top center; will-change: transform;
}
.project__head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1rem; padding: 0 .5rem; }
.project__meta { flex: 1; min-width: 140px; }
.project__category { font-size: .8rem; font-weight: 300; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.project__name { font-size: clamp(1.1rem, 2.4vw, 2.2rem); font-weight: 500; text-transform: uppercase; }
.project__grid { display: grid; grid-template-columns: 40fr 60fr; gap: .75rem; }
.project__col { display: flex; flex-direction: column; gap: .75rem; }
.project__grid img { width: 100%; object-fit: cover; border-radius: var(--radius); }
.project__col:first-child img:first-child { height: clamp(130px, 16vw, 230px); }
.project__col:first-child img:last-child  { height: clamp(160px, 22vw, 340px); }
.project__col:last-child img { height: 100%; min-height: 200px; }

/* ==========================================================
   CONTACT
   ========================================================== */
.contact {
  display: flex; flex-direction: column; align-items: center; gap: 2rem; text-align: center;
  padding: 5rem var(--pad-x) 6rem;
}
.contact p { max-width: 32rem; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 300; line-height: 1.6; }

/* 'fit' variant: right image keeps its natural shape (no cropping);
   the left images stretch to match its height */
.project--fit .project__grid { align-items: stretch; }
.project--fit .project__col:last-child img { height: auto; min-height: 0; }
.project--fit .project__col:first-child { min-height: 0; }
.project--fit .project__col:first-child img { flex: 1 1 0; height: 0; min-height: 0; }

.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.btn--icon { display: inline-flex; align-items: center; gap: .6rem; }
.btn--icon svg { width: 1.4em; height: 1.4em; flex: none; }

/* contact form (Web3Forms) */
.contact__form { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: 100%; max-width: 36rem; }
.contact__form input[type="text"], .contact__form input[type="email"], .contact__form textarea {
  width: 100%; padding: 1rem 1.5rem; color: var(--ice); background: rgba(215, 226, 234, .04);
  border: 1px solid rgba(215, 226, 234, .35); border-radius: 9999px;
  font: 400 1rem 'Kanit', sans-serif; outline: none; transition: border-color .2s, background .2s;
}
.contact__form textarea { border-radius: 1.5rem; resize: vertical; min-height: 9rem; }
.contact__form ::placeholder { color: rgba(215, 226, 234, .5); }
.contact__form input:focus, .contact__form textarea:focus { border-color: var(--ice); background: rgba(215, 226, 234, .08); }
.contact__trap { position: absolute; left: -9999px; opacity: 0; }   /* spam trap, keep hidden */
.contact__status { font-size: 1rem; }
.contact__status:empty { display: none; }   /* no gap until a message is shown */
.contact__form + .contact__actions { margin-top: -1rem; }   /* WhatsApp sits right under Send, same gap as the fields */
.contact__status.is-ok { color: rgba(255, 255, 255, .87); }
.contact__status.is-error { color: #f87171; }
.contact__form button:disabled { opacity: .6; cursor: wait; }
