/* functionalcoatings.sg v2 — structure follows the Framer spec, built on the site's own stack. */

@font-face { font-family: Manrope; src: url("../fonts/manrope-regular.ttf") format("truetype");   font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-medium.ttf") format("truetype");    font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-semibold.ttf") format("truetype");  font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-bold.ttf") format("truetype");      font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --deep:      #0b1524;
  --panel:     #132134;
  --panel-2:   #16263c;
  --line-dark: rgba(255, 255, 255, .12);

  --ink:       #152338;
  --ink-soft:  #51627a;
  --light:     #ffffff;
  --light-2:   #f2f5f8;
  --line:      #dde4ec;

  --on-dark:       #eef3f9;
  --on-dark-soft:  #93a4bb;

  --accent-1: #7b3fe4;
  --accent-2: #e23c6d;
  --accent-grad: linear-gradient(90deg, var(--accent-1) 0%, #b23a9f 50%, var(--accent-2) 100%);

  --shell: 1200px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 98px; }

body {
  margin: 0;
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--on-dark);
  background: var(--deep);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.shell-narrow { max-width: 920px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 21, 36, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-dark);
}

.header-inner { display: flex; align-items: center; gap: 28px; height: 84px; }

.brand { flex: 0 0 auto; }
.brand img { height: 52px; width: auto; }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  font-size: 15px; font-weight: 500; text-decoration: none;
  color: var(--on-dark-soft); transition: color .15s;
}
.nav a:hover { color: var(--on-dark); }

.header-cta { flex: 0 0 auto; }

.nav-toggle {
  display: none; width: 40px; height: 40px; margin-left: auto;
  background: none; border: 1px solid var(--line-dark); border-radius: 8px;
  cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--on-dark); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 22px; border-radius: 8px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .12s, filter .15s, background .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 10px 18px; font-size: 14px; }

.btn-accent { background: var(--accent-grad); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }

.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }

.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-soft); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 0; }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px; align-items: center;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 5.2vw, 66px); line-height: 1.04;
  font-weight: 800; letter-spacing: -.02em;
}

.lead { margin: 24px 0 0; max-width: 46ch; color: var(--on-dark-soft); font-size: 18px; }

.hero-visual { margin: 0; position: relative; }

/* The capsule: WebGL canvas on top, photo underneath until the first frame renders. */
.capsule-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-dark);
  background: radial-gradient(120% 110% at 50% 20%, var(--panel-2) 0%, var(--deep) 70%);
}
.capsule-glow {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(46% 42% at 50% 48%, rgba(178, 58, 159, .30) 0%, rgba(123, 63, 228, .10) 48%, transparent 74%);
  transition: opacity .6s ease;
}
.hero3d { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.hero3d canvas { display: block; width: 100% !important; height: 100% !important; }
.capsule-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; transition: opacity .7s ease;
}
.capsule-stage.is-live .hero3d { opacity: 1; }
.capsule-stage.is-live .capsule-fallback { opacity: 0; }

/* Callouts around the rotating ampoule. */
.hero-info { position: absolute; inset: 0; pointer-events: none; }
.hi { position: absolute; display: flex; flex-direction: column; gap: 4px; }
.hi-big {
  font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1;
  color: var(--on-dark);
}
.hi-big sub { font-size: .62em; }
.hi-sub {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-dark-soft);
}

.hi-formula { top: 24%; left: 7%; }
.hi-grade   { top: 55%; right: 7%; align-items: flex-end; text-align: right; }
.hi-grade .hi-big {
  font-size: 34px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hi-cas { bottom: 9%; left: 7%; }

/* Thin leader lines pointing at the ampoule. */
.hi-grade::after {
  content: ""; position: absolute; top: 50%; height: 1px;
}
.hi-grade::after {
  right: 100%; width: 150px; margin-right: 14px;
  background: linear-gradient(270deg, rgba(255,255,255,.55), rgba(255,255,255,.06));
}
.capsule-stage .capsule-glow { opacity: 1; animation: capsule-breathe 3.4s ease-in-out infinite; }

@keyframes capsule-breathe {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .capsule-stage .capsule-glow { animation: none; }
  .capsule-model { --auto-rotate: none; }
}
.hero-visual figcaption {
  position: absolute; left: 16px; bottom: 16px;
  padding: 7px 12px; border-radius: 6px;
  background: rgba(11, 21, 36, .78); border: 1px solid var(--line-dark);
  font-size: 13px; color: var(--on-dark-soft);
}

.trust-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin: 64px 0 0; padding: 26px 0 72px;
  border-top: 1px solid var(--line-dark);
  list-style: none;
}
.trust-row li { font-size: 14px; color: var(--on-dark-soft); }

