:root {
  --ink:#1b1f24; --muted:#5b6570; --brand:#0b7a5b; --bg:#f7f8f6; --card:#fff; --line:#e4e7e3;
  --brand-soft:#dff3ea;
  --brand-deep:#086148; --brand-edge:#065540; --brand-hi:#1aa37c; --wash:#eef6f2; --key-edge:#c6d6ce;
  --ad:#c23a43; --ad-edge:#9e2c34; --soon-bg:#eef0f2;
  --gd:#b45309; --sd:#db2777;
  /* KruaDee brand, from restaurant-system-management/DESIGN.md */
  --kd:#2563eb; --kd-deep:#1d4ed8; --kd-wash:#eff6ff; --kd-edge:#bfdbfe;
  --shadow: 0 1px 2px rgba(27,31,36,.06), 0 8px 24px rgba(27,31,36,.08);
  --shadow-lift: 0 2px 4px rgba(27,31,36,.06), 0 24px 48px rgba(27,31,36,.14);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin:0; font-family: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  color:var(--ink); line-height:1.7;
  background: radial-gradient(900px 520px at 85% -8%, #e3f2ec, rgba(227,242,236,0) 70%) no-repeat, var(--bg);
}
/* Thai words inside the English page: without this Windows falls back to a looped Thai face */
body [lang="th"] { font-family: "Noto Sans Thai", "Leelawadee UI", Leelawadee, system-ui, sans-serif; }
header, main, footer { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
header { padding-top: 16px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* Nav */
.navbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247,248,246,.82); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(228,231,227,.8);
}
.nav { max-width: 1040px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 44px; color: var(--ink); font-weight: 700; font-size: 1.05rem; text-decoration: none; letter-spacing: .2px; }
.brand b { color: var(--brand); font-weight: 700; }
.dd-logo { width: 36px; height: 36px; display: block; border-radius: 9px; box-shadow: 0 4px 12px rgba(11,122,91,.28); transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.brand:hover .dd-logo, .brand:focus-visible .dd-logo { transform: rotate(-8deg) scale(1.06); }
.nav ul { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav ul a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
/* Nav must stay one row (taller bar breaks the 76px scroll-margin). Breakpoints measured with a 15px
   scrollbar; Thai labels are wider, so each language has its own. Hidden links are repeated further down
   the page: #about right after the products, the articles in the #blog band. */
@media (max-width: 514px) { html[lang="th"] .nav-about { display: none; } }
@media (max-width: 419px) { html[lang="th"] .nav-blog { display: none; } }
@media (max-width: 634px) { html[lang="th"] .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
@media (max-width: 419px) { html[lang="en"] .nav-about { display: none; } }
@media (max-width: 544px) { html[lang="en"] .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
.nav ul a:hover { color: var(--brand); background: var(--brand-soft); }
/* Language switch: last nav item, bordered so it reads as a control, not a section link */
.nav ul .lang { min-width: 44px; justify-content: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line); }
/* Flags are inline SVG: Windows has no flag emoji (shows the letters "GB"/"TH") */
.flag { flex: none; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(27,31,36,.18); }
[id] { scroll-margin-top: 76px; }
::selection { background: var(--brand-soft); color: var(--ink); }
.skip { position: absolute; left: 12px; top: -80px; z-index: 20; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 600; }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 439px) { .nav ul a { padding: 0 10px; } }
@media (max-width: 359px) {
  .nav { padding: 8px 12px; gap: 6px; }
  .nav ul a { padding: 0 8px; }
}

/* Hero */
.hero { display: grid; gap: 8px; align-items: center; padding: 24px 0 8px; }
.hero > * { min-width: 0; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); line-height: 1.35; margin: 0 0 14px; }
h1 span { display: inline-block; } /* Thai has no spaces: keep each phrase on one line */
h1, h2, .who > div { overflow-wrap: anywhere; min-width: 0; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 34em; margin: 0 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 16px rgba(11,122,91,.25); transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(11,122,91,.3); }
.btn.ghost { background: var(--card); color: var(--brand); border: 1px solid var(--line); box-shadow: var(--shadow); }
.actions .btn { border-radius: 12px; } /* KruaDee button shape */
.btn.kd-btn { background: var(--kd); box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.btn.kd-btn:hover { box-shadow: 0 10px 22px rgba(37,99,235,.34); }
.btn.kd-btn:focus-visible { outline-color: var(--kd); }

/* 3D scene: decorative, aria-hidden */
.scene { position: relative; height: 290px; perspective: 1000px; perspective-origin: 50% 30%; overflow: hidden; }
.rig {
  position: absolute; inset: 0; margin: auto; width: 220px; height: 150px; translate: 6px 34px;
  transform-style: preserve-3d; transform: rotateX(56deg) rotateZ(-36deg);
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: rotateX(50deg) rotateZ(-26deg); } }
.floor {
  position: absolute; inset: -8%; border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(22% 26% at 27% 26%, rgba(29,78,216,.2), transparent),
    radial-gradient(22% 26% at 73% 26%, rgba(194,58,67,.18), transparent),
    radial-gradient(22% 26% at 27% 74%, rgba(180,83,9,.16), transparent),
    radial-gradient(22% 26% at 73% 74%, rgba(219,39,119,.16), transparent),
    repeating-linear-gradient(0deg, rgba(11,122,91,.09) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(90deg, rgba(11,122,91,.09) 0 1px, transparent 1px 20px),
    var(--wash);
}
.float {
  position: absolute; border-radius: 14px; transform-style: preserve-3d;
  transform: translateZ(var(--z)); animation: bob 7s ease-in-out infinite;
}
.float::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--edge, #c3d6cd); transform: translateZ(-8px);
}
@keyframes bob { 50% { transform: translateZ(calc(var(--z) + 14px)); } }
.face {
  position: absolute; inset: 0; border-radius: inherit; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 7px; padding-bottom: 9px;
}
.bar { flex: none; height: 22px; line-height: 22px; padding: 0 9px; border-radius: 13px 13px 0 0;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.tiles { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 9px; }
.tiles i { border-radius: 6px; background: var(--brand-soft); }
.tiles i:nth-child(2), .tiles i:nth-child(6) { background: #9fd6c1; }
.total { flex: none; height: 10px; width: 55%; margin: 0 9px 0 auto; border-radius: 5px; background: var(--brand-soft); }
.kd { left: 0; top: 0; width: 46%; height: 44%; --z: 60px; --edge: var(--kd-edge); }
.kd .bar { background: var(--kd); }
.kd .tiles i, .kd .total { background: var(--kd-wash); }
.kd .tiles i:nth-child(2), .kd .tiles i:nth-child(6) { background: var(--kd-edge); }
.apt { left: 54%; top: 0; width: 46%; height: 44%; --z: 96px; --edge: #e5c4c7; animation-delay: -3.5s; }
.apt .bar { background: var(--ad); }
.apt .tiles { grid-template-columns: repeat(4, 1fr); }
.apt .tiles i { background: var(--soon-bg); }
.apt .tiles i:nth-child(3n) { background: #f2c9cc; }
/* GarageDee: job tickets as rows; SuayDee: booking grid with booked slots */
.gd { left: 0; top: 56%; width: 46%; height: 44%; --z: 24px; --edge: #ecd3b8; animation-delay: -1.75s; }
.gd .bar { background: var(--gd); }
.gd .tiles { grid-template-columns: 1fr; gap: 5px; }
.gd .tiles i { background: var(--soon-bg); }
.gd .tiles i:first-child { background: #f5d6b4; }
.sd { left: 54%; top: 56%; width: 46%; height: 44%; --z: 60px; --edge: #f3c6dc; animation-delay: -5.25s; }
.sd .bar { background: var(--sd); }
.sd .tiles { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.sd .tiles i { background: var(--soon-bg); border-radius: 4px; }
.sd .tiles i:nth-child(2), .sd .tiles i:nth-child(4), .sd .tiles i:nth-child(8) { background: #f9c6de; }
.chip { width: 46px; height: 46px; animation-duration: 5s; }
.c1 { left: 66%; top: -36%; --z: 118px; --edge: var(--brand-deep); background: linear-gradient(135deg, var(--brand-hi), var(--brand)); }
.c1 svg { position: absolute; inset: 18%; width: 64%; height: 64%; }

/* Product cards */
.grid { display: grid; gap: 20px; margin: 28px 0 40px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  perspective: 1200px; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 24px 64px; box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
/* Product logos: inline SVG, 64x64 rounded tile + white glyph, one brand colour each */
.logo { flex: none; width: 44px; height: 44px; border-radius: 10px; display: block;
  transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.kd-card .logo { box-shadow: 0 6px 14px rgba(37,99,235,.3); }
.apt-card .logo { box-shadow: 0 6px 14px rgba(194,58,67,.3); }
.gd-card .logo { box-shadow: 0 6px 14px rgba(180,83,9,.3); }
.sd-card .logo { box-shadow: 0 6px 14px rgba(219,39,119,.3); }
.tag { display: inline-block; font-size: .8rem; padding: 2px 10px; border-radius: 999px; }
.tag.live { background: var(--brand-soft); color: var(--brand); }
.tag.soon { background: var(--soon-bg); color: var(--muted); }
.card h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.4; }
.card h2 a { color: var(--brand); text-decoration: none; }
.card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.card h2 a:focus-visible { outline: none; }
.card h2 a:focus-visible::after { outline: 3px solid var(--brand); outline-offset: 3px; }
.card p { margin: 0; color: var(--muted); }
/* KruaDee card in KruaDee's own look */
.kd-card .tag.live { background: var(--kd-wash); color: var(--kd-deep); }
.kd-card h2 a, .kd-card .go { color: var(--kd); }
.kd-card li::marker { color: var(--kd); }
.kd-card h2 a:focus-visible::after { outline-color: var(--kd); }
.apt-card h2 a, .apt-card .go { color: var(--ad); }
.apt-card h2 a:focus-visible::after { outline-color: var(--ad); }
.gd-card h2 a, .gd-card .go { color: var(--gd); }
.gd-card h2 a:focus-visible::after { outline-color: var(--gd); }
.sd-card h2 a, .sd-card .go { color: var(--sd); }
.sd-card h2 a:focus-visible::after { outline-color: var(--sd); }
.card ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); }
.card li + li { margin-top: 4px; }
.go {
  position: absolute; right: 20px; bottom: 18px; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line); color: var(--brand);
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.card:focus-within { transform: translateY(-4px) rotateX(5deg) rotateY(-5deg); box-shadow: var(--shadow-lift); }
.card:focus-within .logo { transform: translateY(-4px) rotate(-6deg) scale(1.06); }
@media (hover: hover) and (pointer: fine) {
  .card:has(h2 a):hover { transform: translateY(-4px) rotateX(5deg) rotateY(-5deg); box-shadow: var(--shadow-lift); }
  .card:has(h2 a):hover .logo { transform: translateY(-4px) rotate(-6deg) scale(1.06); }
  .card:hover .go { transform: translateX(4px); }
  .card:hover h2 a { text-decoration: underline; text-underline-offset: 3px; }
}

/* About */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  margin-bottom: 24px; box-shadow: var(--shadow); }
.panel > h2 { margin: 0 0 16px; font-size: 1.15rem; }
.who { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.who img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand-soft); flex: none; }
.who strong { display: block; font-size: 1.2rem; line-height: 1.3; }
.who span { color: var(--brand); font-weight: 600; font-size: .95rem; }
.about p { margin: 0 0 18px; color: var(--muted); }
.timeline { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; }
.timeline .yr { color: var(--brand); font-weight: 600; font-size: .9rem; padding-top: 2px; }
/* Tech stack as 3D keycaps on a tilted deck */
.deck { perspective: 1800px; padding: 8px 0 6px; } /* far camera: tilt without italic-looking skew at the edges */
.chips {
  display: flex; flex-wrap: wrap; gap: 12px 10px; margin: 0; padding: 18px; list-style: none;
  border-radius: 16px; background: linear-gradient(var(--wash), #e3efe9); border: 1px solid var(--line);
  box-shadow: inset 0 2px 6px rgba(27,31,36,.08);
  transform-style: preserve-3d;
}
.chips li {
  font-size: .85rem; font-weight: 600; line-height: 1; padding: 0; border-radius: 10px;
  color: var(--ink); background: linear-gradient(#fff, #f3f6f4); border: 1px solid #d5e2dc;
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 var(--key-edge), 0 7px 12px rgba(27,31,36,.14);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.chips a { /* whole keycap is the link, ≥44px tap target */
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  position: relative; color: inherit; text-decoration: none; border-radius: inherit;
}
.chips svg { width: 18px; height: 18px; flex: none; fill: var(--c); }
.chips svg.stroke { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chips li.key svg { fill: #fff; }
.chips li.key { /* languages stand out like accent keys */
  color: #fff; background: linear-gradient(var(--brand), var(--brand-deep)); border-color: var(--brand-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 0 var(--brand-edge), 0 7px 12px rgba(11,122,91,.3);
}
@media (hover: hover) and (pointer: fine) {
  .chips li:hover, .chips li:focus-within { transform: translateY(3px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 var(--key-edge), 0 2px 4px rgba(27,31,36,.14); }
  .chips li.key:hover, .chips li.key:focus-within { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 0 var(--brand-edge), 0 2px 4px rgba(11,122,91,.3); }
}

/* Blog band (developer zone) */
.learn > p { margin: 0 0 14px; color: var(--muted); }
.paths { list-style: none; margin: 0 0 18px; padding: 0; }
.paths li { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 0 2px; border-top: 1px solid var(--line); }
@media (min-width: 600px) { .paths li { flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; padding: 2px 0; } }
.paths li:last-child { border-bottom: 1px solid var(--line); }
.paths a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand); font-weight: 600; }

/* About: CV details collapsed so the product pitch stays short */
.cv summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; list-style: none; }
.cv summary::-webkit-details-marker { display: none; }
.cv summary::after { content: ""; width: 7px; height: 7px; margin: 0 2px 4px 12px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); rotate: 45deg; }
.cv[open] summary { margin-bottom: 18px; }
.cv[open] summary::after { rotate: 225deg; margin-bottom: -4px; }

/* Contact */
.contact-cols { display: grid; gap: 12px 32px; }
@media (min-width: 700px) { .contact-cols { grid-template-columns: 1fr 1fr; } }
.contact h3 { margin: 0 0 4px; font-size: 1rem; }
.contact .contact-cols p { margin: 0 0 10px; }
.links a.kd-link { color: var(--kd); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--brand); text-decoration: none; font-weight: 600; word-break: break-all; }
.links a:hover { background: var(--brand-soft); }
.contact p { margin: 0; color: var(--muted); }
.contact p a { color: var(--brand); }
.biz { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.biz address { font-style: normal; }
.biz dl { display: grid; gap: 0 16px; margin: 0 0 12px; }
.biz dt { color: var(--muted); font-size: .9rem; }
.biz dd { margin: 0 0 10px; overflow-wrap: anywhere; }
.biz dd a { display: inline-block; padding: 10px 0; color: var(--brand); }
.biz p + p { margin-top: 10px; }
.biz .dbd { margin: 0; }
.biz .dbd a { display: inline-block; vertical-align: top; }
.biz .dbd img { display: block; height: 56px; width: auto; }
/* /en/: one line under the product grid explaining the Thai names */
.gloss { margin: -20px 0 28px; color: var(--muted); font-size: .9rem; }
@media (min-width: 560px) { .biz dl { grid-template-columns: max-content 1fr; align-items: baseline; } .biz dd { margin: 0 0 6px; } }

footer { padding-bottom: 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand); }

@media (max-width: 599px) {
  .chip { display: none; }
  .rig { animation: none; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
}
@media (min-width: 820px) {
  header { padding-top: 24px; }
  .hero { grid-template-columns: 1.05fr 1fr; gap: 32px; padding: 40px 0 16px; }
  .scene { height: 440px; }
  .rig { width: 320px; height: 220px; translate: 0 40px; }
  .chip { width: 58px; height: 58px; }
  .chips { transform: rotateX(22deg); transform-origin: 50% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .card:focus-within, .card :is(.logo, .go),
  .brand .dd-logo, .btn:hover, .chips li { transform: none !important; }
}
