/* Intelligentanalytics — workshop theme
   Palette: deep teal, warm sand mist, copper accent
   Typography: Prompt (display) + Sarabun (body) — Thai-capable
*/

:root {
  --color-ink: #1a2b2e;
  --color-ink-soft: #3d5256;
  --color-teal: #0d5c63;
  --color-teal-deep: #094548;
  --color-teal-soft: #e4f0f1;
  --color-copper: #b86b3a;
  --color-copper-hover: #9a572e;
  --color-sand: #f3efe6;
  --color-mist: #e8eef0;
  --color-paper: #faf8f4;
  --color-line: #c9d4d6;
  --color-error: #9b2c2c;
  --color-success: #1e6b4a;
  --font-display: "Prompt", sans-serif;
  --font-body: "Sarabun", sans-serif;
  --space-xs: 0.35rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --space-2xl: 5.5rem;
  --radius: 4px;
  --shadow-soft: 0 12px 40px rgba(13, 92, 99, 0.08);
  --max: 72rem;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(13, 92, 99, 0.09), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(184, 107, 58, 0.08), transparent 50%),
    linear-gradient(180deg, var(--color-sand) 0%, var(--color-paper) 35%, var(--color-mist) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

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

a {
  color: var(--color-teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-copper);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-ink);
  margin: 0 0 var(--space-md);
}

h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--space-md); }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-teal-deep);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__brand:hover {
  color: var(--color-copper);
}

.site-header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}

.site-header__toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--color-ink);
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
}

.site-nav__link {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--color-teal);
  border-bottom-color: var(--color-copper);
}

@media (max-width: 900px) {
  .site-header__toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-paper);
    border-bottom: 1px solid var(--color-line);
    padding: var(--space-md);
    display: none;
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav__list { flex-direction: column; gap: var(--space-sm); }
}

/* Footer */
.site-footer {
  margin-top: var(--space-2xl);
  background: var(--color-teal-deep);
  color: var(--color-sand);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.site-footer a { color: #f0d9c4; }
.site-footer a:hover { color: #fff; }

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1.4fr 1fr 1fr;
}

.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: var(--space-sm);
}

.site-footer__tag {
  opacity: 0.85;
  font-size: 0.95rem;
}

.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav li { margin-bottom: 0.4rem; }

.site-footer__copy {
  max-width: var(--max);
  margin: var(--space-lg) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(243, 239, 230, 0.2);
  font-size: 0.875rem;
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 768px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--color-copper);
  color: #fff;
  border-color: var(--color-copper);
}

.btn--primary:hover {
  background: var(--color-copper-hover);
  color: #fff;
  border-color: var(--color-copper-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--color-teal-deep);
  border-color: var(--color-teal);
}

.btn--ghost:hover {
  background: var(--color-teal-soft);
  color: var(--color-teal-deep);
}

.btn--on-dark {
  background: var(--color-sand);
  color: var(--color-teal-deep);
  border-color: var(--color-sand);
}

.btn--on-dark:hover {
  background: #fff;
  color: var(--color-teal-deep);
}

/* Layout helpers */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
}

.section--tight {
  padding: var(--space-lg) 0;
}

.section__eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-copper);
  margin-bottom: var(--space-sm);
}

.prose {
  max-width: 42rem;
}

.prose--wide {
  max-width: 48rem;
}

/* Hero — full-bleed */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-zoom 18s var(--ease) infinite alternate;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(9, 69, 72, 0.88) 0%, rgba(9, 69, 72, 0.55) 45%, rgba(26, 43, 46, 0.35) 100%),
    linear-gradient(0deg, rgba(9, 69, 72, 0.75) 0%, transparent 50%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-md);
  line-height: 1.1;
  animation: rise-in 0.9s var(--ease) both;
}

.hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 32rem;
  margin-bottom: var(--space-lg);
  opacity: 0.95;
  animation: rise-in 0.9s 0.15s var(--ease) both;
}

.hero__actions {
  animation: rise-in 0.9s 0.28s var(--ease) both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* Page hero (inner) */
.page-hero {
  padding: var(--space-xl) 0 var(--space-lg);
  border-bottom: 1px solid var(--color-line);
  background: linear-gradient(180deg, rgba(13, 92, 99, 0.06), transparent);
}

.page-hero--media {
  position: relative;
  min-height: 18rem;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  border-bottom: none;
  background: none;
}

.page-hero--media .page-hero__bg {
  position: absolute;
  inset: 0;
}

.page-hero--media .page-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero--media .page-hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 69, 72, 0.9), rgba(9, 69, 72, 0.45));
}

