/* Shunfang site foundation: engineered, high-contrast, content-first. */
:root {
  --ink: #071a28;
  --deep: #092132;
  --deep-2: #0d2d42;
  --blue: #0b5cad;
  --blue-light: #58a9e8;
  --orange: #e97824;
  --paper: #f4f7f8;
  --white: #ffffff;
  --muted: #61737f;
  --line: #cad5db;
  --line-dark: rgba(255,255,255,.2);
  --success: #23805b;
  --warning: #a75111;
  --danger: #b23535;
  --shadow: 0 18px 45px rgba(4, 23, 35, .16);
  --sans: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  --condensed: "Arial Narrow", "Roboto Condensed", "Aptos Display", sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  --step--1: clamp(.84rem, .82rem + .1vw, .92rem);
  --step-0: clamp(1rem, .96rem + .22vw, 1.12rem);
  --step-1: clamp(1.25rem, 1.1rem + .75vw, 1.7rem);
  --step-2: clamp(1.75rem, 1.3rem + 2vw, 3rem);
  --step-3: clamp(2.6rem, 1.7rem + 4vw, 5.5rem);
  --gutter: clamp(1.1rem, 4vw, 4.5rem);
  --content: 78rem;
  --section-space: clamp(3.25rem, 6vw, 5.75rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
::selection { background: var(--orange); color: var(--ink); }

.container { width: min(var(--content), calc(100% - (var(--gutter) * 2))); margin-inline: auto; }
.section { position: relative; padding-block: var(--section-space); overflow: clip; }
.section-compact { padding-block: clamp(2.5rem, 4vw, 4rem); }
.section-dark { background: var(--deep); color: var(--white); }
.section-dark::before {
  position: absolute; inset: 0; z-index: 0; content: ""; pointer-events: none;
  background-image: linear-gradient(90deg, transparent 0 49.9%, rgba(255,255,255,.035) 50% 50.1%, transparent 50.2%), linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 4.5rem;
}
.section > .container { position: relative; z-index: 1; }

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; color: var(--white);
  border-bottom: 1px solid transparent; transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled, .site-header.is-open { background: rgba(7, 26, 40, .97); border-color: var(--line-dark); box-shadow: 0 5px 20px rgba(0,0,0,.16); }
.nav-wrap { min-height: 4.9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--white); text-decoration: none; font-family: var(--condensed); font-size: 1.08rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.brand-mark { width: 2.25rem; height: 2.25rem; flex: 0 0 auto; overflow: hidden; border-radius: .18rem; background: #fff url("../images/official/brand-logo.webp") center -9px / 90px auto no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.nav-links { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 2rem); list-style: none; padding: 0; margin: 0; }
.nav-links a { color: rgba(255,255,255,.9); text-decoration: none; font-size: .83rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.nav-links a:not(.btn):hover, .nav-links a:not(.btn)[aria-current="page"] { color: var(--orange); }
.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; padding: 0; color: var(--white); background: transparent; border: 1px solid var(--line-dark); }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { width: 1.1rem; height: 1px; display: block; margin: 0 auto; background: currentColor; content: ""; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle span { margin-block: .33rem; }
.site-header.is-open .nav-toggle::before { transform: translateY(4px) rotate(45deg); }
.site-header.is-open .nav-toggle span { opacity: 0; }
.site-header.is-open .nav-toggle::after { transform: translateY(-4px) rotate(-45deg); }

.hero { position: relative; min-height: clamp(36rem, 78svh, 46rem); display: grid; align-items: end; overflow: hidden; background: var(--deep); color: var(--white); isolation: isolate; }
.hero-media { position: absolute; z-index: -2; inset: 0; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(4,20,31,.9) 0%, rgba(4,20,31,.7) 45%, rgba(4,20,31,.2) 100%), linear-gradient(0deg, rgba(4,20,31,.8) 0%, transparent 52%); }
.hero-content { width: min(55rem, 100%); padding-block: clamp(7rem, 14vh, 10rem) clamp(3rem, 7vh, 5rem); }
.eyebrow { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; color: var(--blue-light); font-size: .76rem; font-weight: 800; letter-spacing: .15em; line-height: 1.2; text-transform: uppercase; }
.eyebrow::before { width: 2.8rem; height: 1px; flex: 0 0 auto; background: currentColor; content: ""; }
.display { max-width: 18ch; margin: 0; font-family: var(--condensed); font-size: var(--step-3); font-weight: 800; letter-spacing: -.045em; line-height: .93; text-wrap: balance; text-transform: uppercase; }
.hero-content > p:not(.eyebrow) { max-width: 52rem; margin: 1.35rem 0 0; color: rgba(255,255,255,.86); font-size: clamp(1.05rem, .98rem + .35vw, 1.3rem); line-height: 1.55; }
.hero-content .btn { margin-top: 1.5rem; }

.btn { min-height: 3rem; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; padding: .72rem 1.15rem; border: 1px solid transparent; border-radius: 0; font-size: .78rem; font-weight: 800; letter-spacing: .09em; line-height: 1; text-align: center; text-decoration: none; text-transform: uppercase; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: var(--white); background: var(--orange); border-color: var(--orange); }
.btn-primary:hover { color: var(--white); background: #c75e13; border-color: #c75e13; }
.btn-ghost { color: currentColor; background: transparent; border-color: currentColor; }
.btn-ghost:hover { color: var(--deep); background: var(--white); border-color: var(--white); }

.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(18rem, 1.1fr); gap: clamp(2rem, 4.5vw, 5rem); align-items: center; }
.section .eyebrow + h2 { margin-top: 0; }
.section h2 + p { margin-top: 0; }
.section .container > :last-child, .split > * > :last-child { margin-bottom: 0; }
.media { position: relative; min-height: 20rem; overflow: hidden; background: var(--deep-2); }
.media img, .media video { width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
.media::after { position: absolute; right: 0; bottom: 0; width: 38%; height: 30%; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); content: ""; pointer-events: none; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.metric { min-height: 10rem; padding: 1.4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark .metric-grid { border-color: var(--line-dark); }
.section-dark .metric { border-color: var(--line-dark); }
.metric strong { display: block; color: var(--blue); font-family: var(--condensed); font-size: clamp(2.2rem, 4vw, 4rem); line-height: .9; letter-spacing: -.05em; }
.section-dark .metric strong { color: var(--blue-light); }
.metric span { display: block; max-width: 16ch; margin-top: .85rem; color: var(--muted); font-size: var(--step--1); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.section-dark .metric span { color: rgba(255,255,255,.64); }
.ruled-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid currentColor; }
.ruled-list li { display: grid; grid-template-columns: minmax(2.5rem, .15fr) 1fr auto; gap: 1rem; align-items: baseline; padding: 1.15rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 23%, transparent); }
.ruled-list li::before { color: var(--orange); content: counter(list-item, decimal-leading-zero); font-family: var(--mono); font-size: .73rem; }
.ruled-list a { font-family: var(--condensed); font-size: var(--step-1); font-weight: 800; letter-spacing: -.02em; text-decoration: none; text-transform: uppercase; }
.ruled-list a::after { margin-left: .5rem; color: var(--orange); content: "↗"; }
.ruled-list small { color: var(--muted); font-size: .78rem; }

.product-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .75fr); gap: 2rem; align-items: end; padding: clamp(2rem, 5vw, 4rem); background: var(--deep); color: var(--white); border-left: .35rem solid var(--orange); }
.product-band > * { margin: 0; }
.product-band h2, .product-band h3 { max-width: 14ch; font-family: var(--condensed); font-size: var(--step-2); line-height: 1; letter-spacing: -.035em; text-transform: uppercase; }
.product-band p { max-width: 38rem; color: rgba(255,255,255,.72); }
.application-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.application-grid > * { min-height: 13rem; padding: clamp(1.5rem, 3vw, 2.5rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.application-grid h2, .application-grid h3 { margin: 0 0 .75rem; font-family: var(--condensed); font-size: var(--step-1); line-height: 1.05; letter-spacing: -.02em; text-transform: uppercase; }
.application-grid p { max-width: 35ch; margin: 0; color: var(--muted); }
.application-grid a { display: block; height: 100%; text-decoration: none; }
.application-grid a:hover h2, .application-grid a:hover h3 { color: var(--blue); }
.process { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0; padding: 0; list-style: none; counter-reset: process; }
.process li { position: relative; min-height: 9.5rem; padding: 3rem 1.1rem 1rem 0; border-top: 1px solid var(--line-dark); }
.process li:not(:last-child)::after { position: absolute; top: -.1rem; right: 0; width: 2.5rem; height: .2rem; background: var(--orange); content: ""; }
.process li::before { display: block; margin-bottom: .7rem; color: var(--blue-light); content: "0" counter(process); counter-increment: process; font-family: var(--mono); font-size: .75rem; }
.process strong { font-family: var(--condensed); font-size: var(--step-1); line-height: 1; letter-spacing: -.02em; text-transform: uppercase; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); }
.article-grid > article { padding-top: 1.2rem; border-top: 3px solid var(--orange); }
.article-grid h2, .article-grid h3 { margin: .8rem 0; font-family: var(--condensed); font-size: var(--step-1); line-height: 1.05; text-transform: uppercase; }
.article-grid p { color: var(--muted); }
.article-grid a { text-decoration: none; }
.article-grid a:hover h2, .article-grid a:hover h3 { color: var(--blue); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem 1.5rem; }
.form-grid > .field--full, .form-grid > [data-rfq-fields] { grid-column: 1 / -1; }
.field { display: grid; gap: .45rem; }
.field label, .field legend { color: var(--deep); font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.section-dark .field label, .section-dark .field legend { color: var(--white); }
.field input, .field select, .field textarea { width: 100%; padding: .8rem .85rem; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.field--consent .consent-label { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: .7rem; align-items: start; cursor: pointer; }
.field--consent input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: .12rem 0 0; padding: 0; accent-color: var(--orange); }
.field--consent .consent-label span { line-height: 1.45; }
.field textarea { min-height: 8rem; resize: vertical; }
.field input::file-selector-button { margin-right: .75rem; padding: .45rem .6rem; color: var(--white); background: var(--deep); border: 0; font-weight: 700; }
.field small { color: var(--muted); font-size: .8rem; }
.notice { padding: 1rem 1.15rem; border-left: .25rem solid var(--blue); background: #e7f2fb; color: var(--deep); font-size: .9rem; }
.notice[data-state="error"] { border-color: var(--danger); background: #fcecec; }
.notice[data-state="success"] { border-color: var(--success); background: #e6f5ed; }

.site-footer { padding-block: 3.5rem 2rem; background: var(--ink); color: var(--white); }
.site-footer .container { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 2rem; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: var(--orange); }
.site-footer ul { margin: .75rem 0 0; padding: 0; list-style: none; }
.site-footer li + li { margin-top: .35rem; }
.site-footer small { display: block; grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--line-dark); color: rgba(255,255,255,.5); }

/* Admin content is intentionally functional and separate from the public site mood. */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 16rem minmax(0, 1fr); background: var(--paper); }
.admin-shell > aside { padding: 1.5rem; background: var(--deep); color: var(--white); }
.admin-shell > main { padding: clamp(1.25rem, 4vw, 3rem); }
.admin-shell nav a { display: block; padding: .7rem 0; color: rgba(255,255,255,.78); text-decoration: none; }
.admin-shell nav a:hover, .admin-shell nav a[aria-current="page"] { color: var(--orange); }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
.table-wrap table { width: 100%; min-width: 42rem; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { color: var(--deep); background: #eaf0f3; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.table-wrap tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: .2rem .5rem; color: var(--deep); background: #d7e9f7; font-family: var(--mono); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.status[data-status="new"], .status[data-status="success"] { background: #dcefe5; color: #126141; }
.status[data-status="warning"], .status[data-status="awaiting"] { background: #fff0d8; color: #8b480d; }
.status[data-status="closed"], .status[data-status="error"] { background: #f8dfdf; color: #8e2828; }
.flash { margin-bottom: 1rem; padding: .85rem 1rem; border-left: .25rem solid var(--blue); background: var(--white); }
.flash[data-state="success"] { border-color: var(--success); }
.flash[data-state="error"] { border-color: var(--danger); }

.reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity .65s ease, transform .65s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; display: grid; gap: 0; padding: .65rem var(--gutter) 1.3rem; background: var(--deep); border-bottom: 1px solid var(--line-dark); opacity: 0; visibility: hidden; transform: translateY(-.5rem); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
  .site-header.is-open .nav-links { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links li, .nav-links a { width: 100%; }
  .nav-links a:not(.btn) { display: block; padding: .85rem 0; }
  .nav-links .btn { margin-top: .7rem; }
  .split { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-shell > aside { padding: 1rem var(--gutter); }
  .admin-shell > aside nav { display: flex; gap: 1rem; overflow-x: auto; }
  .admin-shell > aside nav a { white-space: nowrap; }
}
@media (max-width: 620px) {
  .hero { min-height: 34rem; }
  .hero::after { background: linear-gradient(90deg, rgba(4,20,31,.88), rgba(4,20,31,.52)), linear-gradient(0deg, rgba(4,20,31,.88), transparent 62%); }
  .display { max-width: 13ch; }
  .metric { min-height: 8.5rem; padding: 1.1rem; }
  .ruled-list li { grid-template-columns: 2.5rem 1fr; }
  .ruled-list small { grid-column: 2; }
  .product-band, .application-grid, .article-grid, .form-grid { grid-template-columns: 1fr; }
  .application-grid > * { min-height: 0; }
  .process { grid-template-columns: 1fr; }
  .process li { min-height: 0; padding: 1.25rem 0 1.4rem 3rem; border-top: 0; border-left: 1px solid var(--line-dark); }
  .process li:not(:last-child)::after { top: auto; right: auto; bottom: 0; left: -.1rem; width: .2rem; height: 2rem; }
  .process li::before { position: absolute; left: .75rem; top: 1.35rem; }
  .site-footer .container { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
.whatsapp-float { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 45; padding: .8rem 1rem; color: #fff; background: #16894f; box-shadow: var(--shadow); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.whatsapp-float:hover { background: #0d6d3c; }
.article-body { max-width: 52rem; }
.article-body h2 { margin-top: 3rem; font-family: var(--condensed); font-size: var(--step-2); line-height: 1.05; text-transform: uppercase; }
.article-body p { color: #394e5b; }
