/* ============================================================
   TdevAi — shared stylesheet (index.html + work.html)
   ============================================================ */

:root {
  --brand: #0B6BF0;
  --brand-2: #2BA8FF;
  --brand-dark: #0A4FBE;
  --ink: #0B1F3A;
  --muted: #4A5568;
  --muted-2: #8A94A6;
  --line: #E8EEF7;
  --tag-bg: #EAF2FE;
  --soft: #F7F9FC;
  --bg: #FFFFFF;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 80, 180, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sarabun', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- links / buttons ---------- */

.link {
  color: var(--brand);
  font-weight: 600;
}
.link:hover { color: var(--brand-dark); }

.btn {
  display: inline-block;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.btn-solid {
  background: var(--brand);
  color: #FFFFFF;
}
.btn-solid:hover { background: var(--brand-dark); }
.btn-ghost {
  border: 1.5px solid #FFFFFF;
  color: #FFFFFF;
  padding: 12.5px 26.5px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-outline {
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-size: 14.5px;
  padding: 9px 20px;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

.eyebrow {
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--brand);
}

.card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-grad {
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand-dark) 100%);
}

/* ---------- logo ---------- */

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark { flex-shrink: 0; }
.logo-word {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-word .chip {
  background: var(--brand);
  color: #FFFFFF;
  font-size: 15px;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ---------- nav ---------- */

header.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #FFFFFF;
}
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.nav-top .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-secondary {
  background: var(--brand-dark);
  padding: 12px 0;
}
.nav-secondary .wrap { display: flex; gap: 32px; flex-wrap: wrap; }
.nav-secondary a {
  color: #FFFFFF;
  opacity: 0.92;
  font-weight: 500;
  font-size: 15px;
}
.nav-secondary a:hover { opacity: 1; }
.nav-secondary a.active { font-weight: 700; }

/* ---------- hero ---------- */

.hero {
  padding: 80px 0 72px;
  display: flex;
  align-items: center;
  gap: 40px;
  position: relative;
}
.hero .wrap { display: flex; align-items: center; gap: 40px; }
.hero-copy { flex: 1.05; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.14);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: #8FD9FF; display: inline-block;
}
.hero h1 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 46px;
  line-height: 1.2;
  color: #FFFFFF;
  margin: 0 0 20px;
}
.hero p.lead {
  font-size: 18px;
  line-height: 1.65;
  color: #DCEBFF;
  margin: 0 0 32px;
  max-width: 520px;
}
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-art { flex: 0.95; display: flex; justify-content: center; }
.hero-art svg { width: 100%; max-width: 420px; height: auto; overflow: visible; }

.hero-orbit {
  transform-origin: 220px 210px;
  animation: hero-orbit-spin 50s linear infinite;
}
.hero-glow {
  transform-origin: 220px 210px;
  animation: hero-glow-pulse 4s ease-in-out infinite;
}
.hero-core {
  transform-origin: 220px 210px;
  animation: hero-core-pulse 3s ease-in-out infinite;
}
.hero-twinkle {
  animation: hero-twinkle 2.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes hero-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes hero-glow-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}
@keyframes hero-core-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes hero-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orbit, .hero-glow, .hero-core, .hero-twinkle {
    animation: none;
  }
}
.scroll-chip {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  width: 46px; height: 46px;
  border-radius: 999px;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}

/* ---------- what I build ---------- */

