/* Phuket Media Company — shared stylesheet
   Design system: Minimal / Swiss-influenced, black + yellow, restrained motion.
   Hand-written, no framework/build step — kept deliberately small for fast loads
   on cheap hosting. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img, picture, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Design tokens ---------- */
:root {
  --black: #0d0d0d;
  --ink: #171717;
  --white: #ffffff;
  --paper: #faf9f6;
  --grey-700: #4b4b48;
  --grey-500: #74746f;
  --grey-300: #d8d8d2;
  --grey-200: #ebebe6;
  --yellow: #ffd400;
  --yellow-deep: #e0b400;
  --line: rgba(13, 13, 13, 0.12);
  --line-inverse: rgba(255, 255, 255, 0.18);

  --font-heading: "Instrument Sans", -apple-system, sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --pad: clamp(20px, 4vw, 72px);
  --gap: clamp(16px, 2.5vw, 32px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 250ms;

  --radius: 2px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--black);
  text-wrap: balance;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.25rem, 5.2vw, 4.25rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 3.8vw, 3.25rem); }
h3 { font-size: clamp(1.25rem, 1.9vw, 1.6rem); }

p { max-width: 62ch; }
p.lead { font-size: clamp(1.2rem, 1.7vw, 1.5rem); color: var(--grey-700); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 3px;
}

::selection { background: var(--yellow); color: var(--black); }

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(64px, 10vw, 128px); }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.section--dark { background: var(--black); color: var(--white); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p.lead { color: rgba(255,255,255,0.72); }
.section--paper { background: var(--paper); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--grey-700);
  margin-bottom: 16px;
}
.section--dark .eyebrow { color: var(--yellow); }
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--yellow);
  display: inline-block;
}

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--black); color: var(--white);
  padding: 10px 16px; z-index: 200; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.0625rem;
  padding: 16px 30px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--yellow-deep); }
.btn-outline { background: transparent; color: var(--black); border-color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.section--dark .btn-outline { color: var(--white); border-color: var(--line-inverse); }
.section--dark .btn-outline:hover { background: var(--white); color: var(--black); }
.btn-arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--black);
  transition: box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 12px 32px rgba(13,13,13,0.08); }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 22px;
  gap: 24px;
}
.logo-lockup { display: flex; align-items: center; gap: 16px; }
.logo-img { height: 34px; width: auto; display: block; }
.footer-brand .logo-img { height: 40px; }

.nav-desktop { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: var(--radius);
  position: relative;
  background: none;
}
.site-header .btn { text-transform: uppercase; letter-spacing: 0.02em; }
.nav-link::before { content: "/"; color: var(--yellow-deep); margin-right: 3px; font-weight: 700; }
.nav-link::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px;
  height: 2px; background: var(--black);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--yellow-deep); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); background: var(--yellow-deep); }

.nav-item { position: relative; }
.nav-dropdown {
  position: absolute; top: 100%; left: 0;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(13,13,13,0.08);
  padding: 10px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown a {
  display: block; padding: 10px 12px; font-size: 0.875rem; font-weight: 500;
  border-radius: var(--radius);
}
.nav-dropdown a:hover { background: var(--paper); color: var(--yellow-deep); }

.header-cta { display: flex; align-items: center; gap: 20px; }

.nav-toggle {
  display: none;
  background: none; border: none; padding: 8px;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--black); display: block; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.nav-toggle span:nth-child(2) { margin: 5px 0; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-desktop, .header-cta .btn-outline { display: none; }
  .nav-toggle { display: flex; }
  .header-cta .btn-primary { padding: 10px 16px; font-size: 0.8125rem; }
}

.nav-mobile {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a, .nav-mobile button.nav-mobile-toggle {
  padding: 16px var(--pad);
  font-family: var(--font-heading); font-weight: 500; font-size: 1.0625rem;
  border-bottom: 1px solid var(--line);
  text-align: left; background: none; border-left: none; border-right: none; border-top: none;
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.nav-mobile-sub { display: none; background: var(--paper); }
.nav-mobile-sub.is-open { display: flex; flex-direction: column; }
.nav-mobile-sub a { padding-left: calc(var(--pad) + 16px); font-weight: 500; font-size: 0.875rem; }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(72px, 14vw, 160px) clamp(56px, 9vw, 96px);
}
.hero-kicker {
  font-family: var(--font-heading);
  font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--grey-700); margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.hero-kicker::before { content: ""; width: 8px; height: 8px; background: var(--yellow); border-radius: 50%; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: 28px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 44px; }

/* Hero load-in / scroll-reveal elements: NO default hidden state here on
   purpose. GSAP (see main.js) hides-then-animates these progressively once
   it has successfully initialized; if the script fails for any reason, the
   content simply stays in its normal visible state instead of vanishing. */

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  padding: clamp(24px, 3vw, 36px);
  background: var(--white);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--black); transform: translateY(-3px); }
