/* ============================================================
   康格酥研究 Kanggesu — Stylesheet
   Ported from the React/Tailwind build to plain HTML/CSS/JS.
   Brand accent: #D0FF59 · Ink: #0A0A0A
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --green: #D0FF59;
  --ink: #0A0A0A;
  --near-black: #141414;
  --white: #FFFFFF;
  --light-gray: #F7F7F7;
  --mid-gray: #888888;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.12);

  --maxw: 1280px;
  --nav-h: 72px;

  /* CJK-aware font stack: Latin/numerals fall to Inter, Chinese to Noto Sans TC */
  --font-sans: "Inter", "Noto Sans TC", system-ui, -apple-system, "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  --font-display: "Space Grotesk", "Inter", "Noto Sans TC", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; word-break: keep-all; }

::selection { background: rgba(208, 255, 89, 0.4); color: var(--ink); }

/* ---------- Typography scale (CJK line-heights softened) ---------- */
.t-display-xl { font-size: clamp(48px, 8vw, 112px); font-weight: 500; line-height: 1.04; letter-spacing: 0; }
.t-display-l  { font-size: clamp(40px, 6vw, 84px);  font-weight: 500; line-height: 1.08; letter-spacing: 0; }
.t-h2 { font-size: clamp(30px, 4.5vw, 60px); font-weight: 600; line-height: 1.14; letter-spacing: 0; }
.t-h3 { font-size: clamp(22px, 3vw, 38px);   font-weight: 600; line-height: 1.2;  letter-spacing: 0; }
.t-h4 { font-size: clamp(19px, 2vw, 26px);   font-weight: 600; line-height: 1.3; }
.t-body-large { font-size: 18px; font-weight: 400; line-height: 1.8; }
.t-body       { font-size: 16px; font-weight: 400; line-height: 1.7; }
.t-body-small { font-size: 14px; font-weight: 400; line-height: 1.6; }
.t-label {
  font-size: 12px; font-weight: 600; line-height: 1.4;
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section    { padding-top: clamp(72px, 10vh, 128px); padding-bottom: clamp(72px, 10vh, 128px); }
.section-lg { padding-top: clamp(96px, 14vh, 168px); padding-bottom: clamp(96px, 14vh, 168px); }
.bg-white { background: var(--white); }
.bg-gray  { background: var(--light-gray); }
.bg-ink   { background: var(--ink); }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-12 { margin-top: 48px; }
.max-640 { max-width: 640px; } .max-600 { max-width: 600px; } .max-720 { max-width: 720px; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50px; padding: 14px 32px;
  background: var(--green); color: var(--ink);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover { transform: scale(1.03); box-shadow: 0 4px 24px rgba(208, 255, 89, .35); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50px; padding: 14px 32px;
  background: transparent; color: var(--white);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  border: 1.5px solid rgba(255, 255, 255, .4);
  transition: all .3s ease;
}
.btn-secondary:hover { border-color: var(--white); background: rgba(255, 255, 255, .08); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 15px; color: var(--ink);
  transition: color .2s ease;
}
.text-link svg { transition: transform .2s ease; }
.text-link:hover { color: var(--green); }
.text-link:hover svg { transform: translateX(4px); }
.text-link.on-dark { color: var(--green); }

/* ---------- Eyebrow ---------- */
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.eyebrow .line { display: inline-block; height: 1px; width: 40px; background: var(--mid-gray); }
.eyebrow .lab  { color: var(--mid-gray); }
.eyebrow.light .line { background: rgba(255, 255, 255, .5); }
.eyebrow.light .lab  { color: rgba(255, 255, 255, .6); }

/* ---------- Noise grain overlay ---------- */
.noise { position: relative; }
.noise::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .4; animation: grain 8s steps(10) infinite;
}

/* ============================================================
   NAV / HEADER
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  background: transparent;
  transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.nav .row { width: 100%; display: flex; align-items: center; justify-content: space-between; }

.logo { display: inline-flex; align-items: baseline; font-weight: 700; font-size: 22px; z-index: 110; gap: 1px; }
.logo .a { color: var(--green); transition: color .3s ease; }
.logo .b { color: var(--white); transition: color .3s ease; }
/* On the white/blurred scrolled header, acid-green fails contrast — ink the whole wordmark */
.nav.scrolled .logo .a { color: var(--ink); }
.nav.scrolled .logo .b { color: var(--ink); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  position: relative; font-weight: 500; font-size: 15px; letter-spacing: .01em;
  color: var(--white); transition: color .2s ease;
}
.nav.scrolled .nav-links a { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav-links a:hover { color: var(--green); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--green); }

.nav-cta {
  display: inline-flex; align-items: center; border-radius: 50px; padding: 11px 26px;
  font-weight: 600; font-size: 14px; transition: all .2s ease;
  background: var(--green); color: var(--ink);
}
.nav-cta:hover { transform: scale(1.03); box-shadow: 0 4px 20px rgba(208, 255, 89, .3); }
.nav.scrolled .nav-cta { background: var(--ink); color: var(--green); }
.nav.scrolled .nav-cta:hover { box-shadow: var(--shadow-card-hover); }

.hamburger { display: none; z-index: 110; padding: 8px; color: var(--white); }
.nav.scrolled .hamburger { color: var(--ink); }
.hamburger svg { display: block; }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90; background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu a { font-weight: 600; font-size: 26px; color: var(--ink); }
.mobile-menu a.active { color: var(--green); }
.mobile-menu .btn-primary { margin-top: 16px; }

/* ============================================================
   HERO  (cinematic pinned scroll)
   ============================================================ */
.hero {
  position: relative; width: 100%; height: 100vh; height: 100svh;
  overflow: hidden; background: var(--ink);
  perspective: 1000px;
}
.hero-img {
  position: absolute; inset: 0; z-index: 1;
  background-size: cover; background-position: center;
  transform-style: preserve-3d; will-change: transform, filter;
}
.hero-vignette {
  position: absolute; inset: 0;
  /* Kept light at rest for legibility; cinematic dimming happens on scroll.
     To remove entirely, delete this rule or set background:none. */
  background: radial-gradient(ellipse 95% 75% at 50% 44%,
    rgba(10, 10, 10, .06) 0%, rgba(10, 10, 10, .40) 100%);
}
.hero .noise-layer {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .35; animation: grain 8s steps(10) infinite;
}
.hero-content {
  position: relative; z-index: 10; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px; transform-style: preserve-3d;
}
.hero-eyebrow { color: rgba(255, 255, 255, .6); letter-spacing: .14em; margin-bottom: 22px; }
.hero h1 { color: var(--white); max-width: 980px; text-shadow: 0 2px 20px rgba(0, 0, 0, .45); will-change: transform, opacity; }
.hero p { color: rgba(255, 255, 255, .85); max-width: 580px; margin-top: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; justify-content: center; }
.hero-stamps { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 54px; justify-content: center; }
.stamp {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 13px 20px;
}
.stamp .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.stamp span.txt { font-weight: 500; font-size: 14px; color: var(--white); }

/* char-split scaffolding (shared) */
.split-wrap { display: inline-block; overflow: hidden; vertical-align: top; }
.char-inner, .char-inner-left, .char-inner-right { display: inline-block; will-change: transform, opacity; }
.word-wrap { display: inline-block; overflow: hidden; vertical-align: top; }
.word-inner { display: inline-block; will-change: transform, opacity; }

/* ============================================================
   LOGO MARQUEE
   ============================================================ */
.marquee-sec { width: 100%; padding: 40px 0; background: var(--white); border-top: 1px solid rgba(0, 0, 0, .05); overflow: hidden; }
.marquee-row { display: flex; gap: 80px; width: max-content; }
.marquee-row.left  { animation: marquee-left 30s linear infinite; margin-bottom: 24px; }
.marquee-row.right { animation: marquee-right 25s linear infinite; }
.marquee-row span {
  font-size: 24px; font-weight: 700; color: rgba(136, 136, 136, .45);
  white-space: nowrap; flex-shrink: 0; user-select: none; transition: color .3s ease;
}
.marquee-row span:hover { color: rgba(136, 136, 136, .8); }

/* ============================================================
   ABOUT OVERVIEW
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 64px; margin-top: 48px; align-items: center; }
.about-text p { color: var(--ink); margin-bottom: 24px; }
.stat-cluster { position: relative; }
.stat-cluster .photo { border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; }
.stat-cluster .photo img { width: 100%; height: 100%; object-fit: cover; }
.stat-card {
  position: absolute; border-radius: 18px; padding: 16px 20px; min-width: 132px;
  box-shadow: var(--shadow-card); z-index: 10; will-change: transform, opacity;
}
.stat-card.green { background: var(--green); color: var(--ink); }
.stat-card.dark  { background: var(--ink); color: var(--white); }
.stat-card .num { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat-card .lab { font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .8; margin-top: 4px; }
.stat-card.p0 { top: -16px; left: -16px; }
.stat-card.p1 { top: -16px; right: -16px; }
.stat-card.p2 { bottom: -16px; left: -16px; }
.stat-card.p3 { bottom: -16px; right: -16px; }

/* ============================================================
   SERVICES
   ============================================================ */
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
.service-card {
  background: var(--white); border-radius: 20px; padding: 40px;
  border: 1px solid rgba(0, 0, 0, .05); cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  will-change: transform, opacity;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-card-hover); border-color: rgba(208, 255, 89, .35); }
