/* PT. Global Nusa Trans
   Brand colours are sampled from the logo: sea blue, leaf green, black wordmark.
   Type is one family (Archivo) at two widths: expanded for display, normal for text. */

:root {
  --sea: #1f80b4;          /* logo blue: graphics */
  --sea-ink: #166b99;      /* logo blue, darkened for text on white */
  --sea-light: #8bcbee;    /* on dark surfaces */
  --leaf: #557a28;         /* logo green: fields and buttons */
  --leaf-deep: #46661f;
  --leaf-light: #b3d67c;   /* on dark surfaces */
  --harbour: #0b2e45;      /* deep blue surface */
  --harbour-line: rgba(255, 255, 255, 0.16);
  --ink: #10222f;
  --muted: #4c6272;
  --mist: #eef4f6;
  --line: #d3dfe5;
  --white: #fff;

  --radius: 6px;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 84px;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

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

h1, h2 {
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h3 {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.25;
}

.lead {
  font-size: clamp(1.2rem, 1.7vw, 1.45rem);
  line-height: 1.45;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--harbour);
  color: var(--white);
  border-radius: var(--radius);
}
.skip:focus { top: 1rem; }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.6rem;
  border: 2px solid var(--leaf);
  border-radius: var(--radius);
  background: var(--leaf);
  color: var(--white);
  font-weight: 700;
  font-stretch: 108%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--leaf-deep); border-color: var(--leaf-deep); }

.btn--small { min-height: 2.75rem; padding: 0.4rem 1.15rem; font-size: 1rem; }

.btn--dark { background: var(--harbour); border-color: var(--harbour); }
.btn--dark:hover { background: #154a6c; border-color: #154a6c; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

.text-link {
  font-weight: 700;
  color: var(--sea-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.text-link:hover { color: var(--harbour); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand { display: block; flex: none; }
.brand img { width: auto; height: 62px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.1rem);
  font-weight: 600;
}
.site-nav a:not(.btn) {
  padding-block: 0.4rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:not(.btn):hover { border-bottom-color: var(--leaf); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: none;
  font-weight: 700;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav-toggle__bars { position: relative; top: -3px; }
.nav-toggle__bars::before { content: ""; position: absolute; top: 6px; }

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

.hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(6rem, 12vw, 10.5rem);
}
.hero__grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.hero__lead {
  max-width: 34ch;
  margin-top: 1.5rem;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1.4;
  color: var(--muted);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

/* The globe: the logo's ringed globe, with a real job inside it */
.globe {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 1;
  justify-self: end;
}
.globe__photo {
  position: absolute;
  inset: 6.5%;
  width: 87%;
  height: 87%;
  object-fit: cover;
  border-radius: 50%;
}
.globe__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(118deg);
}
.globe__ring circle {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 90 10;
}

.hero__swoosh {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(110px, 17vw, 250px);
}
.hero__swoosh svg { display: block; width: 100%; height: 100%; }
.swoosh--leaf { fill: var(--leaf); }
.swoosh--sea { fill: var(--sea); }

/* Cargo marker: rides the green swoosh from left to right as the hero scrolls (main.js places it) */
.cargo {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 3px solid var(--harbour);
  border-radius: 50%;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

/* Hero intro.
   With anime.js (html.js-motion) the pieces start hidden and main.js plays them as one timeline.
   Without it, the CSS sequence below is the fallback. */
.js-motion .hero h1,
.js-motion .hero__lead,
.js-motion .hero__actions,
.js-motion .globe__photo { opacity: 0; }
.js-motion .globe__ring circle { stroke-dasharray: 0 100; }
.js-motion .hero__swoosh { clip-path: inset(0 100% 0 0); }

@media (prefers-reduced-motion: no-preference) {
  html:not(.js-motion) .globe__ring circle { animation: ring-draw 1.3s cubic-bezier(0.6, 0, 0.2, 1) 0.15s both; }
  html:not(.js-motion) .globe__photo { animation: photo-in 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both; }
  html:not(.js-motion) .hero__swoosh { animation: sweep 1.25s cubic-bezier(0.7, 0, 0.2, 1) 0.35s both; }
}
@keyframes ring-draw {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: 90 10; }
}
@keyframes photo-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes sweep {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

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

.about { padding-top: clamp(2.5rem, 6vw, 5rem); }
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
}
.about__copy .lead { margin-top: 1.5rem; }
.about__copy p + p { margin-top: 1.1rem; color: var(--muted); max-width: 52ch; }
.about__photo,
.services__photo { border-radius: var(--radius); overflow: hidden; }

.creed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 6vw, 5.5rem);
  margin-top: clamp(3rem, 7vw, 5.5rem);
}
.creed__item {
  position: relative;
  padding-top: calc(1.5rem + 3px);
}
.creed__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--sea);
  transform-origin: left;
}
.creed__item + .creed__item::before { background: var(--leaf); }
.creed__item p { margin-top: 0.75rem; max-width: 56ch; }

