/* ATER Studio — สไตล์หลัก
   สี ระยะห่าง และขนาดตัวอักษร เก็บเป็น CSS variables ที่ :root แก้ที่นี่ที่เดียวเพื่อเปลี่ยนทั้งเว็บ */
:root {
  /* สี: จานสีหลักจากภาพทะเล (ใช้ cyan และ aqua เป็นสีตกแต่งเท่านั้น ห้ามใช้เป็นสีตัวอักษรบนพื้นขาว/อ่อน) */
  --mint: #ACE7E3;
  --aqua: #79DAE1;
  --cyan: #16B2C1;
  --steel: #3B7B9F;
  --mist: #F1F2F6;         /* พื้นหลังเว็บ */
  /* เฉดเสริมที่สร้างจากจานสี */
  --ink: #10324A;          /* หัวข้อและตัวอักษรเข้ม น้ำเงินเข้มอมฟ้าเหล็ก */
  --ink-2: #2D4A5E;        /* เนื้อความ */
  --muted: #4A6678;        /* ข้อความรอง (คอนทราสต์ >= 4.5:1 บน mist และขาว) */
  --steel-deep: #2D6485;   /* ปุ่มหลัก ลิงก์ ป้ายหัวข้อ */
  --steel-ink: #1F5273;
  --mint-soft: #E6F6F5;    /* พื้นไอคอน ป้าย แคปซูลเมนู */
  --aqua-soft: #DDF4F7;
  --line: #D3E6EB;         /* เส้นขอบบาง */
  --line-2: #E4F0F3;
  --card: #FFFFFF;
  --bg: var(--mist);
  --footer-bg: #10324A;    /* พื้นส่วนท้ายเว็บ */
  --footer-ink: #C9E3EA;
  --footer-muted: #9FC2CF;
  --danger: #A83A2E;
  --ok: #176B44;
  /* ชื่อเดิมที่โค้ดส่วนอื่นยังอ้างถึง ชี้ไปที่ตัวแปรใหม่ */
  --teal: var(--steel-deep);
  --teal-deep: #234F6E;
  --teal-2: var(--steel);
  --teal-soft: var(--mint-soft);
  --teal-softer: #F3FAFA;
  /* ระยะห่าง (จังหวะสม่ำเสมอ) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 104px;
  /* รูปทรง */
  --r-sm: 12px; --r: 20px; --r-lg: 28px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(16, 50, 74, .05), 0 10px 26px -14px rgba(45, 100, 133, .22);
  --shadow-up: 0 2px 4px rgba(16, 50, 74, .05), 0 22px 40px -18px rgba(45, 100, 133, .34);
  /* ตัวอักษร */
  --font: "IBM Plex Sans", "Mali", sans-serif; /* ละตินใช้ IBM Plex Sans (ไม่มีอักษรไทย) ตัวอักษรไทยตกมาใช้ Mali อัตโนมัติ */
  --fs-body: 1.0625rem;
  --fs-small: .9rem;
  --fs-h1: clamp(2.6rem, 6.2vw, 4.5rem);
  --fs-h2: clamp(1.7rem, 3.4vw, 2.3rem);
  --fs-h3: 1.1875rem;
  --maxw: 1080px;
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-body); line-height: 1.7; color: var(--ink-2);
  background:
    radial-gradient(900px 480px at 88% -8%, rgba(172, 231, 227, .45) 0%, rgba(172, 231, 227, 0) 70%),
    radial-gradient(700px 420px at -6% 28%, rgba(121, 218, 225, .18) 0%, rgba(121, 218, 225, 0) 70%),
    linear-gradient(180deg, var(--mist) 0%, #EEF4F7 55%, var(--mist) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); }
h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); line-height: 1.35; font-weight: 700; }
h2 { font-size: var(--fs-h2); line-height: 1.35; font-weight: 600; }
h3 { font-size: var(--fs-h3); line-height: 1.5; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-pill); z-index: 100; }
.skip:focus { left: 8px; }
.container { width: min(100% - 2 * var(--s5), var(--maxw)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- navbar ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .78); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line-2); }
.nav-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--nav-h); gap: var(--s4); }
.logo { font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; color: var(--teal); text-decoration: none; justify-self: start; min-height: 44px; display: inline-flex; align-items: center; }
.logo:hover { color: var(--teal-deep); }
.menu { display: flex; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill); color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; transition: color .2s, background .2s; }
.menu a:hover { color: var(--ink); background: var(--teal-softer); }
.menu a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--teal-soft); }
.nav-end { justify-self: end; display: flex; gap: var(--s2); align-items: center; }
.lang { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 600 .82rem var(--font); cursor: pointer; transition: border-color .2s, transform .2s; }
.lang:hover { border-color: var(--teal); }
.burger { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.burger svg { width: 20px; height: 20px; }
.burger .x { display: none; }
.burger[aria-expanded="true"] .x { display: block; }
.burger[aria-expanded="true"] .bars { display: none; }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-pill); border: 1px solid var(--teal); background: var(--teal); color: #fff; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; transition: background .2s, transform .2s, box-shadow .2s; box-shadow: 0 6px 16px -8px rgba(31, 106, 120, .55); }
.btn:hover { background: var(--teal-deep); color: #fff; transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); background: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn.small { min-height: 44px; padding: 0 var(--s4); font-size: .95rem; }

/* ---------- hero ---------- */
.hero { padding: var(--s8) 0 var(--s7); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s7); align-items: center; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: var(--s4); }
.hero h1 .l2 { display: block; color: var(--teal-2); }
.hero p.lead { margin-top: var(--s5); max-width: 36em; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.hero-card { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-up); transform: rotate(1.4deg); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.hero-card:hover { transform: rotate(0deg) translateY(-3px); }
.hc-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); letter-spacing: .04em; }
.hc-top .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--teal-2); margin-right: 8px; }
.hero-card h3 { font-size: 1.35rem; margin: var(--s5) 0 var(--s4); line-height: 1.4; }
.bars span { display: block; height: 9px; border-radius: 9px; background: var(--line-2); margin-bottom: 10px; }
.bars span:nth-child(2) { width: 86%; } .bars span:nth-child(3) { width: 58%; }
.hc-box { margin-top: var(--s5); background: var(--teal-soft); border-radius: var(--r-sm); padding: var(--s4) var(--s5); }
.hc-box b { color: var(--ink); display: block; font-size: 1rem; }
.hc-box small { color: var(--muted); font-size: .85rem; }