.service-card .ico { color: var(--ink); }
.service-card h4 { color: var(--ink); margin-top: 24px; }
.service-card .desc {
  color: var(--mid-gray); margin-top: 12px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .35s ease, opacity .35s ease, margin-top .35s ease;
}
.service-card:hover .desc { max-height: 240px; opacity: 1; }
.center-cta { text-align: center; margin-top: 48px; }

/* ============================================================
   INDUSTRIES (bento)
   ============================================================ */
.bento { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 48px; }
.panel {
  position: relative; border-radius: 20px; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease; will-change: transform, opacity;
}
.panel:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.panel.large { padding: 40px; }
.panel.small { padding: 28px; }
.panel.dark { background: var(--ink); color: var(--white); }
.panel.lite { background: var(--light-gray); color: var(--ink); }
.panel .pico.green { color: var(--green); }
.panel .pico.ink   { color: var(--ink); }
.panel h3, .panel h4 { margin-top: 16px; }
.panel p { margin-top: 8px; }
.panel.dark p { color: rgba(255, 255, 255, .7); }
.panel.lite p { color: var(--mid-gray); }
.panel .more {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 16px;
  font-size: 14px; font-weight: 500;
}
.panel.dark .more { color: var(--green); }
.panel.lite .more { color: var(--ink); }

