:root {
  --ink: #171a1f;
  --muted: #5a626f;
  --paper: #f8f9f6;
  --surface: #ffffff;
  --line: #d7ddd8;
  --teal: #0f766e;
  --teal-dark: #064e4a;
  --coral: #e95d45;
  --gold: #e0b340;
  --blue: #2f66d0;
  --shadow: 0 18px 55px rgba(18, 24, 32, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", "Noto Sans Thai", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #ffffff;
  background: rgba(12, 17, 23, 0.58);
  backdrop-filter: blur(16px);
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(10, 18, 28, 0.34);
  font-size: 0.82rem;
}

.nav-links {
  gap: clamp(16px, 3vw, 34px);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a {
  opacity: 0.88;
}

.nav-links a:hover {
  opacity: 1;
}

.is-compact .nav-toggle {
  display: grid;
  place-content: center;
}

.is-compact .nav-links {
  position: absolute;
  top: 70px;
  left: 18px;
  right: 18px;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.is-compact .nav-links.is-open {
  display: flex;
}

.is-compact .nav-links a {
  padding: 12px;
}

.nav-toggle {
  display: none;
  flex: 0 0 42px;
  padding: 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(233, 93, 69, 0.95);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  background: #ffffff;
}

.hero {
  position: relative;
  min-height: min(720px, 86vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #ffffff;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 13, 20, 0.82), rgba(8, 13, 20, 0.28) 58%, rgba(8, 13, 20, 0.58)),
    url("./assets/portfolio-hero.png") center / cover;
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  width: min(880px, calc(100% - 36px));
  max-width: calc(100vw - 36px);
  margin: 0 auto;
  padding: 148px 0 96px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f6cc67;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(4.2rem, 12vw, 9.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.18;
}

.hero-copy {
  width: min(620px, 100%);
  max-width: 620px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  word-break: break-word;
}

.is-compact .hero-content {
  width: calc(100vw - 32px);
  max-width: 620px;
}

.is-compact .hero-copy {
  max-width: 100%;
  word-break: break-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 900;
}

.button.primary {
  color: #ffffff;
  background: var(--coral);
}

.button.secondary {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.band {
  background: var(--surface);
}

.intro,
.services,
.contact {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 56px);
}

.section-grid,
.contact-layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: clamp(28px, 6vw, 86px);
  align-items: start;
}

.intro-copy {
  margin: 42px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.work-section,
.process-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 126px) 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card,
.service-item,
.contact-panel {
  border-radius: 8px;
}

.work-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: clamp(22px, 3vw, 34px);
  color: #111820;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(18, 24, 32, 0.08);
}

.work-card.accent {
  background: var(--teal);
  color: #ffffff;
}

.work-card.dark {
  background: #171a1f;
  color: #ffffff;
}

.work-index {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
  border: 1px solid currentColor;
  font-size: 0.82rem;
  font-weight: 900;
}

.work-card p,
.service-item p,
.timeline p,
.contact-panel p {
  margin: 12px 0 0;
  color: var(--muted);
}

.work-card.accent p,
.work-card.dark p {
  color: rgba(255, 255, 255, 0.78);
}

.services {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.services .section-heading,
.service-list,
.contact-layout {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.service-item {
  min-height: 190px;
  padding: clamp(22px, 3vw, 34px);
  background: var(--surface);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline li {
  min-height: 220px;
  padding: 28px;
  border-right: 1px solid var(--line);
}

.timeline li:last-child {
  border-right: 0;
}

.timeline span {
  color: var(--teal);
  font-size: 1.05rem;
  font-weight: 900;
}

.contact {
  background: #111820;
  color: #ffffff;
}

.contact h2 {
  max-width: 11ch;
}

.contact-panel {
  padding: clamp(24px, 4vw, 42px);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.contact-panel .button {
  margin-top: 22px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  color: #ffffff;
  background: #0c1117;
  font-size: 0.92rem;
}

.reveal-enabled [data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal-enabled [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .site-header {
    padding: 14px 18px;
  }

  .nav-toggle {
    display: grid;
    place-content: center;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    left: 18px;
    right: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
  }

  .hero {
    min-height: 82vh;
  }

  .hero-content {
    width: min(100% - 32px, 620px);
    padding: 118px 0 58px;
  }

  .hero-copy {
    max-width: 30rem;
    font-size: 1rem;
    line-height: 1.75;
  }

  .section-grid,
  .contact-layout,
  .work-grid,
  .service-list,
  .timeline {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    margin-top: 0;
  }

  .section-heading {
    display: block;
  }

  .work-card {
    min-height: 250px;
  }

  .timeline li {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .timeline li:last-child {
    border-bottom: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-enabled [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
