:root {
  --ink: #201F1B;
  --warm: #F8F4E9;
  --green: #FEB400;
  --cobalt: #2D5A47;
  --muted: #625F55;
  --line: #D9D3C4;
  --paper: #FFFDF7;
  --brand-green: #2D5A47;
  --yellow: #FEB400;
}

body {
  background:
    linear-gradient(90deg, rgba(32, 31, 27, 0.035) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--warm);
}

::selection { background: var(--green); color: var(--ink); }

.site-header {
  background: rgba(248, 244, 233, 0.9);
  border-bottom-color: rgba(32, 31, 27, 0.18);
}

.brand-logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-logo img { display: block; width: clamp(142px, 13vw, 195px); height: auto; }
.services-menu { position: relative; }
.services-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem; }
.services-menu summary::-webkit-details-marker { display: none; }
.services-menu summary span { transition: transform .2s ease; }
.services-menu[open] summary span { transform: rotate(45deg); }
.services-submenu {
  position: absolute;
  top: calc(100% + 1.1rem);
  left: 50%;
  transform: translateX(-50%);
  width: 390px;
  padding: .7rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 9px 9px 0 var(--green);
}
.services-submenu::before { content: ''; position: absolute; left: 0; right: 0; top: -1.2rem; height: 1.2rem; }
.services-submenu a { display: grid; grid-template-columns: 32px 1fr; gap: .65rem; padding: .8rem; border-bottom: 1px solid var(--line); }
.services-submenu a:last-child { border-bottom: 0; }
.services-submenu a:hover { background: var(--green); color: var(--ink); }
.services-submenu b { font: 700 .65rem Manrope, sans-serif; color: #2D5A47; }
.services-submenu span { display: flex; flex-direction: column; font: 700 .78rem Manrope, sans-serif; }
.services-submenu small { margin-top: .2rem; font: 500 .75rem 'IBM Plex Sans Thai', sans-serif; color: var(--muted); }
.mobile-nav-label { padding: .6rem .35rem .3rem; font: 700 .64rem Manrope, sans-serif; letter-spacing: .1em; color: #2D5A47; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: clamp(240px, 34vw, 550px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  left: -13vw;
  top: 7%;
  opacity: 0.22;
  filter: blur(1px);
}

.hero-illustration {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid var(--ink);
  box-shadow: 18px 18px 0 var(--green);
  transform: rotate(-1.25deg);
  background: #D9D3C4;
}
.hero-illustration img { width: 100%; height: 112%; object-fit: cover; display: block; will-change: transform; }

.hero h1 em,
.section-heading h2 em,
.case-intro h2 em { color: #2D5A47; }

.button-primary {
  background: var(--green);
  box-shadow: 7px 7px 0 var(--ink);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.button-primary:hover {
  background: #FEB400;
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--ink);
}

.signal-panel {
  background: var(--green);
  color: var(--ink);
  box-shadow: 18px 18px 0 var(--ink);
  transform: rotate(-1.25deg);
}

.signal-panel::before,
.signal-panel::after { border-color: rgba(23, 21, 15, 0.24); }
.signal-panel::after { border-color: rgba(23, 21, 15, 0.55); }
.panel-topline, .signal-legend, .orbit-label { color: var(--ink); }
.profit-orbit strong { background: var(--ink); color: var(--green); }
.signal-legend .green { background: var(--ink); }
.signal-legend .blue { background: #2D5A47; }
.signal-legend .ink { background: #fff4d8; border: 1px solid var(--ink); }

.motion-ticker {
  width: 100%;
  overflow: hidden;
  background: var(--green);
  border-block: 1px solid var(--ink);
  padding: .85rem 0;
  font: 800 .78rem/1 Manrope, sans-serif;
  letter-spacing: .12em;
  white-space: nowrap;
}

.motion-ticker div {
  width: max-content;
  animation: ticker 22s linear infinite;
}

.motion-ticker span { margin: 0 1.3rem; }

@keyframes ticker { to { transform: translateX(-50%); } }

.problem-strip { background: #FEB400; }
.problem-list { border-top-color: rgba(23, 21, 15, .45); }
.problem-list p { border-bottom-color: rgba(23, 21, 15, .45); }
.problem-list b, .service-index, .service-arrow, .project-number, .project-arrow { color: #2D5A47; }

.service-card {
  position: relative;
  transition: background .3s ease, padding-inline .3s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s cubic-bezier(.2,.75,.2,1);
  z-index: -1;
}

.service-card:hover { padding-inline: 1.2rem; }
.service-card:hover::before { transform: scaleX(1); transform-origin: left; }
.service-card li::before { color: #2D5A47; }
.service-detail { display: inline-flex; gap: .65rem; margin-top: 1.15rem; padding-bottom: .2rem; border-bottom: 1px solid #201F1B; font-weight: 700; font-size: .88rem; }
.service-detail:hover { color: #2D5A47; }

.case-study { background: #201F1B; }
.case-intro h2 em, .case-link, .data-story b, .metrics strong { color: var(--green); }

.case-visual {
  margin: 3rem 0 0;
  overflow: hidden;
  border: 1px solid rgba(254, 180, 0, .5);
  aspect-ratio: 1.53;
}

.case-visual img { width: 100%; height: 100%; object-fit: contain; display: block; }

.process-grid li { position: relative; overflow: hidden; }
.process-grid li::after {
  content: '';
  position: absolute;
  width: 75px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  right: -38px;
  bottom: -38px;
  opacity: .7;
}

.portfolio-grid { gap: 1.1rem; background: transparent; align-items: stretch; }
.portfolio-card {
  align-self: stretch;
  padding: 0;
  justify-content: flex-start;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 transparent;
  transition: transform .35s ease, box-shadow .35s ease;
}

.portfolio-card:hover {
  background: var(--paper);
  transform: translate(-5px, -5px);
  box-shadow: 9px 9px 0 var(--green);
}

.project-image {
  margin: 0;
  height: auto;
  aspect-ratio: 1200 / 785;
  overflow: hidden;
  background: #ddd5c4;
  border-bottom: 1px solid var(--ink);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-copy { padding: 1.35rem; }
.project-type, .project-number {
  z-index: 2;
  top: .8rem;
  padding: .35rem .5rem;
  background: var(--green);
  color: var(--ink);
  border: 1px solid var(--ink);
  max-width: 70%;
}
.project-type { left: .8rem; }
.project-number { right: .8rem; }
.project-arrow { right: 1.15rem; bottom: 1.05rem; }

.contact {
  background: var(--brand-green);
  color: var(--paper);
  border-top: 1px solid var(--ink);
}
.contact .eyebrow, .contact > div > p:not(.eyebrow) { color: var(--paper); }
.contact-direct { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; margin-top: 2rem; }
.contact-direct a { border-bottom: 1px solid rgba(255, 253, 247, .6); font-size: .9rem; }

.contact-form { align-self: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: clamp(1.2rem, 3vw, 2rem); background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--yellow); }
.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-field-wide, .form-submit-row, .form-status { grid-column: 1 / -1; }
.form-field label { font-size: .82rem; font-weight: 700; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid var(--border, #D9D3C4); border-radius: 0; background: #FFFDF7; color: #201F1B; padding: .82rem .9rem; font: inherit; }
.form-field textarea { resize: vertical; min-height: 7.5rem; }
.form-field input:focus-visible, .form-field textarea:focus-visible { outline: 3px solid #FEB400; outline-offset: 2px; border-color: #201F1B; }
.form-field [aria-invalid="true"] { border-color: #9d2f2f; }
.field-error { min-height: 1.2em; margin: 0; color: #8a2424; font-size: .75rem; }
.form-trap { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(1px, 1px, 1px, 1px) !important; white-space: nowrap !important; }
.form-submit-row { display: flex; align-items: center; gap: 1rem; }
.form-submit-row button { flex: 0 0 auto; border: 1px solid var(--ink); background: var(--yellow); color: var(--ink); padding: .9rem 1.1rem; font: 700 .92rem 'IBM Plex Sans Thai', sans-serif; box-shadow: 5px 5px 0 var(--ink); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.form-submit-row button:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.form-submit-row button:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 3px; }
.form-submit-row button:disabled { opacity: .7; cursor: wait; transform: none; }
.form-privacy { margin: 0; color: var(--muted); font-size: .72rem; }
.form-status { min-height: 1.4em; margin: 0; font-weight: 600; font-size: .85rem; }

@media (max-width: 800px) {
  .brand-logo img { width: 142px; }
  .signal-panel { transform: rotate(-.5deg); box-shadow: 10px 10px 0 var(--ink); }
  .hero-illustration { box-shadow: 10px 10px 0 var(--green); transform: rotate(-.5deg); }
  .motion-ticker div { animation-duration: 16s; }
  .contact-form { margin-top: .5rem; }
}

@media (max-width: 480px) {
  .project-image { height: auto; }
  .contact-form { grid-template-columns: 1fr; }
  .form-submit-row { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .motion-ticker div { animation: none; }
  .service-card, .service-card::before, .portfolio-card { transition: none; }
}