/* ============================================================
   PROJECTS (dark)
   ============================================================ */
.proj-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
.proj-card {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; display: block;
  will-change: transform, opacity;
}
.proj-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.proj-card:hover img { transform: scale(1.05); }
.proj-card .overlay {
  position: absolute; inset: 0; z-index: 2; transition: opacity .3s ease;
  background: linear-gradient(to top, rgba(10, 10, 10, .85) 0%, rgba(10, 10, 10, .3) 45%, transparent 100%);
}
.proj-card:hover .overlay { opacity: .95; }
.proj-card .pc-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 32px; transition: transform .3s ease; }
.proj-card:hover .pc-body { transform: translateY(-4px); }
.proj-card .pc-body h3 { color: var(--white); }
.proj-card .pc-body p { color: rgba(255, 255, 255, .72); margin-top: 8px; }
.proj-card .pc-body .view { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--green); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.tg { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
.tcard {
  background: var(--white); border-radius: 18px; padding: 36px;
  border: 1px solid rgba(0, 0, 0, .05); border-left: 4px solid var(--green);
  transition: transform .3s ease, box-shadow .3s ease; will-change: transform, opacity;
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.tcard .qmark { font-size: clamp(40px, 6vw, 72px); line-height: 1; color: rgba(208, 255, 89, .35); user-select: none; }
.tcard .quote { color: var(--ink); font-style: italic; margin-top: -10px; line-height: 1.8; }
.tcard .person { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.tcard .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--light-gray); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; color: var(--ink); flex-shrink: 0; }
.tcard .pname { font-weight: 600; font-size: 14px; color: var(--ink); }
.tcard .ptitle { font-size: 14px; color: var(--mid-gray); }

/* ============================================================
   BLOG
   ============================================================ */
.blog-head { display: flex; flex-direction: column; gap: 16px; }
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 48px; }
.blog-card {
  background: var(--white); border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .05);
  transition: transform .3s ease, box-shadow .3s ease; will-change: transform, opacity;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.blog-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.blog-card:hover .thumb img { transform: scale(1.05); }
