/*
  Samarth Engineers brand system
  Palette: industrial blue #18384a, deep blue #102532, steel #3d5968,
  off-white #f5f3ee, copper orange #e56f24.
  Typography: self-contained system sans stack with compact uppercase labels.
*/
:root {
  --navy-950: #102532;
  --navy-900: #18384a;
  --navy-800: #285268;
  --steel-700: #3d5968;
  --steel-500: #71808c;
  --steel-300: #b9c2c8;
  --steel-200: #dce1e4;
  --paper: #f7f4ee;
  --white: #ffffff;
  --copper: #e56f24;
  --copper-dark: #ad4610;
  --error: #b42318;
  --success: #247a4a;
  --warning: #9a5b00;
  --shadow: 0 18px 50px rgba(8, 22, 33, .13);
  --radius-sm: .4rem;
  --radius: .75rem;
  --radius-lg: 1.25rem;
  --container: 1180px;
  --transition: 180ms ease;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--navy-900); background: var(--paper); font-family: var(--font); line-height: 1.65; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: var(--copper-dark); text-underline-offset: .2em; }
a:hover { color: #7c2e08; }
:focus-visible { outline: 3px solid #ffab6b; outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 999; top: .75rem; left: .75rem; transform: translateY(-160%); padding: .7rem 1rem; color: var(--white); background: var(--navy-950); border-radius: var(--radius-sm); }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.container { width: min(calc(100% - 2rem), var(--container)); margin-inline: auto; }
.narrow { max-width: 780px; }
.section { padding: clamp(4rem, 8vw, 7.5rem) 0; }
.section--compact { padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.section--dark { color: var(--white); background: var(--navy-900); }
.section--ink { color: var(--white); background: var(--navy-950); }
.section--white { background: var(--white); }
.section--steel { background: #e8eef1; }
.eyebrow { display: inline-flex; align-items: center; gap: .65rem; margin: 0 0 .8rem; color: var(--copper-dark); font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.section--dark .eyebrow, .section--ink .eyebrow, .page-hero .eyebrow, .hero .eyebrow, .cta-panel .eyebrow { color: #ffb07a; }
.eyebrow::before { width: 2rem; height: 2px; content: ""; background: currentColor; }
h1, h2, h3 { margin: 0 0 .8em; line-height: 1.08; letter-spacing: -.025em; }
h1 { font-size: clamp(2.7rem, 7vw, 5.7rem); max-width: 13ch; }
h2 { font-size: clamp(2rem, 4.5vw, 3.45rem); max-width: 18ch; }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p { margin: 0 0 1.25rem; }
.lead { max-width: 62ch; font-size: clamp(1.08rem, 2vw, 1.3rem); color: var(--steel-700); }
.section--dark .lead, .section--ink .lead, .page-hero .lead, .hero .lead { color: #edf5f8; }
.lede-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.section-heading > * { margin-bottom: 0; }
.text-link { display: inline-flex; gap: .5rem; align-items: center; font-weight: 800; text-decoration: none; }
.text-link::after { content: "→"; transition: transform var(--transition); }
.text-link:hover::after { transform: translateX(.25rem); }

.site-header { position: sticky; z-index: 100; top: 0; color: var(--white); background: rgba(16, 37, 50, .96); border-bottom: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(12px); }
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 1.3rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: var(--white); text-decoration: none; white-space: nowrap; }
.brand-emblem { width: 2.65rem; height: 2.65rem; display: grid; place-items: center; position: relative; padding-left: .28rem; border: 1px solid rgba(255,255,255,.28); background: var(--navy-900); font-weight: 900; letter-spacing: -.08em; }
.brand-emblem::before { position: absolute; inset: .3rem auto .3rem .25rem; width: .25rem; content: ""; background: var(--copper); }
.brand-name { display: grid; line-height: 1.02; }
.brand-name strong { font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.brand-name span { margin-top: .25rem; color: var(--steel-300); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; }
.primary-nav { margin-left: auto; }
.primary-nav ul, .footer-links, .erp-menu { padding: 0; margin: 0; list-style: none; }
.primary-nav ul { display: flex; align-items: center; gap: .25rem; }
.primary-nav a { display: block; padding: .7rem .72rem; color: #eaf0f3; border-radius: .35rem; font-size: .88rem; font-weight: 700; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--white); background: rgba(255,255,255,.09); }
.primary-nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--copper); }
.mobile-menu-button { display: none; min-width: 44px; min-height: 44px; margin-left: auto; color: var(--white); background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius-sm); }
.erp-control { position: relative; }
.erp-button { min-height: 44px; padding: .65rem .8rem; color: var(--white); background: var(--copper-dark); border: 0; border-radius: var(--radius-sm); font-weight: 800; cursor: pointer; }
.erp-button:hover { background: #7c2e08; }
.erp-menu { position: absolute; top: calc(100% + .55rem); right: 0; width: 245px; padding: .45rem; color: var(--navy-900); background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.erp-menu a { display: block; padding: .8rem; color: var(--navy-900); border-radius: .35rem; font-weight: 750; text-decoration: none; }
.erp-menu a:hover { background: var(--paper); }

.button-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 2rem; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .78rem 1.15rem; color: var(--white); background: var(--copper-dark); border: 2px solid var(--copper-dark); border-radius: var(--radius-sm); font-weight: 800; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform var(--transition), background var(--transition), border-color var(--transition); }
.button:hover { color: var(--white); background: #7c2e08; border-color: #7c2e08; transform: translateY(-2px); }
.button--outline { color: var(--navy-900); background: transparent; border-color: var(--steel-500); }
.section--dark .button--outline, .section--ink .button--outline, .page-hero .button--outline, .hero .button--outline, .cta-panel .button--outline { color: var(--white); border-color: rgba(255,255,255,.78); }
.button--outline:hover { color: var(--white); background: var(--navy-900); border-color: var(--navy-900); }
.section--dark .button--outline:hover, .section--ink .button--outline:hover, .page-hero .button--outline:hover, .hero .button--outline:hover, .cta-panel .button--outline:hover { color: var(--navy-950); background: var(--white); border-color: var(--white); }
.button--light { color: var(--navy-900); background: var(--white); border-color: var(--white); }
.button--light:hover { color: var(--white); background: transparent; }

.hero { min-height: min(780px, calc(100vh - 78px)); display: grid; align-items: end; position: relative; isolation: isolate; color: var(--white); background: var(--navy-950) center / cover no-repeat; }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(16,37,50,.88) 0%, rgba(24,56,74,.64) 46%, rgba(24,56,74,.16) 78%), linear-gradient(0deg, rgba(16,37,50,.54), transparent 62%); }
.hero-content { padding: clamp(5rem, 12vw, 9rem) 0 4.5rem; }
.hero h1 span { color: #ffae75; }
.hero .lead { max-width: 59ch; }
.hero-facts { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); max-width: 860px; margin-top: 4rem; border-top: 1px solid rgba(255,255,255,.32); }
.hero-fact { padding: 1.2rem 1rem 0 0; }
.hero-fact strong { display: block; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1; }
.hero-fact span { display: block; margin-top: .45rem; color: #c8d3d9; font-size: .82rem; }
.page-hero { min-height: 430px; display: grid; align-items: end; position: relative; isolation: isolate; color: var(--white); background-color: var(--navy-900); background-position: center; background-size: cover; }
.page-hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(16,37,50,.90), rgba(24,56,74,.58) 65%, rgba(24,56,74,.24)); }
.page-hero-content { padding: 5.5rem 0 3.75rem; }
.page-hero h1 { font-size: clamp(2.7rem, 6vw, 4.9rem); }

.fact-grid, .card-grid, .principle-grid, .contact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.fact-card { padding: 1.5rem; border-top: 4px solid var(--copper); background: var(--white); box-shadow: 0 8px 24px rgba(8,22,33,.07); }
.fact-card strong { display: block; margin-bottom: .5rem; color: var(--navy-900); font-size: 1.7rem; line-height: 1.1; }
.fact-card span { color: var(--steel-700); }
.card { overflow: hidden; background: var(--white); border: 1px solid var(--steel-200); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(8,22,33,.06); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--steel-200); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.card:hover .card-media img { transform: scale(1.025); }
.card-body { padding: 1.45rem; }
.card-body p:last-child { margin-bottom: 0; }
.capability-card { min-height: 240px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; isolation: isolate; overflow: hidden; padding: 1.5rem; color: var(--white); background: var(--navy-800); border-radius: var(--radius); }
.capability-card::before { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(0deg, rgba(16,37,50,.91), rgba(24,56,74,.10)), var(--card-image) center / cover no-repeat; }
.capability-card h3 { margin-bottom: .4rem; }
.capability-card p { margin: 0; color: #dce5ea; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.split--reverse > :first-child { order: 2; }
.split-media { overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.split-media img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; color: var(--white); background: rgba(255,255,255,.18); }
.metric-strip > div { padding: 1.5rem; background: var(--navy-900); }
.metric-strip strong { display: block; color: #ff9d60; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.client-band { display: flex; flex-wrap: wrap; gap: .65rem; }
.client-band span { padding: .65rem .85rem; color: var(--navy-800); background: var(--white); border: 1px solid var(--steel-200); border-radius: 999px; font-size: .86rem; font-weight: 750; }
.cta-panel { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: clamp(2rem, 5vw, 4rem); color: var(--white); background: linear-gradient(120deg, #315f75, #17394b); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.cta-panel h2 { max-width: 20ch; margin-bottom: .35em; }

.principle-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.principle { padding: 1.35rem; border-left: 3px solid var(--copper); background: var(--white); }
.principle h3 { font-size: 1.08rem; }

.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.spec-card { display: grid; grid-template-columns: 90px 1fr; gap: 1.25rem; align-items: start; padding: 1.2rem; background: var(--white); border: 1px solid var(--steel-200); border-radius: var(--radius); }
.spec-card img { width: 90px; height: 90px; object-fit: cover; border-radius: .4rem; }
.spec-card h3 { margin-bottom: .35rem; }
.spec-card p { margin: 0; color: var(--steel-700); }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 2rem; padding: 0; list-style: none; }
.feature-list li { position: relative; padding-left: 1.4rem; }
.feature-list li::before { position: absolute; left: 0; color: var(--copper); content: "■"; font-size: .7rem; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.project-card { display: flex; flex-direction: column; }
.project-card .card-body { display: flex; flex: 1; flex-direction: column; }
.project-tag { margin-bottom: .65rem; color: var(--copper-dark); font-size: .75rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.video-card { overflow: hidden; background: var(--navy-900); border-radius: var(--radius); }
.video-card video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-copy { padding: 1.25rem; color: var(--white); }
.video-copy h3 { margin-bottom: .4rem; }
.video-copy p { margin: 0; color: #ccd7dd; }

.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contact-card { padding: 1.5rem; background: var(--white); border: 1px solid var(--steel-200); border-radius: var(--radius); }
.contact-card address { font-style: normal; }
.contact-links { display: grid; gap: .65rem; }
.contact-links a { width: fit-content; font-weight: 800; }
.form-shell { padding: clamp(1.4rem, 4vw, 2.5rem); background: var(--white); border: 1px solid var(--steel-200); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; align-content: start; gap: .4rem; }
.field--full { grid-column: 1 / -1; }
label, legend { color: var(--navy-900); font-weight: 800; }
input, select, textarea { width: 100%; min-height: 48px; padding: .72rem .8rem; color: var(--navy-900); background: var(--white); border: 1px solid var(--steel-500); border-radius: var(--radius-sm); }
textarea { min-height: 145px; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--error); }
.field-error { min-height: 1.2em; margin: 0; color: var(--error); font-size: .85rem; font-weight: 700; }
.checkbox { display: grid; grid-template-columns: 1.2rem 1fr; gap: .7rem; align-items: start; }
.checkbox input { width: 1.2rem; min-height: 1.2rem; margin-top: .2rem; }
.form-status { margin: 1rem 0 0; padding: 1rem; border-radius: var(--radius-sm); }
.form-status:empty { display: none; }
.form-status--error { color: #7a1710; background: #fee9e7; border-left: 4px solid var(--error); }
.form-status--notice { color: #5f3a00; background: #fff3cf; border-left: 4px solid var(--warning); }
.phase-notice { padding: 1rem; color: #5f3a00; background: #fff3cf; border-left: 4px solid var(--warning); }

.profile-dialog { width: min(92vw, 560px); padding: 0; color: var(--navy-900); background: var(--white); border: 0; border-radius: var(--radius-lg); box-shadow: 0 25px 90px rgba(0,0,0,.4); }
.profile-dialog::backdrop { background: rgba(3, 12, 18, .78); }
.dialog-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding: 1.5rem 1.5rem 0; }
.dialog-head h2 { margin: 0; font-size: 1.8rem; }
.dialog-close { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--navy-900); background: #e9edef; border: 0; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.dialog-body { padding: 1.25rem 1.5rem 1.5rem; }
.privacy-note { padding: .9rem; color: var(--steel-700); background: var(--paper); border-radius: var(--radius-sm); font-size: .9rem; }

.site-footer { color: #dce5ea; background: var(--navy-950); }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1fr; gap: 2.5rem; padding: 4.5rem 0 3rem; }
.footer-title { display: block; margin-bottom: .8rem; color: var(--white); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid address { font-style: normal; }
.footer-grid p, .footer-grid address { font-size: .9rem; }
.footer-links { display: grid; gap: .5rem; }
.footer-links a { color: #dce5ea; text-decoration: none; }
.footer-links a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid rgba(255,255,255,.13); color: var(--steel-300); font-size: .82rem; }
.footer-bottom a { color: #ffb07a; font-weight: 800; text-decoration: none; }
.footer-bottom a:hover { color: var(--white); text-decoration: underline; }

.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { max-width: none; }

@media (max-width: 980px) {
  .mobile-menu-button { display: inline-grid; place-items: center; }
  .primary-nav { position: absolute; top: 100%; right: 0; left: 0; display: none; padding: .75rem 1rem 1rem; background: var(--navy-950); border-top: 1px solid rgba(255,255,255,.12); }
  .primary-nav[data-open="true"] { display: block; }
  .primary-nav ul { display: grid; }
  .primary-nav a { padding: .85rem; }
  .erp-control { margin-left: 0; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .header-inner { min-height: 70px; }
  .brand-name span { display: none; }
  .brand-name strong { font-size: .87rem; }
  .erp-button { padding-inline: .65rem; font-size: .78rem; }
  .erp-menu { position: fixed; top: 72px; right: 1rem; }
  .hero { min-height: 720px; }
  .hero::before { background: linear-gradient(0deg, rgba(16,37,50,.90), rgba(24,56,74,.24)); }
  .hero-content { padding-bottom: 2.5rem; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2.5rem; }
  .hero-fact { padding-top: 1rem; }
  .lede-grid, .split, .cta-panel { grid-template-columns: 1fr; }
  .split--reverse > :first-child { order: initial; }
  .section-heading { display: block; }
  .section-heading .text-link { margin-top: .7rem; }
  .fact-grid, .card-grid, .contact-grid, .project-grid, .media-grid, .spec-grid, .form-grid { grid-template-columns: 1fr; }
  .principle-grid { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .metric-strip { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { display: block; }
  .footer-bottom span { display: block; margin-top: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .button, .erp-button, .brand-emblem, .fact-card, .card { border: 1px solid CanvasText; }
  .eyebrow::before, .brand-emblem::before { background: CanvasText; }
}
