/* RAHVAN — monochrome corporate site. Black #000 + white #fff; grey only for hierarchy.
   Systems: 8px radius everywhere · 8-pt spacing scale · modular type scale · 12-col bento grid. */

:root {
  /* colour */
  --black: #000;
  --white: #fff;
  --soft: #f2f2f2;
  --ink-muted: #595959;
  --dark-muted: rgba(255, 255, 255, .68);
  --line-light: rgba(0, 0, 0, .14);
  --line-dark: rgba(255, 255, 255, .18);
  --glass: rgba(255, 255, 255, .06);

  /* shape */
  --radius: 8px;

  /* spacing (8-pt) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;
  --section: clamp(4.5rem, 9vw, 8rem);
  --gap: clamp(.75rem, 1.3vw, 1rem);
  --tile-pad: clamp(1.5rem, 2.6vw, 2.25rem);
  --pad: clamp(1.25rem, 5vw, 4rem);
  --max: 1280px;
  --header-h: 72px;

  /* type scale */
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-lead: clamp(1.0625rem, 1.35vw, 1.25rem);
  --fs-h3: clamp(1.125rem, 1.5vw, 1.3rem);
  --fs-h3-lg: clamp(1.5rem, 2.3vw, 2rem);
  --fs-h2-sm: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h2: clamp(2rem, 4vw, 3.25rem);
  --fs-statement: clamp(2rem, 4.4vw, 3.75rem);
  --fs-display: clamp(2.75rem, 7vw, 6.5rem);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[lang="zh"] { --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
html[lang="fa"] { --font: "Vazirmatn", "Inter", Tahoma, sans-serif; }
html[lang="ar"] { --font: "Noto Sans Arabic", "Vazirmatn", Tahoma, "Inter", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.65;
  color: var(--black); background: var(--black);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html[dir="rtl"] body { line-height: 1.9; }
img, canvas, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: var(--radius); }

.skip { position: absolute; inset-inline-start: var(--s-4); top: -4rem; z-index: 100; background: var(--white); color: var(--black); padding: var(--s-3) var(--s-4); font-weight: 600; border-radius: var(--radius); }
.skip:focus { top: var(--s-4); }
.container { width: min(var(--max), 100% - 2 * var(--pad)); margin-inline: auto; }

/* ---------- Typography ---------- */
h2 { font-weight: 500; font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
h2.h2-sm { font-size: var(--fs-h2-sm); }
h3 { font-weight: 500; font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -.01em; }
h3.h3-lg { font-size: var(--fs-h3-lg); line-height: 1.15; letter-spacing: -.02em; }
.statement { font-size: var(--fs-statement); line-height: 1.1; max-width: 20em; }
.lead { font-size: var(--fs-lead); line-height: 1.6; max-width: 36rem; text-wrap: pretty; }
.light .lead { color: #333; }
.dark .lead { color: var(--dark-muted); }
p { text-wrap: pretty; }
html[dir="rtl"] h2, html[dir="rtl"] h3, html[lang="zh"] h2, html[lang="zh"] h3 { letter-spacing: 0; }
html[dir="rtl"] h2 { line-height: 1.35; }
html[dir="rtl"] h3 { line-height: 1.5; }
html[lang="zh"] h2 { line-height: 1.25; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  color: var(--white); border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.logo { position: relative; z-index: 60; display: inline-flex; align-items: center; }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s-6); }
.logo { font-family: "Inter", sans-serif; font-weight: 600; font-size: 1.05rem; letter-spacing: .32em; direction: ltr; unicode-bidi: isolate; line-height: 1; }
.logo img { height: 28px; width: auto; max-width: 180px; }
.logo:has(img) .logo-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-panel { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 3rem); flex: 1; justify-content: flex-end; }
.nav-list { display: flex; gap: clamp(1.25rem, 2.4vw, 2.5rem); }
.nav-list a { font-size: var(--fs-sm); opacity: .8; transition: opacity .2s; padding-block: var(--s-2); }
.nav-list a:hover { opacity: 1; }
.header-tools { display: flex; align-items: center; gap: var(--s-5); }
.lang { display: flex; gap: var(--s-1); direction: ltr; }
.lang button { background: none; border: 0; padding: var(--s-2) var(--s-2); font-size: var(--fs-xs); font-weight: 500; color: var(--white); opacity: .5; transition: opacity .2s, background-color .2s; border-radius: var(--radius); }
.lang button:hover { opacity: .85; }
.lang button[aria-pressed="true"] { opacity: 1; background: rgba(255, 255, 255, .14); }
.burger { display: none; }

/* ---------- Buttons (8px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: var(--s-3) var(--s-5); border-radius: var(--radius);
  font-weight: 500; font-size: var(--fs-base); line-height: 1.2; border: 1px solid transparent; text-align: center;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-sm { min-height: 2.5rem; padding: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.btn-light { background: var(--white); color: var(--black); }
.btn-light:hover { background: transparent; color: var(--white); border-color: var(--white); }
.tile--dark .btn-light:hover { color: var(--white); }
.btn-outline-light { border-color: rgba(255, 255, 255, .55); color: var(--white); }
.btn-outline-light:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: transparent; color: var(--black); border-color: var(--black); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; background: var(--black); color: var(--white); overflow: hidden; padding-top: var(--header-h); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to right, #000 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 62%); }
html[dir="rtl"] .hero::after { background: linear-gradient(to left, #000 0%, rgba(0, 0, 0, .55) 38%, rgba(0, 0, 0, 0) 62%); }
.globe { position: absolute; z-index: 0; top: 50%; inset-inline-end: -7vw; width: min(94vh, 66vw); aspect-ratio: 1; transform: translateY(-46%); }
.globe canvas { width: 100%; height: 100%; opacity: 0; animation: globe-in 1.8s .25s var(--ease) forwards; }
.globe-fallback { display: none; position: absolute; inset: 6%; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); }
.globe-fallback::before, .globe-fallback::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .18); }
.globe-fallback::before { transform: scaleX(.5); }
.globe-fallback::after { transform: scaleY(.5); }
.globe.no-webgl canvas { display: none; }
.globe.no-webgl .globe-fallback { display: block; }

.hero-inner { position: relative; z-index: 2; padding-block: var(--s-7) clamp(3rem, 9vh, 6rem); }
.hero h1 { font-weight: 500; font-size: 95px; line-height: 1.02; letter-spacing: -.04em; max-width: 12em; }
html[lang="zh"] .hero h1 { letter-spacing: -.01em; line-height: 1.15; }
html[dir="rtl"] .hero h1 { letter-spacing: 0; line-height: 1.3; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .08em; }
.hero h1 .line > span { display: block; transform: translateY(105%); animation: rise 1.1s var(--ease) forwards; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
.hero-sub { margin-top: var(--s-5); max-width: 34rem; font-size: var(--fs-lead); color: var(--dark-muted); opacity: 0; animation: fade 1s .65s var(--ease) forwards; }
.hero-cta { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); opacity: 0; animation: fade 1s .85s var(--ease) forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade { to { opacity: 1; } }
@keyframes globe-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section.tight-bottom { padding-bottom: var(--s-8); }
.light { background: var(--white); color: var(--black); }
.dark { background: var(--black); color: var(--white); }
.section > .container > .lead { margin-top: var(--s-5); }

/* shared section header: title left, lead right */
.sec-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-5) var(--s-8); align-items: end; margin-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.sec-head:has(> :only-child) { grid-template-columns: 1fr; }
.sec-head .lead { margin: 0; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.tile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: var(--s-5);
  padding: var(--tile-pad); border-radius: var(--radius); min-height: 13rem;
}
.tile .body { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-3); }
.tile .body p { max-width: 30rem; }
.tile--dark { background: var(--black); color: var(--white); }
.tile--dark p { color: var(--dark-muted); }
.tile--soft { background: var(--soft); color: var(--black); }
.tile--soft p { color: var(--ink-muted); }
.tile--line { background: var(--white); color: var(--black); border: 1px solid var(--line-light); }
.tile--line p { color: var(--ink-muted); }
.tile--glass { background: var(--glass); color: var(--white); border: 1px solid var(--line-dark); }
.tile--light { background: var(--white); color: var(--black); }
.tile.tall { min-height: clamp(18rem, 28vw, 22rem); }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; }
.c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-9 { grid-column: span 9; }
.r-2 { grid-row: span 2; }