.blog-card .bc-body { padding: 24px; }
.blog-card .date { color: var(--mid-gray); }
.blog-card h4 { color: var(--ink); margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   CONTACT CTA
   ============================================================ */
.cta-sec { position: relative; overflow: hidden; }
.cta-glow {
  position: absolute; top: 50%; left: 50%; width: 600px; height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(208, 255, 89, .07) 0%, transparent 70%);
  animation: pulse-glow 8s ease-in-out infinite; pointer-events: none; z-index: 1;
}
.cta-inner { position: relative; z-index: 10; text-align: center; max-width: 720px; margin: 0 auto; }
.cta-inner h2 { color: var(--white); }
.cta-inner p { color: rgba(255, 255, 255, .72); margin-top: 24px; }
.cta-inner .btn-primary { margin-top: 40px; padding: 16px 40px; font-size: 16px; }

/* ============================================================
   FOOTER  (social icons removed)
   ============================================================ */
.footer { background: var(--ink); position: relative; }
.footer .container { padding-top: 80px; padding-bottom: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.footer-col .logo { font-size: 21px; }
.footer-col .logo .b { color: var(--white); }
.footer-brand p { margin-top: 16px; font-size: 14px; color: var(--mid-gray); line-height: 1.8; max-width: 300px; }
.footer-col h4 { color: var(--mid-gray); margin-bottom: 20px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a { font-size: 14px; color: var(--mid-gray); transition: color .2s ease; }
.footer-col ul a:hover { color: var(--white); }
.footer-bottom {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(128, 128, 128, .2);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.footer-bottom p { font-size: 13px; color: var(--mid-gray); }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes marquee-left  { 0% { transform: translateX(0); }     100% { transform: translateX(-50%); } }
@keyframes marquee-right { 0% { transform: translateX(-50%); }  100% { transform: translateX(0); } }
@keyframes pulse-glow {
  0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: .06; }
  50%      { transform: translate(-50%, -50%) scale(1.1); opacity: .09; }
}
@keyframes grain {
  0%, 100% { background-position: 0% 0%; }
  10% { background-position: -5% -10%; }   20% { background-position: -15% 5%; }
  30% { background-position: 7% -25%; }     40% { background-position: 20% 25%; }
  50% { background-position: -25% 10%; }    60% { background-position: 15% 5%; }
  70% { background-position: 0% 15%; }      80% { background-position: 25% 35%; }
  90% { background-position: -10% 10%; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .bento  { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .tg { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .bento  { grid-template-columns: repeat(4, 1fr); }
  .blog-grid { grid-template-columns: repeat(4, 1fr); }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .panel.col2 { grid-column: span 2; }
}
@media (max-width: 1023px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: inline-flex; }
  .stat-cluster { margin: 0 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .marquee-row { animation: none; }
  .cta-glow, .noise::before, .hero .noise-layer { animation: none; }
}