/* ---------- section ---------- */
.section { padding: var(--s7) 0 var(--s8); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: var(--s6); margin-bottom: var(--s6); flex-wrap: wrap; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: var(--s2); }
.sec-head p.side { max-width: 26em; color: var(--muted); font-size: .98rem; }
.grid { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid.three { grid-template-columns: repeat(3, 1fr); }

.card { position: relative; display: flex; flex-direction: column; gap: var(--s3); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); border-color: #bcd6db; }
.card .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: 1.3rem; }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { margin-top: var(--s1); }
.card p.d { font-size: .95rem; color: var(--muted); line-height: 1.7; flex: 1; }
.card .more { font-weight: 600; color: var(--ink); font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.card .more svg { width: 16px; height: 16px; transition: transform .25s; }
.card:hover .more svg { transform: translateX(4px); }
.tag { align-self: flex-start; font-size: .68rem; font-weight: 600; letter-spacing: .12em; color: var(--teal); background: var(--teal-soft); border-radius: var(--r-pill); padding: 4px 12px; text-transform: uppercase; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.card .act { margin-top: var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); }
.card.soon { border-style: dashed; background: var(--teal-softer); box-shadow: none; }
.card.soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.embed-wrap { display: flex; justify-content: center; max-width: 100%; overflow: hidden; border-radius: var(--r-sm); }
.embed-wrap iframe { max-width: 100%; border: 0; }

/* ---------- page head ---------- */
.page-head { padding: var(--s8) 0 var(--s5); }
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 18em; }
.page-head p.lead { margin-top: var(--s4); max-width: 38em; color: var(--muted); }
.group { margin-bottom: var(--s8); }
.group-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.group-head h2 { font-size: 1.35rem; white-space: nowrap; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s7); align-items: start; }
.about-grid h2 { margin-bottom: var(--s4); }
.about-grid .body p + p { margin-top: var(--s4); }
.interests { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.interests .card { padding: var(--s4); gap: var(--s2); }
.interests .card h3 { font-size: 1rem; }

.contact { margin-top: var(--s8); background: #fff; border: 1px solid #cfe6ea; border-radius: var(--r-lg); padding: var(--s7); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); box-shadow: var(--shadow); }
.contact h2 { margin: var(--s3) 0 var(--s3); font-size: clamp(1.6rem, 3vw, 2.1rem); }
.contact .sub { color: var(--muted); }
.clist { list-style: none; padding: 0; margin: var(--s5) 0; display: grid; gap: var(--s3); }
.clist li { display: flex; align-items: center; gap: var(--s3); }
.clist .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.clist .ic svg { width: 20px; height: 20px; }
.clist a { color: var(--ink); font-weight: 500; text-decoration: none; word-break: break-all; }
.clist a:hover { color: var(--teal); text-decoration: underline; }
.social { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); background: #fff; transition: all .2s; }
.social:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; }
form.msg { display: grid; gap: var(--s4); align-content: start; }
.field label { display: block; font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--teal-softer); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; min-height: 48px; transition: border-color .2s, background .2s; }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: 3px solid rgba(31, 106, 120, .25); border-color: var(--teal); background: #fff; }
.field.bad input, .field.bad textarea { border-color: var(--danger); background: #fff8f7; }
.help { min-height: 1.2em; font-size: .85rem; color: var(--danger); margin-top: 4px; }
.count { text-align: right; font-size: .8rem; color: var(--muted); }
.status { background: var(--teal-softer); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s4); font-size: .95rem; display: none; gap: var(--s3); }
.status.show { display: grid; }
.status .row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.status small { color: var(--muted); }
.status code { background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 8px; color: var(--ink); user-select: all; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-2); padding: var(--s6) 0; color: var(--muted); font-size: .9rem; background: rgba(255, 255, 255, .5); }
.footer .container { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }

