/* ucloud.co.th — colours taken from the logo (cyan → blue → navy). */
:root {
    --cyan: #1cc4ef;
    --blue: #1565d8;
    --navy: #1a237e;
    --ink: #0e1838;
    --text: #2b3553;
    --muted: #64708f;
    --line: #e3e9f4;
    --bg: #ffffff;
    --bg-soft: #f4f8fd;
    --bg-tint: #eaf3fd;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(14, 24, 56, 0.05), 0 12px 32px -12px rgba(14, 24, 56, 0.16);
    --gradient: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 55%, var(--navy) 100%);
    --shell: 1160px;
    --gutter: 24px;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: 'Kanit', 'IBM Plex Sans Thai', sans-serif;
    color: var(--ink);
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
}

p {
    margin: 0;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

:focus-visible {
    outline: 3px solid rgba(21, 101, 216, 0.45);
    outline-offset: 3px;
    border-radius: 8px;
}

.shell {
    width: 100%;
    max-width: calc(var(--shell) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 100;
}

.skip:focus {
    left: 8px;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.site-header.scrolled {
    border-bottom-color: var(--line);
}

.site-header .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: 0.01em;
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    height: 40px;
    width: auto;
    mix-blend-mode: multiply;
}

.brand small {
    display: block;
    font-family: 'IBM Plex Sans Thai', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0;
    line-height: 1.2;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    color: var(--text);
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 999px;
}

.nav a:hover {
    background: var(--bg-soft);
    text-decoration: none;
}

.nav a.btn {
    margin-left: 6px;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 16px;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--gradient);
    color: #fff !important;
    box-shadow: 0 10px 24px -10px rgba(21, 101, 216, 0.7);
}

.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink) !important;
}

.btn-ghost:hover {
    border-color: #c9d6ea;
}

.nav a.btn-primary {
    height: 40px;
    padding: 0 18px;
    font-size: 15px;
}

.nav a.btn-primary:hover {
    background: var(--gradient);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 88px;
    background:
        radial-gradient(900px 420px at 88% -10%, rgba(28, 196, 239, 0.16), transparent 70%),
        radial-gradient(700px 380px at -10% 110%, rgba(26, 35, 126, 0.08), transparent 70%),
        var(--bg);
}

.hero .shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 56px;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--blue);
    background: var(--bg-tint);
    border: 1px solid #d3e5fb;
    padding: 4px 14px;
    border-radius: 999px;
}

.kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient);
}

.hero h1 {
    margin-top: 20px;
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 600;
    letter-spacing: -0.005em;
}

.hero h1 .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lead {
    margin-top: 20px;
    font-size: 18px;
    color: var(--muted);
    max-width: 34em;
}

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

.hero-visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 460px;
    width: 100%;
    justify-self: end;
}

.hero-visual .disc {
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f0f7ff 55%, #e2efff 100%);
    box-shadow: inset 0 0 0 1px #dbe8fb, 0 30px 80px -30px rgba(21, 101, 216, 0.45);
}

.hero-visual .logo {
    position: absolute;
    inset: 22% 18% 26% 18%;
    width: 64%;
    height: auto;
    mix-blend-mode: multiply;
}

.chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    font-size: 14px;
    line-height: 1.35;
    color: var(--ink);
    white-space: nowrap;
}

.chip b {
    display: block;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
}

.chip span {
    color: var(--muted);
    font-size: 12px;
}

.chip .dot {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    flex: none;
}

.chip-1 {
    top: 6%;
    left: -4%;
}

.chip-2 {
    top: 46%;
    right: -6%;
}

.chip-3 {
    bottom: 4%;
    left: 6%;
}

/* ---------- Sections ---------- */

section.block {
    padding: 96px 0;
}

section.block.soft {
    background: var(--bg-soft);
}

.section-head {
    max-width: 680px;
    margin-bottom: 48px;
}

.section-head .eyebrow {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blue);
}

.section-head h2 {
    margin-top: 8px;
    font-size: clamp(28px, 3.6vw, 38px);
}

.section-head p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 17px;
}

/* Products */

.products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.product {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product:hover {
    transform: translateY(-3px);
    box-shadow: 0 1px 2px rgba(14, 24, 56, 0.05), 0 20px 44px -16px rgba(14, 24, 56, 0.22);
}

.product-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product .icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    flex: none;
}

.product h3 {
    font-size: 22px;
}

.product .tag {
    font-size: 13px;
    color: var(--muted);
}

.product p.desc {
    margin-top: 16px;
    color: var(--text);
}

.product ul {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 15px;
}

.product li {
    position: relative;
    padding-left: 22px;
}

.product li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0.72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 3px rgba(28, 196, 239, 0.18);
}

.product .link {
    margin-top: auto;
    padding-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    align-self: flex-start;
}