.page-hero--media .wrap {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-xl);
  padding-top: var(--space-xl);
}

.page-hero h1 { margin-bottom: var(--space-sm); }
.page-hero p { color: var(--color-ink-soft); max-width: 36rem; }
.page-hero--media p { color: rgba(255, 255, 255, 0.9); }

/* Offer strip / service preview */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-lg);
}

.offer-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.offer-item__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
}

.offer-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.offer-item:hover .offer-item__img img {
  transform: scale(1.04);
}

.offer-item__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
}

.offer-item__title a {
  color: inherit;
  text-decoration: none;
}

.offer-item__title a:hover { color: var(--color-copper); }

.offer-item__meta {
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  margin: 0;
}

/* Split section */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.split__img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.split__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 5 / 4;
}

@media (max-width: 768px) {
  .split { grid-template-columns: 1fr; }
}

/* Quote / evidence */
.quote-block {
  border-left: 3px solid var(--color-copper);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
}

.quote-block__text {
  font-size: 1.15rem;
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.quote-block__attr {
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  margin: 0;
}

.review-list {
  display: grid;
  gap: var(--space-lg);
}

.review-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-line);
}

.review-item:last-child { border-bottom: none; }

.review-item__service {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-teal);
  margin-bottom: var(--space-xs);
}

/* Pricing */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.rate-table th,
.rate-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.rate-table th {
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--color-teal-soft);
  color: var(--color-teal-deep);
}

.rate-note {
  background: var(--color-teal-soft);
  padding: var(--space-md);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
}

/* Forms */
.form {
  max-width: 36rem;
  display: grid;
  gap: var(--space-md);
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
}

.form__input,
.form__select,
.form__textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-ink);
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 1px;
  border-color: var(--color-teal);
}

.form__textarea { min-height: 8rem; resize: vertical; }

.form__error {
  color: var(--color-error);
  font-size: 0.875rem;
  display: none;
}

.form__field.has-error .form__error { display: block; }
.form__field.has-error .form__input,
.form__field.has-error .form__select,
.form__field.has-error .form__textarea {
  border-color: var(--color-error);
}

.form__status {
  padding: var(--space-md);
  border-radius: var(--radius);
  display: none;
}

.form__status.is-success {
  display: block;
  background: #e6f4ed;
  color: var(--color-success);
}

.form__status.is-error {
  display: block;
  background: #fce8e8;
  color: var(--color-error);
}

.contact-aside {
  background: var(--color-teal-soft);
  padding: var(--space-lg);
  border-radius: var(--radius);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* Blog */
.post-list {
  display: grid;
  gap: var(--space-xl);
}

.post-card {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.post-card__img {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
}

.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__date {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin-bottom: var(--space-xs);
}

@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; }
}

.post-cover {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Curriculum timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--color-teal);
}

.timeline__item {
  position: relative;
  padding: 0 0 var(--space-lg) var(--space-lg);
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 0.35rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--color-copper);
  border: 2px solid var(--color-paper);
}

.timeline__time {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-teal);
  font-size: 0.95rem;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-paper);
  border-top: 2px solid var(--color-teal);
  box-shadow: 0 -8px 30px rgba(26, 43, 46, 0.12);
  padding: var(--space-md);
  animation: rise-in 0.45s var(--ease);
}

.cookie-banner[hidden] { display: none !important; }

.cookie-banner__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.cookie-banner__title {
  font-size: 1.05rem;
  margin-bottom: var(--space-xs);
}

.cookie-banner__text p {
  margin: 0;
  font-size: 0.95rem;
  max-width: 40rem;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Legal */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: var(--space-md) 0;
  overflow-x: auto;
  display: block;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--color-line);
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.legal-table th {
  background: var(--color-teal-soft);
  font-family: var(--font-display);
}

/* 404 */
.error-page {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 700;
  color: var(--color-teal);
  line-height: 1;
  margin-bottom: var(--space-md);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* CTA band */
.cta-band {
  background: var(--color-teal);
  color: #fff;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  margin-top: var(--space-xl);
}

.cta-band h2 { color: #fff; }
.cta-band p { opacity: 0.92; max-width: 32rem; margin-left: auto; margin-right: auto; }