.card-index {
  font-family: var(--font-heading); font-weight: 500; color: var(--grey-300);
  font-size: 0.9375rem; margin-bottom: 20px;
}
.card h3 { margin-bottom: 12px; }
.card p { color: var(--grey-700); font-size: 0.9375rem; }
.card a.card-link {
  margin-top: 20px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-size: 0.8125rem; font-weight: 600;
  border-bottom: 1px solid var(--black); padding-bottom: 2px;
}
.card a.card-link .btn-arrow { transition: transform var(--dur) var(--ease); }
.card a.card-link:hover .btn-arrow { transform: translateX(3px); }

.section--dark .card { background: var(--ink); border-color: var(--line-inverse); }
.section--dark .card:hover { border-color: var(--yellow); }
.section--dark .card p { color: rgba(255,255,255,0.68); }
.section--dark .card a.card-link { border-color: var(--yellow); color: var(--yellow); }

/* ---------- Section head ---------- */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: clamp(32px, 5vw, 56px); flex-wrap: wrap; }
.section-head p { color: var(--grey-700); }

/* ---------- Client cards ---------- */
.client-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  border: 1px solid var(--line); padding: clamp(22px, 2.6vw, 30px);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.client-card:hover { border-color: var(--black); transform: translateY(-3px); background: var(--paper); }
.client-card h3 { font-size: 1.15rem; }
.client-card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.client-card-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 500;
  color: var(--grey-700); align-self: flex-start;
}
.client-card:hover .client-card-link { color: var(--black); }
.client-card-link svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.client-card:hover .client-card-link svg { transform: translate(2px, -2px); }

/* ---------- Sticky services layout ---------- */
.services-grid { display: grid; grid-template-columns: 0.85fr 1.4fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.services-sticky-col { position: sticky; top: 104px; }
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .services-sticky-col { position: static; }
}

/* ---------- Numbered list (services on home) ---------- */
.service-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-block: 28px; border-bottom: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
  flex-wrap: wrap;
}
.service-row:first-child { border-top: 1px solid var(--line); }
.service-row:hover { background: var(--paper); }
.service-row-left { display: flex; align-items: baseline; gap: 24px; }
.service-row-num { font-family: var(--font-heading); color: var(--grey-300); font-weight: 500; font-size: 1rem; }
.service-row h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 700; }
.service-row-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 0.8125rem; font-weight: 500; font-family: var(--font-heading);
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--grey-700);
}
.service-row-arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.service-row:hover .service-row-arrow { background: var(--yellow); border-color: var(--yellow); }
.service-row-arrow svg { width: 16px; height: 16px; }

/* Scroll-reveal elements: same principle as above — GSAP applies the hidden
   "from" state and animation entirely at runtime; nothing here hides them
   by default, so a JS failure can never leave a section permanently blank. */

/* ---------- Scroll cue ---------- */
.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--grey-500);
}
.scroll-cue svg { animation: scroll-cue-bounce 1.8s ease-in-out infinite; }
@keyframes scroll-cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue svg { animation: none; }
}

/* ---------- Hero animated background: moving wireframe grid + node network ---------- */
.hero { position: relative; overflow: clip; }

.hero-bg-grid {
  position: absolute; inset: -1px; z-index: -3; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, var(--line) 0, var(--line) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, var(--line) 0, var(--line) 1px, transparent 1px, transparent 64px);
  animation: hero-grid-drift 34s linear infinite;
}
@keyframes hero-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 640px, 640px 0; }
}