.icon.t-tguard {
    background: linear-gradient(135deg, #1cc4ef, #1565d8);
}

.icon.t-gov {
    background: linear-gradient(135deg, #3a4fd1, #1a237e);
}

.icon.t-shop {
    background: linear-gradient(135deg, #12b3a6, #1565d8);
}

.icon.t-sayplay {
    background: linear-gradient(135deg, #f08bb0, #c2457a);
}

/* Services */

.services {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.service {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}

.service .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-tint);
    color: var(--blue);
}

.service h3 {
    margin-top: 16px;
    font-size: 18px;
}

.service p {
    margin-top: 8px;
    font-size: 15px;
    color: var(--muted);
}

/* About */

.about {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: start;
}

.about .text p + p {
    margin-top: 14px;
}

.about .text p {
    font-size: 17px;
}

.facts {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.facts .facts-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
}

.facts .facts-head img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    object-fit: contain;
    padding: 4px;
}

.facts .facts-head b {
    display: block;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.35;
}

.facts .facts-head span {
    color: var(--muted);
    font-size: 14px;
}

.facts dl {
    margin: 0;
    padding: 8px 24px 16px;
}

.facts dl div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.facts dl div:last-child {
    border-bottom: 0;
}

.facts dt {
    color: var(--muted);
}

.facts dd {
    margin: 0;
    color: var(--ink);
}

/* Contact */

.contact {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 56px;
    background: var(--gradient);
    color: #fff;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.contact::after {
    content: '';
    position: absolute;
    right: -120px;
    top: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%);
    pointer-events: none;
}

.contact h2 {
    color: #fff;
    font-size: clamp(28px, 3.4vw, 36px);
}

.contact p.sub {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 17px;
}

.contact-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    padding: 14px 18px;
    color: #fff;
    transition: background 0.15s;
}

a.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.contact-item .icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    flex: none;
}

.contact-item small {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.3;
}

.contact-item b {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.45;
    word-break: break-word;
}

/* ---------- Footer ---------- */

.site-footer {
    padding: 56px 0 40px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
}

.site-footer .cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}

.site-footer .brand {
    font-size: 18px;
}

.site-footer p.addr {
    margin-top: 12px;
    max-width: 32em;
}

.site-footer h4 {
    margin: 0 0 10px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    color: var(--ink);
    font-size: 15px;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.site-footer ul a {
    color: var(--muted);
}

.site-footer ul a:hover {
    color: var(--blue);
}

.site-footer .bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}

/* ---------- Document pages (privacy) ---------- */

.doc {
    padding: 56px 0 88px;
}

.doc .shell {
    max-width: calc(820px + var(--gutter) * 2);
}

.doc h1 {
    margin-top: 16px;
    font-size: clamp(30px, 4vw, 42px);
}

.doc .meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
}

.doc .body {
    margin-top: 32px;
}

.doc .body h2 {
    font-size: 22px;
    margin: 40px 0 12px;
}

.doc .body p,
.doc .body li {
    font-size: 16px;
}

.doc .body p + p {
    margin-top: 12px;
}

.doc .body ul {
    margin: 10px 0 0;
    padding-left: 22px;
    display: grid;
    gap: 6px;
}

.doc .note {
    margin-top: 24px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 15px;
}

/* ---------- Reveal on scroll ---------- */
/* Hidden only once site.js runs, so the page reads fine without it. */

.js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.in {
    opacity: 1;
    transform: none;
}

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

    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn,
    .product {
        transition: none;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .hero {
        padding: 48px 0 64px;
    }

    .hero .shell,
    .about,
    .contact {
        grid-template-columns: 1fr;
    }

    .hero .shell {
        gap: 40px;
    }

    .hero-visual {
        justify-self: center;
        max-width: 380px;
    }

    .products {
        grid-template-columns: 1fr;
    }

    .contact {
        padding: 40px 28px;
    }

    .site-footer .cols {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer .cols > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .menu-toggle {
        display: inline-flex;
    }

    .nav {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px var(--gutter) 20px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 20px 30px -20px rgba(14, 24, 56, 0.25);
        display: none;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .nav a.btn {
        margin: 8px 0 0;
        height: 48px;
    }
}

@media (max-width: 560px) {
    :root {
        --gutter: 16px;
    }

    section.block {
        padding: 64px 0;
    }

    .section-head {
        margin-bottom: 32px;
    }

    .services {
        grid-template-columns: 1fr;
    }

    .product {
        padding: 22px;
    }

    .hero .actions .btn {
        flex: 1 1 100%;
    }

    .chip {
        font-size: 13px;
        padding: 8px 10px;
    }

    .chip .dot {
        width: 28px;
        height: 28px;
    }

    .chip-1 {
        left: 0;
    }

    .chip-2 {
        right: 0;
    }

    .facts dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .site-footer .cols {
        grid-template-columns: 1fr;
    }
}