/* ---------- Sections ---------- */

.section { padding: 96px 0; }
.section-light { background: var(--light); color: var(--ink); }
.section-dark { background: var(--deep); color: var(--on-dark); }

.section h2 {
  margin: 0 0 44px;
  font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12;
  font-weight: 700; letter-spacing: -.015em;
}

.section-note { margin: 36px 0 24px; max-width: 72ch; color: var(--on-dark-soft); }
.section-light .section-note { color: var(--ink-soft); }

/* ---------- Materials ---------- */

.material-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.material-card {
  background: var(--light-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}

.card-photo {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center;
  margin-bottom: 24px; border-radius: 8px; border: 1px solid var(--line);
}
.formula-tile .formula {
  font-size: 46px; font-weight: 700; letter-spacing: -.01em;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.formula sub { font-size: .62em; }

.material-card h3 { margin: 0; font-size: 22px; font-weight: 600; }
.material-card .formula-inline {
  margin: 8px 0 0; font-size: 36px; font-weight: 400; letter-spacing: -.01em; color: var(--ink);
}
.material-card .cas { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.material-card .grades { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); }
.material-card .material-text { margin: 16px 0 0; color: var(--ink-soft); }

.also-line { margin: 28px 0 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- Purity ---------- */

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.stat { padding-top: 22px; border-top: 1px solid var(--line-dark); }
.stat-value {
  margin: 0; font-size: clamp(40px, 4.6vw, 58px); font-weight: 400; line-height: 1;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-value .unit { font-size: .8em; }
.stat-label { margin: 14px 0 0; font-size: 13px; color: var(--on-dark-soft); }

/* ---------- Supply ---------- */

.chain {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px;
  margin: 0 0 44px; padding: 0; list-style: none;
}
.chain li {
  padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 15px; color: var(--ink-soft);
}
.chain .step-no { color: var(--ink); font-weight: 600; }
.chain .step-no::after { content: " /"; color: var(--ink-soft); font-weight: 400; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: var(--light-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h4 { margin: 0; font-size: 17px; font-weight: 600; }
.feature p { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); }

.section-light .btn-row, .section-light > .shell > .btn { margin-top: 32px; }
.feature-grid + .btn { margin-top: 32px; }

/* ---------- Modal ---------- */

body.modal-open { overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 9, 17, .72); backdrop-filter: blur(3px); }

.modal-dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  padding: 36px; border-radius: 14px;
  background: var(--deep); border: 1px solid var(--line-dark);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.modal-dialog h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.015em; }
.modal-dialog .section-note { margin: 14px 0 0; font-size: 15px; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; padding: 0; line-height: 1;
  font-size: 26px; color: var(--on-dark-soft);
  background: none; border: 1px solid var(--line-dark); border-radius: 8px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.modal-close:hover { color: var(--on-dark); border-color: rgba(255, 255, 255, .35); }

/* ---------- Form ---------- */

.lead-form { display: grid; gap: 18px; margin-top: 28px; }
.lf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.lf-field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--on-dark); }

.lf-field input, .lf-field select, .lf-field textarea {
  width: 100%; padding: 14px 16px;
  font-family: inherit; font-size: 16px; color: var(--on-dark);
  background: var(--panel); border: 1px solid var(--line-dark); border-radius: 8px;
  transition: border-color .15s, background .15s;
}
.lf-field textarea { resize: vertical; min-height: 120px; }
.lf-field select {
  appearance: none; cursor: pointer; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2393a4bb' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
/* background-color, not the shorthand: the shorthand would drop the chevron on focus. */
.lf-field input:focus, .lf-field select:focus, .lf-field textarea:focus {
  outline: none; border-color: var(--accent-1); background-color: var(--panel-2);
}

.lf-error { margin: 8px 0 0; min-height: 0; font-size: 13px; color: var(--accent-2); }
.lf-field.is-invalid input, .lf-field.is-invalid select { border-color: var(--accent-2); }

.lf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lf-submit { justify-self: start; }
.lf-submit[disabled] { opacity: .6; cursor: default; transform: none; }
.lf-consent { margin: -4px 0 0; font-size: 13px; line-height: 1.5; color: var(--on-dark-soft); }
.lf-consent a { color: var(--on-dark); }
.lf-status { margin: 0; font-size: 14px; color: var(--accent-2); }

.lf-success h3 { margin: 28px 0 0; font-size: 26px; font-weight: 700; }
.lf-success p { margin: 12px 0 0; color: var(--on-dark-soft); }

/* ---------- Footer ---------- */

.site-footer { background: var(--deep); }
.footer-rule { height: 3px; background: linear-gradient(90deg, var(--accent-1), #3b82f6 35%, #b23a9f 70%, var(--accent-2)); }

.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px; padding-top: 56px; padding-bottom: 48px;
}

.footer-logo { height: 40px; width: auto; margin-bottom: 20px; }
.footer-company { margin: 0; font-size: 15px; font-weight: 600; }
.footer-address { margin: 10px 0 0; font-style: normal; font-size: 14px; line-height: 1.8; color: var(--on-dark-soft); }
.footer-address a { text-decoration: none; }
.footer-address a:hover { color: var(--on-dark); text-decoration: underline; }

.footer-heading {
  margin: 0 0 16px; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark);
}

.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { font-size: 14px; text-decoration: none; color: var(--on-dark-soft); transition: color .15s; }
.footer-nav a:hover { color: var(--on-dark); }

.footer-note { margin: 0 0 18px; font-size: 14px; color: var(--on-dark-soft); }

.footer-bottom { padding-bottom: 40px; border-top: 1px solid var(--line-dark); }
.footer-bottom p { margin: 20px 0 0; font-size: 13px; color: var(--on-dark-soft); }

/* ---------- Legal pages ---------- */

.prose { padding: 72px 0 96px; }
.prose h1 { margin: 0; font-size: clamp(32px, 4vw, 46px); font-weight: 800; letter-spacing: -.02em; }
.prose .updated { margin: 16px 0 0; font-size: 14px; color: var(--ink-soft); }
.prose h2 { margin: 44px 0 0; font-size: 21px; font-weight: 700; }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin: 14px 0 0; }
.prose ul { margin: 14px 0 0; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--accent-1); }
.prose .back { display: inline-block; margin-top: 48px; font-size: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .chain { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-row { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .shell { padding: 0 16px; }

  .nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .site-header.is-open .nav {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 84px; left: 0; right: 0;
    background: var(--deep); border-bottom: 1px solid var(--line-dark); padding: 8px 16px 16px;
  }
  .site-header.is-open .nav a { padding: 12px 0; font-size: 16px; }

  .hero { padding-top: 44px; }
  .trust-row { margin-top: 44px; padding-bottom: 52px; }
  .section { padding: 64px 0; }
  .section h2 { margin-bottom: 32px; }

  .material-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; gap: 20px; }
  .chain { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }

  .btn, .btn-sm { width: 100%; }
  .btn-row { gap: 10px; }

  .hi-big { font-size: 20px; }
  .hi-grade .hi-big { font-size: 26px; }
  .hi-sub { font-size: 10px; }
  .hi-formula { top: 6%; left: 5%; }
  .hi-grade { top: 40%; right: 5%; }
  .hi-cas { bottom: 6%; left: 5%; }
  .hi-formula::after, .hi-grade::after { display: none; }

  .modal { padding: 12px; }
  .modal-dialog { padding: 28px 20px; max-height: 94vh; }
  .modal-close { top: 10px; right: 10px; }
  .lf-row { grid-template-columns: 1fr; gap: 18px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .footer-brand { grid-column: auto; }
  .prose { padding: 48px 0 64px; }
}

/* ---------- Gallery ---------- */

#gallery[hidden] { display: none; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gallery-grid figure { margin: 0; }
.gallery-grid img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line-dark);
}
.gallery-grid figcaption { margin-top: 10px; font-size: 13px; color: var(--on-dark-soft); }

@media (max-width: 1000px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .gallery-grid { grid-template-columns: 1fr; } }