.ico { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius); border: 1px solid currentColor; opacity: .9; flex: none; }
.ico svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.deco { position: absolute; inset-inline-end: -12%; bottom: -34%; width: 68%; opacity: .22; pointer-events: none; }
.deco * { vector-effect: non-scaling-stroke; }

.steps { counter-reset: none; }
.n { font-family: "Inter", sans-serif; font-weight: 300; font-size: clamp(2.25rem, 3.6vw, 3.25rem); line-height: 1; letter-spacing: -.03em; direction: ltr; text-align: start; }
.tile--dark .n { color: rgba(255, 255, 255, .55); } .tile--soft .n, .tile--line .n { color: rgba(0, 0, 0, .4); }
.steps .body .btn { align-self: flex-start; margin-top: var(--s-3); }

.regions .tile { min-height: clamp(11rem, 16vw, 14rem); justify-content: space-between; }
.regions .arc { width: min(9rem, 60%); height: auto; overflow: visible; opacity: .8; }
.regions .tile--light .arc { opacity: .6; }

/* ---------- Global trade flow ---------- */
.flow { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6); padding-top: var(--s-7); }
.flow::before { content: ""; position: absolute; inset-inline: 0; top: 7px; height: 1px; background: var(--line-dark); }
.flow::after { content: ""; position: absolute; top: 5px; inset-inline-start: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--white); box-shadow: 0 0 14px 3px rgba(255, 255, 255, .6); animation: travel 6s linear infinite; }
@keyframes travel { from { inset-inline-start: 0; } to { inset-inline-start: calc(100% - 5px); } }
.flow li { position: relative; }
.flow li::before { content: ""; position: absolute; top: calc(-1 * var(--s-7)); inset-inline-start: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--black); border: 1px solid var(--white); }
.flow h3 { font-size: var(--fs-h3-lg); line-height: 1.15; margin-bottom: var(--s-2); }
.flow p { color: var(--dark-muted); max-width: 16rem; }
.insight { margin-top: clamp(3.5rem, 7vw, 6rem); padding-top: var(--s-6); border-top: 1px solid var(--line-dark); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-5) var(--s-8); align-items: end; }
.insight p { color: var(--dark-muted); max-width: 26rem; }