/* ---------- Services ---------- */

.services {
  background: var(--harbour);
  color: #c9dae4;
}
.services h2, .services dt { color: var(--white); }
.services__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 7vw, 6.5rem);
}
.services__intro p { margin-top: 1.5rem; max-width: 40ch; }
.services__photo { margin-top: 2.5rem; }
.services__photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}
.services__lists { display: grid; gap: clamp(2.75rem, 5vw, 4rem); align-content: start; }

.service-group h3 { font-size: 1.05rem; font-weight: 700; }
.service-group--sea h3 { color: var(--sea-light); }
.service-group--leaf h3 { color: var(--leaf-light); }
.service-group dl { margin-top: 1rem; border-top: 1px solid var(--harbour-line); }
.service-group dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--harbour-line);
}
.service-group dt {
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
}

/* ---------- Work ---------- */

.work__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter {
  min-height: 2.75rem;
  padding: 0.35rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.filter:hover { border-color: var(--ink); }
.filter[aria-pressed="true"] {
  background: var(--harbour);
  border-color: var(--harbour);
  color: var(--white);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.gallery li[hidden] { display: none; }
.tile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: zoom-in;
}
.tile img {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  background: var(--mist);
  transition: filter 0.2s;
}
.tile:hover img { filter: brightness(1.07) saturate(1.08); }
.tile__cap { font-weight: 600; line-height: 1.35; }
.tile__cat { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }

.work__more { margin-top: clamp(2rem, 4vw, 3rem); text-align: center; }
.work__more[hidden] { display: none; }

/* ---------- Partners ---------- */

.partners { background: var(--mist); }
/* Flex instead of grid so an incomplete last row sits centred, whatever the number of logos */
.logos {
  --cols: 5;
  --gap: clamp(0.6rem, 1.4vw, 1rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  margin-top: clamp(2rem, 4vw, 3rem);
}
.logos li {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.logos img { width: 100%; }

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

.contact {
  background: var(--leaf);
  color: var(--white);
}
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.contact__info .lead { margin-top: 1.5rem; max-width: 30ch; }

.details { margin-top: 2.5rem; border-top: 1px solid rgba(255, 255, 255, 0.35); }
.details > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}
.details dt { font-weight: 700; }
.details a { text-underline-offset: 0.25em; }
.details a:hover { text-decoration-thickness: 2px; }

.contact :focus-visible { outline-color: var(--white); }

.quote {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--white);
  color: var(--ink);
  border-radius: calc(var(--radius) * 2);
}
.quote :focus-visible { outline-color: var(--sea); }
.quote h3 { font-size: 1.5rem; font-stretch: 125%; font-weight: 800; letter-spacing: -0.01em; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.field label { display: block; margin-bottom: 0.4rem; font-weight: 600; font-size: 1rem; }
.optional { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #9fb2bd;
  border-radius: var(--radius);
  background: var(--white);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field ::placeholder { color: #6d8290; }
.field [aria-invalid="true"] { border-color: #b3261e; }
.field__error { margin-top: 0.4rem; color: #b3261e; font-size: 0.9375rem; font-weight: 600; }
.field__error[hidden] { display: none; }
.quote .btn { justify-self: start; }
.quote__note { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }

.map {
  display: block;
  width: 100%;
  height: clamp(260px, 32vw, 380px);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border: 0;
  border-radius: calc(var(--radius) * 2);
}

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

.site-footer {
  background: var(--harbour);
  color: #c9dae4;
  font-size: 1rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.site-footer__brand img { width: 210px; }
.site-footer__brand p { margin-top: 1.25rem; max-width: 28ch; }
.site-footer__nav { display: grid; gap: 0.6rem; align-content: start; justify-items: start; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 0.25em; }
.site-footer__contact { font-style: normal; line-height: 1.75; }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--harbour-line);
  font-size: 0.9375rem;
}
.site-footer__legal a { text-decoration: underline; text-underline-offset: 0.25em; }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(0.75rem, 3vw, 2.5rem);
  border: 0;
  background: rgba(6, 26, 40, 0.96);
  color: var(--white);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.25rem, 2vw, 1.5rem);
}
.lightbox::backdrop { background: rgba(6, 26, 40, 0.9); }
.lightbox__figure { display: grid; justify-items: center; gap: 1rem; min-height: 0; }
.lightbox__figure img {
  max-width: 100%;
  max-height: calc(100dvh - 9rem);
  border-radius: var(--radius);
}
.lightbox__figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  font-weight: 600;
  text-align: center;
}
#lightbox-count { font-weight: 400; color: #a9c0cd; }
.lightbox button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: none;
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.lightbox button:hover { background: var(--white); color: var(--harbour); }
.lightbox :focus-visible { outline-color: var(--white); }
.lightbox svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lightbox__close { position: absolute; top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); }

/* ---------- Scroll reveals ----------
   main.js tags elements with data-reveal and adds .is-in the first time they scroll into view.
   Each one plays once. Without JS, or with reduced motion, nothing is hidden. */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    --reveal-delay: calc(var(--i, 0) * 80ms);
  }

  /* rise: text, rows, tiles and logos settle up a short distance */
  [data-reveal="rise"] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out var(--reveal-delay),
                transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay);
  }
  [data-reveal="rise"].is-in { opacity: 1; transform: none; }

  /* wipe: photos open from the left, the same move as the hero swooshes */
  /* (the clip sits on the image, not the observed figure, so the observer still sees the figure) */
  [data-reveal="wipe"] img {
    clip-path: inset(0 100% 0 0);
    transform: scale(1.08);
    transition: clip-path 1s cubic-bezier(0.7, 0, 0.2, 1) var(--reveal-delay),
                transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay);
  }
  [data-reveal="wipe"].is-in img { clip-path: inset(0 0 0 0); transform: none; }

  /* line: the coloured rule draws across, then the text under it appears */
  [data-reveal="line"]::before {
    transform: scaleX(0);
    transition: transform 0.9s cubic-bezier(0.7, 0, 0.2, 1) var(--reveal-delay);
  }
  [data-reveal="line"] > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease-out calc(var(--reveal-delay) + 0.3s),
                transform 0.6s ease-out calc(var(--reveal-delay) + 0.3s);
  }
  [data-reveal="line"].is-in::before { transform: scaleX(1); }
  [data-reveal="line"].is-in > * { opacity: 1; transform: none; }

  /* Fallback without anime.js: the ring turns with scroll in browsers that have scroll timelines */
  @supports (animation-timeline: scroll()) {
    html:not(.js-motion) .globe__ring {
      animation: ring-turn linear both;
      animation-timeline: scroll(root);
      animation-range: 0 720px;
    }
  }
}
@keyframes ring-turn {
  from { transform: rotate(118deg); }
  to { transform: rotate(208deg); }
}

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

@media (max-width: 1000px) {
  .logos { --cols: 4; }
  .service-group dl > div { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(11, 46, 69, 0.35);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) {
    padding-block: 0.95rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.125rem;
  }
  .site-nav .btn { margin-top: 1.25rem; min-height: 3.25rem; }

  .hero__grid,
  .about__grid,
  .services__grid,
  .contact__grid { grid-template-columns: 1fr; }

  .hero { padding-bottom: clamp(5rem, 20vw, 9rem); }
  .globe { width: 82%; justify-self: end; margin-right: -4%; }

  .about__photo { order: -1; }
  .services__photo { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  :root { --header-h: 72px; }
  .brand img { height: 50px; }
  .creed { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .tile { grid-template-columns: 1fr; }
  .logos { --cols: 3; }
  .field-row { grid-template-columns: 1fr; }
  .details > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .lightbox[open] { grid-template-columns: 1fr 1fr; align-content: center; }
  .lightbox__figure { grid-column: 1 / -1; grid-row: 1; }
  .lightbox__nav--prev { justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