/* ---------- 404 ---------- */
.nf { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: var(--s8) 0; }
.nf .big { font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; color: var(--teal-2); line-height: 1; letter-spacing: -.04em; }
.nf h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: var(--s4) 0; }
.nf p { color: var(--muted); max-width: 30em; margin-inline: auto; }
.nf .cta { justify-content: center; }

/* ---------- skeleton ---------- */
.skeleton { pointer-events: none; }
.sk { border-radius: 8px; background: linear-gradient(90deg, #eaf2f4 0%, #f5fafb 50%, #eaf2f4 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- animation เมื่อเลื่อนมาถึง ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero-card { transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: var(--s7) 0 var(--s6); }
  .hero-grid, .about-grid, .contact { grid-template-columns: 1fr; }
  .contact { padding: var(--s5); gap: var(--s6); }
  .grid.three { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
}
@media (max-width: 760px) {
  .nav-in { grid-template-columns: 1fr auto; }
  .burger { display: inline-flex; }
  .menu { position: absolute; left: 0; right: 0; top: var(--nav-h); flex-direction: column; background: rgba(255, 255, 255, .97); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding: var(--s3) var(--s5) var(--s5); display: none; }
  .menu.open { display: flex; }
  .menu a { min-height: 52px; font-size: 1.05rem; }
  .nav-in nav { display: contents; }
  .interests { grid-template-columns: 1fr; }
  .sec-head { align-items: start; }
  .group-head h2 { white-space: normal; }
}

/* ---------- ประกาศและสถานะใน hero card (หน้าแรก) ---------- */
.hc-box + .hc-box { margin-top: var(--s3); }
.hc-label { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: var(--s2); }
.hc-body { display: grid; gap: var(--s2); }
.hc-ann .t { color: var(--ink); font-weight: 600; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.hc-ann .x { color: var(--ink-2); font-size: .92rem; line-height: 1.65; overflow-wrap: anywhere; }
.hc-ann .dt { color: var(--muted); font-size: .8rem; }
.hc-ann a.more-link { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-deep); font-weight: 600; font-size: .92rem; }
.st-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.st-row .st-txt { color: var(--ink-2); font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; flex: 1 1 8em; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-badge { font-size: .74rem; font-weight: 600; border-radius: var(--r-pill); padding: 2px 10px; white-space: nowrap; }
.st-working .st-dot { background: #2b8a98; } .st-working .st-badge { background: #d3eaee; color: #134a55; }
.st-away .st-dot { background: #d98a00; } .st-away .st-badge { background: #fbe9bd; color: #6b4000; }
.st-available .st-dot { background: #1d9a5f; } .st-available .st-badge { background: #d6f0e2; color: #0f5233; }
.st-busy .st-dot { background: #4a5b63; } .st-busy .st-badge { background: #dde3e6; color: #263238; }

/* =====================================================================
   ธีมสีทะเล (v2): ปรับดีไซน์ให้ละเอียดขึ้น โครงหน้าและเนื้อหาเดิม
   (เวอร์ชันนี้ไม่มีลวดลายคลื่นแล้ว ใช้เส้นตรงบางและดาวทองแทน)
   ===================================================================== */
a:hover { color: var(--steel-ink); }
:focus-visible { outline: 3px solid var(--steel-deep); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(121, 218, 225, .45); }
h1, h2 { font-weight: 700; letter-spacing: -.015em; }
h3 { font-weight: 600; }
.skip { background: var(--ink); }
.nav { background: rgba(255, 255, 255, .72); border-bottom-color: var(--line); }
.logo { color: var(--steel-deep); }
.menu a:hover { color: var(--ink); background: var(--mint-soft); }
.menu a[aria-current="page"] { background: var(--mint-soft); box-shadow: inset 0 0 0 1px rgba(121, 218, 225, .55); }
.lang, .burger { transition: border-color .2s, background .2s, box-shadow .2s, transform .2s; }
.lang:hover, .burger:hover { border-color: var(--steel); background: var(--mint-soft); box-shadow: 0 4px 12px -6px rgba(45, 100, 133, .4); }
.btn { background: var(--steel-deep); border-color: var(--steel-deep); box-shadow: 0 8px 18px -10px rgba(45, 100, 133, .65); transition: background .2s, transform .2s, box-shadow .2s, border-color .2s; }
.btn:hover { background: var(--teal-deep); border-color: var(--teal-deep); box-shadow: 0 12px 22px -12px rgba(45, 100, 133, .7); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--mint-soft); border-color: var(--steel); color: var(--steel-ink); }

/* hero และหัวหน้าอื่น: ไล่เฉดจากขาวไปมิ้นต์จาง */
.hero, .page-head { position: relative; isolation: isolate; }
.hero { background: linear-gradient(180deg, #FFFFFF 0%, #EEF9F9 100%); border-bottom: 1px solid var(--line); }
.page-head { background: linear-gradient(180deg, #FFFFFF 0%, #EEF9F9 100%); border-bottom: 1px solid var(--line); padding-bottom: var(--s7); margin-bottom: 0; }
.hero h1 .l2, .hero h1 .l2[data-i18n] { color: var(--steel); }
.hero p.lead, .page-head p.lead { color: var(--muted); }
.badge, .eyebrow { color: var(--steel-deep); }
.hero-card { border-color: var(--line); box-shadow: var(--shadow-up); }
.hc-top .dot { background: var(--cyan); }
.hc-box { background: var(--mint-soft); border: 1px solid rgba(121, 218, 225, .4); }
.hc-label { color: var(--steel-deep); }
.hc-box b { color: var(--ink); }
.hc-ann a.more-link { color: var(--steel-ink); }

/* การ์ด: เส้นขอบบางสีฟ้าจาง เงานุ่ม แถบเน้นไล่เฉด mint → aqua ด้านบนตอน hover */
.card { border-color: var(--line); overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--mint), var(--aqua)); opacity: 0; transform: scaleX(.55); transform-origin: left center; transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.card:hover { border-color: #B7DCE4; }
.card:hover::before, a.card:focus-visible::before { opacity: 1; transform: scaleX(1); }
.card.soon::before, .card.skeleton::before, .jr-brief.card::before { display: none; }
.card .ic, .clist .ic { background: var(--mint-soft); color: var(--steel-deep); border: 1px solid rgba(121, 218, 225, .45); }
.card .more { color: var(--steel-ink); }
.tag { background: var(--mint-soft); color: var(--steel-ink); border: 1px solid rgba(121, 218, 225, .5); }
.card.soon { background: var(--aqua-soft); }

/* หัวกลุ่มในหน้าผลงาน: เส้นตรงบาง */
.grid.fx { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s5); }
.grid.fx > .card { flex: 0 1 calc((100% - 2 * var(--s5)) / 3); min-width: 0; }

/* ส่วนติดต่อ */
.contact { border-color: rgba(121, 218, 225, .55); background: linear-gradient(180deg, #fff 0%, #FBFEFE 100%); }
.field input, .field textarea { background: var(--mist); border-color: var(--line); }
.field input:focus, .field textarea:focus { outline: 3px solid rgba(45, 100, 133, .28); border-color: var(--steel-deep); background: #fff; }
.social:hover { background: var(--steel-deep); border-color: var(--steel-deep); }
.status { background: var(--aqua-soft); border-color: rgba(121, 218, 225, .6); }
.help { color: var(--danger); }

/* จุดสถานะบนหน้าแรก (มีป้ายข้อความกำกับเสมอ) */
.st-working .st-dot { background: var(--steel); } .st-working .st-badge { background: #D4E5F0; color: #1B4A68; }
.st-away .st-dot { background: #D98A00; } .st-away .st-badge { background: #FBE9BD; color: #6B4000; }
.st-available .st-dot { background: #1D9A5F; } .st-available .st-badge { background: #D6F0E2; color: #0F5233; }
.st-busy .st-dot { background: #8C5656; } .st-busy .st-badge { background: #EBDADA; color: #5A2F2F; }
.sk { background: linear-gradient(90deg, #DDEFF1 0%, #F1F9FA 50%, #DDEFF1 100%); background-size: 200% 100%; }

/* ส่วนท้ายเว็บ: พื้นสีเข้มจากจานสี */
.footer { position: relative; margin-top: var(--s8); background: var(--footer-bg); color: var(--footer-ink); border-top: 0; padding: var(--s6) 0 var(--s7); }

@media (max-width: 900px) { .grid.fx > .card { flex-basis: calc((100% - var(--s5)) / 2); } }
@media (max-width: 620px) { .grid.fx > .card { flex-basis: 100%; } .hero::before { height: 45%; } }
@media (prefers-reduced-motion: reduce) { .card::before { transition: none; } }

/* =====================================================================
   ฟอนต์: ตัวอักษรไทยใช้ Mali ส่วนละติน/ตัวเลขใช้ IBM Plex Sans (ดู --font ที่ :root)
   ปรับให้อ่านง่ายสำหรับฟอนต์ลายมือ: เนื้อหา >= 16px, น้ำหนัก >= 400, ไม่ใช้ letter-spacing กว้างกับข้อความไทย
   ===================================================================== */
h1, h2, h3, h4 { letter-spacing: 0; }
.card p.d, .sec-head p.side, .hc-ann .x, .st-row .st-txt, .menu a { font-size: 1rem; }
.logo { white-space: nowrap; }
html[lang="th"] .badge, html[lang="th"] .hc-label, html[lang="th"] .eyebrow[data-i18n] { letter-spacing: .02em; text-transform: none; }
html[lang="th"] .tag { letter-spacing: .05em; }
@media (max-width: 480px) { .logo { font-size: 1.05rem; letter-spacing: .05em; } }

/* ---------- หน้าผลงาน: Online Tools แบ่งส่วนย่อย + การ์ด New Experiments ---------- */
.subgroup + .subgroup { margin-top: var(--s7); }
.sub-h { font-size: 1.3rem; color: var(--ink); margin-bottom: var(--s1); }
.sub-d { color: var(--muted); margin-bottom: var(--s5); }
.grid.duo { display: grid; grid-template-columns: 1fr; gap: var(--s5); }
@media (min-width: 768px) { .grid.duo { grid-template-columns: repeat(2, 1fr); } }
.grid.duo > .card { min-width: 0; }
.soon-pill { align-self: flex-start; display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--aqua-soft); color: var(--steel-ink); border: 1px dashed rgba(45, 100, 133, .45); font-weight: 600; font-size: .95rem; }
.card.is-soon { background: #FBFEFE; }
.card.is-soon:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.card.is-soon:hover::before { opacity: 0; }

/* ---------- ปุ่มโซเชียลในส่วนติดต่อ (หน้าเกี่ยวกับ) ---------- */
.follow { margin-top: var(--s2); }
.follow-l { font-size: .95rem; font-weight: 600; color: var(--muted); margin-bottom: var(--s2); }
.socials { display: flex; flex-wrap: wrap; gap: var(--s3); }
.socials .social[hidden] { display: none; }
.social { width: 48px; height: 48px; flex: none; background: var(--mint-soft); color: var(--ink); border: 1px solid rgba(121, 218, 225, .6); transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s; }
.social svg { width: 22px; height: 22px; }
.social:hover { background: var(--steel); border-color: var(--steel); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 16px -10px rgba(45, 100, 133, .6); }
.social:focus-visible { outline: 3px solid var(--steel-deep); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(121, 218, 225, .45); }

/* =====================================================================
   จัดขึ้นบรรทัดของหัวข้อและคำอธิบาย (หน้าแรก, เครื่องมือ, ผลงาน, เกี่ยวกับ)
   ข้อความใน i18n.js ใช้ "\n" คั่นบรรทัด และใช้ textContent ตามเดิม ส่วน white-space: pre-line ทำให้ "\n" เป็นจุดขึ้นบรรทัดใหม่
   ถ้าจอแคบเกินบรรทัดที่กำหนด จะตัดตามธรรมชาติภายในบรรทัดนั้น (ใช้ clamp() ลดขนาดตัวอักษรก่อน)
   ===================================================================== */
.hero h1 [data-i18n="hero.l1"] { display: block; white-space: pre-line; }
.hero h1 .l2 { white-space: pre-line; }
.page-head h1, .page-head p.lead { white-space: pre-line; max-width: none; }
h1, h2 { text-wrap: balance; }
.hero p.lead, .page-head p.lead, .sec-head p.side { text-wrap: pretty; }
html[lang="th"] h1, html[lang="th"] p.lead, html[lang="th"] h2 { overflow-wrap: normal; word-break: normal; }
/* หัวข้อใหญ่หน้าแรกภาษาอังกฤษ: ให้ "Organize your thoughts" อยู่บรรทัดเดียวในคอลัมน์ซ้ายของ hero (ภาษาไทยคงขนาดเดิม) */
html[lang="en"] .hero h1 { font-size: clamp(1.9rem, 3.8vw, 2.8rem); line-height: 1.3; }
@media (max-width: 900px) { html[lang="en"] .hero h1 { font-size: clamp(1.9rem, 7vw, 3.2rem); } }

/* ---------- การ์ด LINE: ตารางรูปเล็กในการ์ดใบเดียว + การซ่อนกลุ่มที่ไม่มีรายการ ---------- */
.card .ic[hidden], .group[hidden] { display: none; }
.card .shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.card .shots[data-n="1"] { grid-template-columns: 1fr; }
.card .shots[data-n="3"] { grid-template-columns: repeat(3, 1fr); }
.card .shots img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; background: var(--teal-softer); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.card .shots[data-n="1"] img { aspect-ratio: auto; }
.card-link { cursor: pointer; }
.card-link:hover .btn { background: var(--teal-deep); transform: translateY(-1px); }


/* =====================================================================
   v3: ปรับดีไซน์ให้เป็นเครือเดียวกับ ATER Article
   (เส้นหยัก/คลื่นถูกถอดออกหมดแล้ว ใช้เส้นตรงบาง ดาวทองจากโลโก้ และมุมโค้งมนแทน)
   รูปตกแต่งอยู่ที่ assets/images (star8.svg, sparkle4.svg, m-*.webp, ater-logo-arch.webp)
   ===================================================================== */
:root { --gold: #E3A52B; --r: 24px; --r-lg: 30px; --shadow-soft: 0 1px 2px rgba(16, 50, 74, .04), 0 12px 30px -16px rgba(45, 100, 133, .28); }

/* ----- navbar: โลโก้ซ้าย เมนูและปุ่มภาษาชิดขวา (เหมือน ATER Article) ----- */
.nav { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16, 50, 74, .02); }
.nav-in { display: flex; align-items: center; gap: var(--s4); }
.nav-in nav { margin-left: auto; }
.logo { gap: 10px; letter-spacing: .04em; }
.logo-mark { display: block; height: 46px; width: auto; flex: none; }
.logo-t { color: var(--steel-deep); font-weight: 700; }
.logo-s { font-weight: 500; color: var(--steel); letter-spacing: .02em; }
.nav-end { margin-left: 0; }
.menu a[aria-current="page"] { background: var(--mint); color: var(--ink); font-weight: 600; box-shadow: none; }
.menu a:hover { background: var(--mint-soft); }
.menu .menu-ext a { border: 1px solid var(--line); background: #fff; color: var(--steel-ink); gap: 6px; }
.menu .menu-ext a:hover { border-color: var(--steel); background: var(--mint-soft); }
.menu .menu-ext svg, .f-links svg { width: 14px; height: 14px; flex: none; }
.lang { width: auto; min-width: 52px; padding: 0 var(--s4); border-radius: var(--r-pill); }

/* ----- หัวข้อ: ดาวทองเล็ก ๆ ด้านหน้า (แบบเดียวกับเว็บบทความ) และเส้นแบ่งตรงบาง ----- */
.sec-head h2::before, .group-head h2::before { content: ""; display: inline-block; width: .6em; height: .6em; margin-right: .5em; vertical-align: .08em; background: url(../images/sparkle4.svg) center / contain no-repeat; }
.group-head hr { flex: 1; border: 0; margin: 0; height: 1px; background: var(--line); opacity: 1; }

/* ----- การ์ด / ปุ่ม: มุมโค้งมน เงาบาง ----- */
.card { border-radius: var(--r); box-shadow: var(--shadow-soft); }
.hero-card { border-radius: var(--r-lg); position: relative; }
.contact { border-radius: var(--r-lg); position: relative; }

/* ----- hero / หัวหน้า: ดาวทองประปราย (ไม่ทับข้อความ) ----- */
.hero::before, .page-head::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-repeat: no-repeat; opacity: .9;
  background-image: url(../images/sparkle4.svg), url(../images/star8.svg), url(../images/sparkle4.svg), url(../images/sparkle4.svg), url(../images/star8.svg);
  background-size: 26px, 20px, 16px, 18px, 12px;
  background-position: 49% 88%, 3% 11%, 52% 9%, 96% 94%, 41% 76%; }
.page-head::before { background-position: 62% 24%, 2% 16%, 90% 80%, 47% 88%, 78% 12%; background-size: 22px, 16px, 18px, 14px, 12px; }
@media (max-width: 900px) {
  .hero::before, .page-head::before { background-image: url(../images/sparkle4.svg), url(../images/star8.svg); background-size: 18px, 14px; background-position: 96% 6%, 92% 97%; }
}

/* ----- ภาพวงกลมจากโลโก้ (medallion) ----- */
.med { display: block; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--mint), 0 8px 18px -8px rgba(16, 50, 74, .35); background: var(--mint-soft); }
.hero-med { position: absolute; top: -30px; right: 22px; width: 52px; height: 52px; }
.nf-med { width: 104px; height: 104px; margin: 0 auto var(--s5); }
@media (min-width: 901px) {
  .page-head::after { content: ""; position: absolute; z-index: -1; pointer-events: none; top: 50%; right: max(var(--s5), calc((100% - var(--maxw)) / 2)); width: 108px; height: 108px; margin-top: -42px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--mint), var(--shadow); background: center / cover no-repeat; }
  body[data-page="tools"] .page-head::after { background-image: url(../images/m-books.webp); }
  body[data-page="works"] .page-head::after { background-image: url(../images/m-apple.webp); }
  body[data-page="about"] .page-head::after { background-image: url(../images/m-cat.webp); }
  .contact::after { content: ""; position: absolute; top: -30px; right: 36px; width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--mint), 0 8px 18px -8px rgba(16, 50, 74, .35); background: url(../images/m-dove.webp) center / cover no-repeat; pointer-events: none; }
}

/* ----- ผลงานจากครีเอเตอร์: การ์ดสองใบดีไซน์เดียวกัน ----- */
.group.slot { display: contents; margin: 0; }
.group.slot[hidden] { display: none; }
.group.slot > .grid { display: contents; }
.creator-grid > .card { min-width: 0; }
.art-card .act, .creator-grid .card-link .act { margin-top: auto; }
.art-card p.d { flex: 0 0 auto; }
.art-visual { position: relative; flex: 1 1 auto; min-height: 240px; border-radius: var(--r-sm); background: linear-gradient(135deg, var(--mint) 0%, var(--aqua) 58%, #8ED0E2 100%); border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden; padding: var(--s5) 0; }
.art-visual img { display: block; height: 210px; width: auto; max-width: 70%; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(16, 50, 74, .28)); }
.art-visual::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: url(../images/sparkle4.svg) no-repeat, url(../images/star8.svg) no-repeat, url(../images/sparkle4.svg) no-repeat; background-size: 20px, 14px, 16px; background-position: 14% 18%, 88% 24%, 80% 84%; opacity: .95; }

/* ----- หน้า About: โลโก้กรอบโค้งข้างข้อความ ----- */
.about-intro { display: grid; grid-template-columns: 140px 1fr; gap: var(--s6); align-items: start; }
.about-logo { margin: 0; width: 140px; padding: 6px; background: var(--mint); border-radius: 70px 70px 16px 16px; box-shadow: var(--shadow); overflow: hidden; }
.about-logo img { display: block; width: 100%; height: auto; }
@media (max-width: 640px) { .about-intro { grid-template-columns: 1fr; } .about-logo { width: 128px; border-radius: 64px 64px 14px 14px; } }

/* ----- ส่วนท้ายเว็บ: จัดวางแบบเดียวกับ ATER Article ----- */
.footer { position: relative; isolation: isolate; overflow: hidden; margin-top: var(--s8); padding: var(--s7) 0 var(--s5); background: var(--footer-bg); color: var(--footer-ink); border-top: 0; font-size: 1rem; }
.footer .container { display: block; }
.footer::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .32; background-repeat: no-repeat;
  background-image: url(../images/star8.svg), url(../images/sparkle4.svg), url(../images/sparkle4.svg), url(../images/star8.svg);
  background-size: 22px, 14px, 18px, 12px; background-position: 31% 26%, 63% 14%, 97% 9%, 22% 88%; }
.footer::after { content: ""; position: absolute; z-index: -1; pointer-events: none; right: max(24px, calc((100% - var(--maxw)) / 2)); bottom: -36px; width: 210px; height: 262px; opacity: .1; background: url(../images/ater-logo-arch.webp) center / contain no-repeat; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); }
.f-logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; text-decoration: none; }
.f-logo:hover { color: #fff; }
.f-logo img { display: block; height: 50px; width: auto; }
.f-tag { margin-top: var(--s3); color: var(--footer-muted); max-width: 24em; }
.f-col h4 { color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: var(--s3); }
.f-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.f-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--footer-ink); text-decoration: none; }
.f-links a:hover { color: #fff; text-decoration: underline; }
.f-links a[hidden] { display: none; }
.f-bottom { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid rgba(201, 227, 234, .18); color: var(--footer-muted); font-size: .9rem; }
@media (max-width: 760px) {
  .footer-in { grid-template-columns: 1fr 1fr; gap: var(--s6); }
  .f-brand { grid-column: 1 / -1; }
  .footer::after { width: 150px; height: 187px; opacity: .08; }
}

/* ----- navbar บนมือถือ ----- */
@media (max-width: 760px) {
  .nav-in { display: flex; }
  .logo { margin-right: auto; }
  .logo-mark { height: 42px; }
  .menu { background: #fff; }
  .menu .menu-ext a { justify-content: flex-start; }
  .nav-in nav { margin-left: 0; }
  .hero-med { right: 18px; }
}