/* ---------- Why ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-7) clamp(2rem, 4vw, 4rem); }
.pillars article { border-top: 1px solid var(--line-dark); padding-top: var(--s-5); }
.pillars h3 { margin-bottom: var(--s-3); }
.pillars p { color: var(--dark-muted); max-width: 22rem; }

/* ---------- RFQ ---------- */
.rfq .tile--dark .body { gap: var(--s-4); }
.rfq .tile--dark p { max-width: 26rem; }
.mail-line a { font-size: var(--fs-h3-lg); font-weight: 500; letter-spacing: -.02em; border-bottom: 1px solid var(--black); padding-bottom: 2px; word-break: break-all; }
.note { font-size: var(--fs-sm); max-width: 24rem; }
.form-tile { gap: var(--s-6); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-5); }
.field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: var(--fs-xs); font-weight: 500; color: var(--ink-muted); }
.field input, .field textarea {
  width: 100%; background: var(--white); color: var(--black); border: 1px solid transparent; border-radius: var(--radius);
  padding: .8rem var(--s-4); font-size: var(--fs-base); line-height: 1.4; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:hover, .field textarea:hover { border-color: rgba(0, 0, 0, .25); }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); margin-top: auto; }
.form-foot .btn { min-width: 12rem; }
.status { font-weight: 500; font-size: var(--fs-sm); min-height: 1.5em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding-block: var(--s-8) var(--s-6); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-6); align-items: start; }
.foot-tag { margin-top: var(--s-5); color: var(--dark-muted); }
.foot-nav { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); justify-content: flex-end; }
.foot-nav a { opacity: .8; font-size: var(--fs-sm); } .foot-nav a:hover { opacity: 1; }
.rights { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--line-dark); font-size: var(--fs-xs); color: var(--dark-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 7px; width: 44px; height: 44px; padding: 0 10px; background: none; border: 0; color: var(--white); position: relative; z-index: 60; border-radius: var(--radius); }
  .burger span { display: block; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  .nav-panel {
    position: fixed; inset: 0; z-index: 55; background: var(--black);
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: var(--s-6);
    padding: calc(var(--header-h) + var(--s-4)) var(--pad) max(var(--s-6), env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav-panel.open { opacity: 1; visibility: visible; transform: none; }
  .nav-list { flex-direction: column; gap: 0; width: 100%; }
  .nav-list li { border-bottom: 1px solid var(--line-dark); }
  .nav-list a { display: flex; align-items: center; min-height: 3.75rem; font-size: clamp(1.5rem, 6vw, 2.25rem); font-weight: 500; letter-spacing: -.02em; opacity: 1; padding-block: var(--s-2); }
  html[dir="rtl"] .nav-list a, html[lang="zh"] .nav-list a { letter-spacing: 0; }

  .header-tools { flex-direction: column; align-items: stretch; gap: var(--s-4); margin-top: auto; padding-top: var(--s-4); }
  .lang { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-2); }
  .lang button { min-height: 3rem; padding: 0 var(--s-2); font-size: var(--fs-sm); opacity: 1; color: var(--dark-muted); border: 1px solid var(--line-dark); border-radius: var(--radius); }
  .lang button[aria-pressed="true"] { background: var(--white); color: var(--black); border-color: var(--white); }
  .header-tools .btn-sm { width: 100%; min-height: 3.25rem; font-size: var(--fs-base); background: var(--white); color: var(--black); border-color: var(--white); }
}

@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > * { grid-column: span 1; grid-row: auto; }
  .bento > .wide { grid-column: span 2; }
  .tile.tall { min-height: 16rem; }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sec-head, .insight, .footer-inner { grid-template-columns: 1fr; }
  .foot-nav { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .globe { top: calc(var(--header-h) + var(--s-4)); inset-inline: 0; margin-inline: auto; width: min(112vw, 640px); transform: none; }
  .hero::after, html[dir="rtl"] .hero::after { background: linear-gradient(to top, #000 0%, #000 34%, rgba(0, 0, 0, .65) 52%, rgba(0, 0, 0, 0) 75%); }
  .hero h1 { font-size: clamp(2.6rem, 12.5vw, 4.5rem); }
  .hero-cta .btn { flex: 1 1 100%; }
  .flow { grid-template-columns: 1fr; gap: var(--s-6); padding-top: 0; padding-inline-start: 2.25rem; }
  .flow::before { inset-inline: 7px auto; width: 1px; height: auto; top: 7px; bottom: 7px; }
  .flow::after { display: none; }
  .flow li::before { top: 4px; inset-inline-start: -2.25rem; }
  .flow p { max-width: none; }
  .grid { grid-template-columns: 1fr; }
  .form-foot .btn { width: 100%; }
}

@media (max-width: 820px) {
  .site-footer { padding-block: var(--s-7) var(--s-5); text-align: center; }
  .footer-inner { justify-items: center; gap: var(--s-5); }
  .foot-tag { margin-top: var(--s-4); }
  .foot-nav { justify-content: center; gap: var(--s-2); max-width: 28rem; }
  .foot-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 var(--s-4); opacity: 1; border: 1px solid var(--line-dark); border-radius: var(--radius); color: var(--dark-muted); }
  .foot-nav a:hover { color: var(--white); border-color: rgba(255, 255, 255, .4); }
  .rights { width: 100%; margin-top: var(--s-2); }
}

@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento > .wide { grid-column: span 1; }
  .tile { min-height: 0; }
  .tile .body { margin-top: var(--s-6); }
  .regions .tile { min-height: 9rem; }
  .pillars { grid-template-columns: 1fr; }
}

@media (min-width: 1800px) {
  :root { --max: 1480px; }
  body { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 .line > span, .hero-sub, .hero-cta, .globe canvas { animation: none; transform: none; opacity: 1; }
  .flow::after { animation: none; display: none; }
  * { transition-duration: .01ms !important; }
}