/* ============================================================
   Palai Tech - landing page
   Design tokens and layout transcribed from the design handoff.
   ============================================================ */

:root {
  /* Themeable ------------------------------------------------ */
  --pt-accent: #EF4E23;          /* alternatives: #F6A21E #D9482B #B4551E */
  --pt-marquee-duration: 28s;    /* range 10s-60s */

  /* Surfaces */
  --pt-bg: #FBF4EA;
  --pt-bg-alt: #FDF8F0;
  --pt-card: #FFFDF9;
  --pt-ink: #1E1B18;
  --pt-chip: #F4EADC;

  /* Text */
  --pt-amber: #F6A21E;
  --pt-muted: #5C534A;
  --pt-faint: #8A7D6F;
  --pt-index: #C9BBAB;
  --pt-cream: #FFF7EC;
  --pt-on-dark: #CBBFB2;
  --pt-on-dark-strong: #E8DDD1;

  /* Lines */
  --pt-border: rgba(30, 27, 24, 0.08);
  --pt-border-strong: rgba(30, 27, 24, 0.16);
  --pt-rule: rgba(30, 27, 24, 0.1);

  /* Layout: 1180px of content plus 32px of breathing room either side.
     Everything here is border-box, so a padded container caps at
     content + padding. */
  --pt-max: 1180px;
  --pt-pad: 32px;
  --pt-container: 1244px;        /* 1180 + 2 x 32 */
  --pt-container-narrow: 784px;  /* contact column: 720 + 2 x 32 */

  --pt-grad: linear-gradient(135deg, var(--pt-amber), var(--pt-accent));
}

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

html {
  scroll-behavior: smooth;
  /* The page ends on the dark footer. Match the canvas to it and switch off
     rubber-banding, so no light strip can flash below the footer when a
     browser over-scrolls past the end (macOS / iOS). */
  background: var(--pt-ink);
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--pt-bg);
  color: var(--pt-ink);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pt-ink); text-decoration: none; }
a:hover { color: var(--pt-accent); }

/* Anchor jumps must clear the sticky header, or it sits on top of each
   section's eyebrow. Slightly more than the header's 73px, for air. */
section[id] { scroll-margin-top: 88px; }
#top { scroll-margin-top: 0; }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--pt-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Shared bits ------------------------------------------------ */

.h2 {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow-accent { color: var(--pt-accent); }
.eyebrow-amber  { color: var(--pt-amber); }
.eyebrow-faint  { color: var(--pt-faint); }
.eyebrow-center { text-align: center; }

.pill {
  display: inline-block;
  border-radius: 99px;
  font-weight: 700;
  white-space: nowrap;
}
.pill-dark {
  background: var(--pt-ink);
  color: var(--pt-cream);
  padding: 10px 20px;
  font-weight: 500;
}
.pill-dark:hover { background: var(--pt-accent); color: var(--pt-cream); }
.pill-lg { padding: 16px 34px; font-size: 16px; font-weight: 700; }
.pill-grad {
  background: var(--pt-grad);
  color: var(--pt-cream);
  padding: 13px 26px;
  font-size: 15px;
}
.pill-grad:hover { filter: brightness(1.06); color: var(--pt-cream); }

/* -- Header -------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 244, 234, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pt-border);
}

.header-inner {
  max-width: var(--pt-container);
  margin: 0 auto;
  padding: 16px var(--pt-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 38px; width: auto; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
/* Pads the links out to the pill's height so touch targets are not 20px
   tall. The pill already sets the row height, so the header does not grow. */
.nav a:not(.pill) { padding: 10px 0; }

/* -- Hero ---------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 110px var(--pt-pad) 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(30, 27, 24, 0.13) 1.5px, transparent 1.5px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000, transparent 78%);
}

/* Mini-planet dots: each orbits its own radius (--r) at its own tempo. */
.orbit {
  position: absolute;
  border-radius: 99px;
  animation: pt-orbit var(--d) linear infinite;
}
.orbit-1 { top: 110px;    left: 13%;  width: 12px; height: 12px; background: var(--pt-accent); --r: 34px; --d: 9s; }
.orbit-2 { top: 210px;    right: 16%; width: 9px;  height: 9px;  background: var(--pt-amber);  --r: 26px; --d: 12s; animation-direction: reverse; }
.orbit-3 { bottom: 130px; left: 23%;  width: 8px;  height: 8px;  background: var(--pt-ink); opacity: 0.5; --r: 22px; --d: 14s; }
.orbit-4 { top: 70px;     right: 27%; width: 7px;  height: 7px;  background: var(--pt-accent); opacity: 0.7; --r: 18px; --d: 10s; animation-direction: reverse; }
.orbit-5 { bottom: 90px;  right: 13%; width: 11px; height: 11px; background: var(--pt-amber);  --r: 30px; --d: 16s; }
.orbit-6 { top: 300px;    left: 9%;   width: 6px;  height: 6px;  background: var(--pt-ink); opacity: 0.4; --r: 16px; --d: 11s; animation-direction: reverse; }
.orbit-7 { bottom: 200px; left: 7%;   width: 9px;  height: 9px;  background: var(--pt-accent); opacity: 0.6; --r: 24px; --d: 13s; }

@keyframes pt-orbit {
  from { transform: rotate(0)      translateX(var(--r)) rotate(0); }
  to   { transform: rotate(360deg) translateX(var(--r)) rotate(-360deg); }
}

.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--pt-border-strong);
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pt-muted);
  background: var(--pt-card);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #22B24C;
  animation: pt-blink 1.6s ease-in-out infinite;
}