.hero-bg-wire {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  overflow: visible;
}
.hero-bg-wire svg { position: absolute; overflow: visible; }
.hero-bg-wire .wire-a { top: -6vw; right: -4vw; width: min(46vw, 620px); animation: hero-wire-drift-a 28s ease-in-out infinite; }
.hero-bg-wire .wire-b { bottom: -8vw; left: -6vw; width: min(30vw, 420px); animation: hero-wire-drift-b 34s ease-in-out infinite; }
.hero-bg-wire circle { animation: hero-node-pulse 4.5s ease-in-out infinite; }
.hero-bg-wire circle:nth-child(3n+1) { animation-delay: 0s; }
.hero-bg-wire circle:nth-child(3n+2) { animation-delay: 1.2s; }
.hero-bg-wire circle:nth-child(3n) { animation-delay: 2.4s; }

@keyframes hero-wire-drift-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-2.5vw, 2vw) rotate(4deg); }
}
@keyframes hero-wire-drift-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(2vw, -2.5vw) rotate(-3deg); }
}
@keyframes hero-node-pulse {
  0%, 100% { opacity: 0.35; r: 3; }
  50% { opacity: 0.9; r: 4.5; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-grid, .hero-bg-wire .wire-a, .hero-bg-wire .wire-b, .hero-bg-wire circle { animation: none; }
}
@media (max-width: 700px) {
  .hero-bg-wire .wire-a, .hero-bg-wire .wire-b { display: none; }
}

/* ---------- Count-up numbers ---------- */
.count-up { font-variant-numeric: tabular-nums; }

/* ---------- CTA band ---------- */
.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta-band h2 { max-width: 18ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--white); color: var(--ink); border-top: 2px solid var(--black); padding-block: clamp(56px, 8vw, 96px) 32px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: clamp(32px, 5vw, 56px); padding-bottom: 56px; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .footer-top { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--grey-700); margin-top: 16px; font-size: 0.9375rem; }
.footer-col h4 {
  font-family: var(--font-heading); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.footer-col h4::before { content: ""; width: 14px; height: 2px; background: var(--yellow); display: inline-block; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--grey-700); border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer-col a:hover { color: var(--ink); border-color: var(--yellow); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 24px;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--grey-500);
}
.footer-bottom a { color: var(--grey-500); text-transform: uppercase; }
.footer-bottom a:hover { color: var(--ink); }
.footer-social { display: flex; gap: 16px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--grey-500); padding-block: 20px; }
.breadcrumb a:hover { color: var(--yellow-deep); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Inner page hero (services/industries) ---------- */
.page-hero { padding-block: clamp(48px, 8vw, 96px) clamp(48px, 6vw, 80px); }
.page-hero h1 { max-width: 20ch; }
.page-hero .lead { margin-top: 20px; }

/* ---------- Two column feature ---------- */
.feature-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .feature-split { grid-template-columns: 1fr; } }
.feature-split ul { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.feature-split li { display: flex; gap: 14px; align-items: flex-start; font-size: 0.9375rem; color: var(--grey-700); }
.feature-split li svg { flex-shrink: 0; margin-top: 3px; color: var(--yellow-deep); }
.section--dark .feature-split li { color: rgba(255,255,255,0.72); }

/* Muted body copy that adapts to its section — never hardcode this color
   inline, or it becomes unreadable inside a .section--dark block. */
.prose-muted { color: var(--grey-700); }
.section--dark .prose-muted { color: rgba(255,255,255,0.72); }

.stat-block { border: 1px solid var(--line); padding: 32px; background: var(--paper); }
.stat-block b { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 3rem); display: block; }
.stat-block span { color: var(--grey-700); font-size: 0.9375rem; }

/* ---------- Form ---------- */
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.form-field label { font-family: var(--font-heading); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; }
.form-field .hint { font-size: 0.8125rem; color: var(--grey-500); }
.form-field input, .form-field textarea, .form-field select {
  border: 1px solid var(--grey-300); padding: 14px 16px; background: var(--white);
  border-radius: var(--radius); font-size: 1rem;
  transition: border-color var(--dur) var(--ease);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--black); outline: none;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.required { color: var(--yellow-deep); }

/* ---------- Contact channels ---------- */
.contact-channel {
  display: flex; align-items: flex-start; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line-inverse);
}
.contact-channel:first-child { border-top: 1px solid var(--line-inverse); }
.contact-channel .icon { width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--black); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-channel h3 { font-size: 1.05rem; }
.contact-channel a, .contact-channel p { color: rgba(255,255,255,0.75); font-size: 0.9375rem; }
.contact-channel a:hover { color: var(--yellow); }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.max-w-prose { max-width: 62ch; margin-inline: auto; }