.build {
  padding: 110px 0 80px;
  display: flex;
  gap: 56px;
  align-items: flex-start;
}
.build .wrap { display: flex; gap: 56px; align-items: flex-start; }
.build-copy { flex: 0.85; min-width: 260px; }
.build-copy h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 32px;
  margin: 14px 0 16px;
}
.build-copy p { font-size: 15.5px; line-height: 1.7; color: var(--muted); margin: 0 0 24px; }
.checklist { display: flex; flex-direction: column; gap: 14px; }
.checklist .item { display: flex; align-items: center; gap: 10px; }
.checklist .bullet {
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.checklist span.label { font-weight: 600; font-size: 15px; }

.build-cards { flex: 2; display: flex; gap: 24px; flex-wrap: wrap; }
.build-card {
  flex: 1; min-width: 180px;
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.build-card .icon {
  width: 60px; height: 60px; border-radius: 999px;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.build-card .title {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
}
.build-card .desc { font-size: 13.5px; line-height: 1.6; }

/* ---------- identity band ---------- */

.identity {
  margin: 0 24px;
  background: var(--brand-dark);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1152px;
  margin-left: auto;
  margin-right: auto;
}
.identity h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #FFFFFF;
  margin: 0 0 8px;
}
.identity p { font-size: 15px; color: #C9E2FF; margin: 0; }

/* ---------- projects (used on both pages) ---------- */

.projects { padding: 88px 0 96px; }
.projects .section-title { text-align: center; margin-bottom: 48px; }
.projects .section-title h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 34px;
  color: #FFFFFF;
  margin: 12px 0 0;
}
.projects .section-title .eyebrow { color: #BFE0FF; }

.project-grid { display: flex; flex-direction: column; gap: 32px; }
.project-card {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project-card .thumb { flex: 0 0 44%; padding: 28px; }
.project-card .thumb .slideshow { height: 260px; }
.project-card .thumb img { width: 100%; height: 260px; object-fit: cover; object-position: top; border-radius: 12px; }
.project-card.tall .thumb { display: flex; justify-content: center; }
.project-card.tall .thumb img { height: 260px; width: auto; object-fit: cover; object-position: top; }
.project-card .body { flex: 1; min-width: 0; padding: 32px 40px; }
.project-card h3 { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 21px; margin: 0 0 12px; }
.project-card p { font-size: 14.5px; line-height: 1.7; color: var(--muted); margin: 0 0 18px; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.projects .more-link { text-align: center; margin-top: 40px; }

/* ---------- CTA banner ---------- */

.cta-banner {
  margin: 80px 24px 0;
  max-width: 1152px;
  margin-left: auto; margin-right: auto;
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
}
.cta-banner h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #FFFFFF;
  margin: 0 0 14px;
}
.cta-banner p { font-size: 16px; color: #DCEBFF; margin: 0 0 28px; }

/* ---------- contact ---------- */

.contact-section { padding: 96px 0 40px; }
.contact-grid { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.contact-card {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
}
.contact-icon {
  width: 52px; height: 52px; border-radius: 999px;
  background: #FFFFFF; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.contact-label {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
}
.contact-value { font-size: 14px; color: var(--muted); margin-bottom: 20px; word-break: break-word; }
.contact-card .qr {
  width: 140px; height: 140px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ---------- footer ---------- */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted-2);
}
footer .wrap { display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: wrap; gap: 12px; }

/* ---------- page header (work.html) ---------- */

.page-header { padding: 64px 0 40px; }
.page-header h1 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 40px;
  margin: 22px 0 14px;
}
.page-header p { font-size: 17px; color: var(--muted); margin: 0; max-width: 620px; }

.case-study { padding: 0 0 32px; }
.case-study .card { overflow: hidden; }
.cs-head {
  padding: 36px 40px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.cs-head h2 { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: 25px; margin: 0; }
.cs-image { padding: 28px 40px 0; }
.cs-image img { border-radius: var(--radius-md); width: 100%; height: 360px; object-fit: cover; object-position: top; background: var(--soft); }
.cs-image.tall { display: flex; justify-content: center; }
.cs-image.tall img { height: 360px; width: auto; }
.cs-details {
  padding: 36px 40px 40px;
  display: flex; gap: 40px; flex-wrap: wrap;
}
.cs-details > div { flex: 1; min-width: 240px; }
.cs-details p { font-size: 15px; line-height: 1.7; color: var(--ink); margin: 0; }


.coming-soon {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 44px;
  text-align: center;
  margin-top: 8px;
}
.coming-soon .title { font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 17px; color: var(--muted-2); margin-top: 8px; }

/* ---------- image slideshow (crossfade, real app-demo footage) ---------- */

.slideshow {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--soft);
  aspect-ratio: 480 / 945;
  height: 220px;
  margin: 0 auto;
}
.slideshow.lg { height: 360px; }
.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 0;
}
.slideshow .slide { opacity: 0; animation: tt-cycle 25s ease-in-out infinite; }
.slideshow .slide:nth-child(1) { animation-name: tt-cycle-1; }
.slideshow .slide:nth-child(2) { animation-name: tt-cycle-2; }
.slideshow .slide:nth-child(3) { animation-name: tt-cycle-3; }
.slideshow .slide:nth-child(4) { animation-name: tt-cycle-4; }
.slideshow .slide:nth-child(5) { animation-name: tt-cycle-5; }

@keyframes tt-cycle-1 { 0%{opacity:0;} 3%{opacity:1;} 17%{opacity:1;} 20%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-cycle-2 { 0%,20%{opacity:0;} 23%{opacity:1;} 37%{opacity:1;} 40%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-cycle-3 { 0%,40%{opacity:0;} 43%{opacity:1;} 57%{opacity:1;} 60%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-cycle-4 { 0%,60%{opacity:0;} 63%{opacity:1;} 77%{opacity:1;} 80%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-cycle-5 { 0%,80%{opacity:0;} 83%{opacity:1;} 97%{opacity:1;} 100%{opacity:0;} }

@media (prefers-reduced-motion: reduce) {
  .slideshow .slide { animation: none; }
  .slideshow .slide:first-child { opacity: 1; }
}

/* ---------- diagram slideshow (4-step spotlight, no photo available) ---------- */

.slideshow.frames4 {
  aspect-ratio: auto;
  height: 220px;
  padding: 18px;
  box-sizing: border-box;
}
.cs-image .slideshow.frames4 { height: 360px; padding: 32px; }
.slideshow .slide-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: inherit;
  box-sizing: border-box;
}
.slideshow .slide-frame svg { width: 100%; height: auto; max-height: 100%; display: block; }

.slideshow.frames4 .slide:nth-child(1) { animation-name: tt-doc-1; }
.slideshow.frames4 .slide:nth-child(2) { animation-name: tt-doc-2; }
.slideshow.frames4 .slide:nth-child(3) { animation-name: tt-doc-3; }
.slideshow.frames4 .slide:nth-child(4) { animation-name: tt-doc-4; }
.slideshow.frames4 .slide { animation-duration: 20s; }

@keyframes tt-doc-1 { 0%{opacity:0;} 3%{opacity:1;} 22%{opacity:1;} 25%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-doc-2 { 0%,25%{opacity:0;} 28%{opacity:1;} 47%{opacity:1;} 50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-doc-3 { 0%,50%{opacity:0;} 53%{opacity:1;} 72%{opacity:1;} 75%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-doc-4 { 0%,75%{opacity:0;} 78%{opacity:1;} 97%{opacity:1;} 100%{opacity:0;} }

/* ---------- photo slideshow, 7 frames (real product screenshots) ---------- */

.slideshow.frames7 { aspect-ratio: auto; height: 220px; }
.cs-image .slideshow.frames7 { height: 360px; }
.slideshow.frames7 .slide:nth-child(1) { animation-name: tt-erp7-1; }
.slideshow.frames7 .slide:nth-child(2) { animation-name: tt-erp7-2; }
.slideshow.frames7 .slide:nth-child(3) { animation-name: tt-erp7-3; }
.slideshow.frames7 .slide:nth-child(4) { animation-name: tt-erp7-4; }
.slideshow.frames7 .slide:nth-child(5) { animation-name: tt-erp7-5; }
.slideshow.frames7 .slide:nth-child(6) { animation-name: tt-erp7-6; }
.slideshow.frames7 .slide:nth-child(7) { animation-name: tt-erp7-7; }
.slideshow.frames7 .slide { animation-duration: 28s; }

@keyframes tt-erp7-1 { 0%{opacity:0;} 1.71%{opacity:1;} 12.43%{opacity:1;} 14.29%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-2 { 0%,14.29%{opacity:0;} 16.00%{opacity:1;} 26.71%{opacity:1;} 28.57%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-3 { 0%,28.57%{opacity:0;} 30.29%{opacity:1;} 41.00%{opacity:1;} 42.86%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-4 { 0%,42.86%{opacity:0;} 44.57%{opacity:1;} 55.29%{opacity:1;} 57.14%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-5 { 0%,57.14%{opacity:0;} 58.86%{opacity:1;} 69.57%{opacity:1;} 71.43%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-6 { 0%,71.43%{opacity:0;} 73.14%{opacity:1;} 83.86%{opacity:1;} 85.71%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp7-7 { 0%,85.71%{opacity:0;} 87.43%{opacity:1;} 98.14%{opacity:1;} 100%{opacity:0;} }

/* ---------- photo slideshow, 2 frames (real product screenshots) ---------- */

.slideshow.frames2 { aspect-ratio: auto; height: 220px; }
.cs-image .slideshow.frames2 { height: 360px; }
.slideshow.frames2 .slide:nth-child(1) { animation-name: tt-erp2-1; }
.slideshow.frames2 .slide:nth-child(2) { animation-name: tt-erp2-2; }
.slideshow.frames2 .slide { animation-duration: 8s; }

@keyframes tt-erp2-1 { 0%{opacity:0;} 1.71%{opacity:1;} 48.14%{opacity:1;} 50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-erp2-2 { 0%,50%{opacity:0;} 51.71%{opacity:1;} 98.14%{opacity:1;} 100%{opacity:0;} }

/* ---------- diagram slideshow, 8 frames (services overview, no client screenshots) ---------- */

.slideshow.frames8 {
  aspect-ratio: auto;
  height: 220px;
  padding: 18px;
  box-sizing: border-box;
}
.cs-image .slideshow.frames8 { height: 360px; padding: 32px; }
.slideshow.frames8 .slide:nth-child(1) { animation-name: tt-svc-1; }
.slideshow.frames8 .slide:nth-child(2) { animation-name: tt-svc-2; }
.slideshow.frames8 .slide:nth-child(3) { animation-name: tt-svc-3; }
.slideshow.frames8 .slide:nth-child(4) { animation-name: tt-svc-4; }
.slideshow.frames8 .slide:nth-child(5) { animation-name: tt-svc-5; }
.slideshow.frames8 .slide:nth-child(6) { animation-name: tt-svc-6; }
.slideshow.frames8 .slide:nth-child(7) { animation-name: tt-svc-7; }
.slideshow.frames8 .slide:nth-child(8) { animation-name: tt-svc-8; }
.slideshow.frames8 .slide { animation-duration: 32s; }

@keyframes tt-svc-1 { 0%{opacity:0;} 1.71%{opacity:1;} 10.64%{opacity:1;} 12.50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-2 { 0%,12.50%{opacity:0;} 14.21%{opacity:1;} 23.14%{opacity:1;} 25.00%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-3 { 0%,25.00%{opacity:0;} 26.71%{opacity:1;} 35.64%{opacity:1;} 37.50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-4 { 0%,37.50%{opacity:0;} 39.21%{opacity:1;} 48.14%{opacity:1;} 50.00%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-5 { 0%,50.00%{opacity:0;} 51.71%{opacity:1;} 60.64%{opacity:1;} 62.50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-6 { 0%,62.50%{opacity:0;} 64.21%{opacity:1;} 73.14%{opacity:1;} 75.00%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-7 { 0%,75.00%{opacity:0;} 76.71%{opacity:1;} 85.64%{opacity:1;} 87.50%{opacity:0;} 100%{opacity:0;} }
@keyframes tt-svc-8 { 0%,87.50%{opacity:0;} 89.21%{opacity:1;} 98.14%{opacity:1;} 100%{opacity:0;} }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero .wrap { flex-direction: column; text-align: left; }
  .hero-art { order: -1; margin-bottom: 8px; }
  .hero-art svg { max-width: 280px; }
  .hero h1 { font-size: 36px; }
  .build .wrap { flex-direction: column; }
  .build-cards { flex-direction: column; }
  .identity { flex-direction: column; text-align: center; padding: 40px 28px; }
  .project-card { flex-direction: column; align-items: stretch; }
  .project-card .thumb { flex: none; padding: 20px 20px 0; }
  .project-card .body { padding: 24px 26px 28px; }
  .cs-details { flex-direction: column; }
  footer .wrap { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .nav-secondary .wrap { gap: 18px; }
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 30px; }
  .page-header h1 { font-size: 32px; }
  .identity h2 { font-size: 19px; }
  .cta-banner { padding: 40px 24px; margin: 64px 16px 0; }
  .cta-banner h2 { font-size: 24px; }
}