@keyframes pt-blink {
  0%, 100% { opacity: 1;    box-shadow: 0 0 0 0 rgba(34, 178, 76, 0.5); }
  50%      { opacity: 0.55; box-shadow: 0 0 0 5px rgba(34, 178, 76, 0); }
}

.hero-title {
  position: relative;
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 84px;
  line-height: 1;
  letter-spacing: -0.04em;
  max-width: 14ch;
  text-wrap: balance;
}

.grad {
  background: linear-gradient(90deg, var(--pt-amber), var(--pt-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  position: relative;
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--pt-muted);
  max-width: 50ch;
  text-wrap: pretty;
}

.hero-ctas {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
}

.link-cta {
  padding: 16px 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--pt-muted);
}

.facts {
  position: relative;
  display: flex;
  gap: 44px;
  margin-top: 22px;
  border-top: 1px solid var(--pt-rule);
  padding-top: 26px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.fact-num {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 26px;
}
.fact-label { font-size: 13.5px; color: var(--pt-faint); }

/* -- Our technology ------------------------------------------ */

.technology {
  padding: 40px 0 56px;
  border-top: 1px solid var(--pt-border);
  border-bottom: 1px solid var(--pt-border);
  background: var(--pt-bg-alt);
}
.technology .eyebrow { margin-bottom: 28px; }

.marquee {
  position: relative;
  overflow: hidden;
  max-width: var(--pt-max);   /* no side padding in the design */
  margin: 0 auto;
}

/* Edge fade as two gradient overlays rather than mask-image on this element.
   A mask on the parent of an animating child forces the browser to
   re-composite the region every frame and keeps the track off the GPU, which
   showed up as a stutter each time the loop restarted. The section background
   is a flat colour, so gradients over it reproduce the fade exactly. */
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8%;
  z-index: 1;
  pointer-events: none;
}
.marquee::before { left: 0;  background: linear-gradient(90deg, var(--pt-bg-alt), transparent); }
.marquee::after  { right: 0; background: linear-gradient(270deg, var(--pt-bg-alt), transparent); }

.marquee-track {
  display: flex;
  width: max-content;
  align-items: center;
  will-change: transform;
  animation: pt-marquee var(--pt-marquee-duration) linear infinite;
}

/* translate3d rather than translateX: the z component is what gets this its
   own compositor layer, so the loop restart no longer drops a frame. The two
   halves of the track are identical, so -50% lands exactly on the seam -
   measured at 0px error. */
@keyframes pt-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.logo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.85;
  padding-right: 64px; /* spacing must be padding, not gap - see index.html */
}
.logo-item img { height: 30px; width: auto; display: block; }
.logo-item span {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: var(--pt-ink);
  white-space: nowrap;
}

/* -- Projects ------------------------------------------------ */

.projects {
  max-width: var(--pt-container);
  margin: 0 auto;
  padding: 88px var(--pt-pad);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.section-head-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-head-intro {
  margin: 0;
  font-size: 15px;
  color: var(--pt-faint);
  max-width: 34ch;
  text-align: right;
  text-wrap: pretty;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--pt-card);
  border: 1px solid var(--pt-border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}
.project-card:hover { border-color: var(--pt-accent); }
.project-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.project-foot {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 17px;
}
.chip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pt-faint);
  background: var(--pt-chip);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.project-cta {
  border: 1px dashed rgba(30, 27, 24, 0.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: transparent;
  transition: border-color 0.2s ease;
  min-height: 200px;
}
.project-cta:hover { border-color: var(--pt-accent); color: var(--pt-ink); }
.project-cta-plus {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--pt-accent);
}
.project-cta-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
}
.project-cta-sub { font-size: 14px; color: var(--pt-faint); }

/* -- About us ------------------------------------------------ */

.about {
  background: var(--pt-ink);
  color: var(--pt-cream);
}
.about-inner {
  max-width: var(--pt-container);
  margin: 0 auto;
  padding: 88px var(--pt-pad);
}
.about-banner {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
}
.about-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 50%; /* framing carried over from the design file */
  display: block;
}
.about-overlay {
  position: relative;
  width: 100%;
  padding: 220px 56px 130px;
  background: linear-gradient(180deg,
      rgba(30, 27, 24, 0) 0%,
      rgba(30, 27, 24, 0.55) 45%,
      rgba(30, 27, 24, 0.88) 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about-title {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 22ch;
}
.about-body {
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--pt-on-dark-strong);
  max-width: 68ch;
  text-wrap: pretty;
}
.about-overlay .pill-grad { align-self: start; margin-top: 6px; }

/* -- Our expertise ------------------------------------------- */

.expertise {
  max-width: var(--pt-container);
  margin: 0 auto;
  padding: 88px var(--pt-pad);
}
.expertise-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.expertise-sub { margin: 0; font-size: 16px; color: var(--pt-faint); }

.exp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 44px 0;
  border-bottom: 1px solid var(--pt-rule);
}
/* Rows alternate: rows 02 and 04 put the image on the left. */
.exp-row--flip .exp-text  { order: 2; }
.exp-row--flip .exp-media { order: 1; }

.exp-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.exp-index {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--pt-index);
}
.exp-title {
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 27px;
  letter-spacing: -0.01em;
}
.exp-body {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--pt-muted);
  text-wrap: pretty;
}

.exp-media { justify-self: center; width: 100%; max-width: 440px; }
.exp-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}
.exp-img-left { object-position: 0% 50%; } /* framing carried over from the design file */

/* -- Contact us ---------------------------------------------- */

.contact {
  background: var(--pt-bg-alt);
  border-top: 1px solid var(--pt-border);
}
.contact-inner {
  max-width: var(--pt-container-narrow);
  margin: 0 auto;
  padding: 88px var(--pt-pad);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.contact-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.contact-sub { margin: 0; font-size: 16px; color: var(--pt-faint); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-form input,
.contact-form textarea {
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid rgba(30, 27, 24, 0.14);
  background: var(--pt-card);
  font-size: 15.5px;
  font-family: 'DM Sans', sans-serif;
  color: var(--pt-ink);
  outline: none;
  width: 100%;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--pt-accent); }
.contact-form input.invalid,
.contact-form textarea.invalid { border-color: var(--pt-accent); }
input::placeholder, textarea::placeholder { color: #B7A99A; }

.submit {
  border: none;
  cursor: pointer;
  background: var(--pt-grad);
  color: var(--pt-cream);
  padding: 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
}
.submit:hover { filter: brightness(1.06); }
.submit:disabled { cursor: default; opacity: 0.6; filter: none; }

/* Honeypot - never shown, never focusable, out of the flex flow.
   Specificity has to beat `.contact-form input` above. */
.contact-form .botcheck {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.form-status {
  margin: 0;
  font-size: 14px;
  color: var(--pt-muted);
  text-align: center;
}
.form-status.is-ok { color: #1F8F42; font-weight: 500; }
.form-status.is-error { color: var(--pt-accent); }
/* Takes up no room until it has something to say, so the resting layout
   matches the design exactly. */
.form-status:empty { display: none; }

/* -- Footer -------------------------------------------------- */

.site-footer {
  background: var(--pt-ink);
  color: var(--pt-on-dark);
}
.footer-inner {
  max-width: var(--pt-container);
  margin: 0 auto;
  padding: 28px var(--pt-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 14px;
}
.footer-inner img { height: 30px; width: auto; display: block; }
/* Matches the logo's 30px, so the footer keeps its height. */
.footer-inner a { color: var(--pt-on-dark); padding: 6px 0; }
.footer-inner a:hover { color: var(--pt-amber); }

/* -- Responsive ---------------------------------------------- */

@media (max-width: 1024px) {
  .hero-title { font-size: 64px; }
  .hero { padding-top: 88px; padding-bottom: 76px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .about-overlay { padding: 180px 40px 90px; }
  .exp-row { gap: 32px; }
}

@media (max-width: 860px) {
  .facts { flex-wrap: wrap; justify-content: center; gap: 28px 36px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head-intro { text-align: left; max-width: none; }
  .exp-row { grid-template-columns: 1fr; gap: 24px; padding: 36px 0; }
  .exp-row--flip .exp-text,
  .exp-row--flip .exp-media { order: initial; }
  .exp-media { justify-self: start; max-width: 100%; }
}

@media (max-width: 700px) {
  :root { --pt-pad: 20px; }
  /* No hamburger in the design - below this width the section links fold
     away and the primary CTA stays. */
  .nav a:not(.pill) { display: none; }
  .hero-title { font-size: 40px; letter-spacing: -0.03em; }
  .hero-sub { font-size: 17px; }
  .hero { padding-top: 64px; padding-bottom: 56px; gap: 22px; }
  .hero-ctas { flex-direction: column; gap: 6px; }
  .h2 { font-size: 30px; }
  .projects, .expertise, .contact-inner, .about-inner { padding-top: 60px; padding-bottom: 60px; }
  .project-grid { grid-template-columns: 1fr; }
  .about-banner { min-height: 460px; }
  .about-overlay { padding: 140px 24px 44px; }
  .about-title { font-size: 28px; }
  .contact-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; gap: 14px; }
  .orbit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit, .badge-dot, .marquee-track { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
