/* Esarem Technologies: site styles
   Palette drawn from a circuit board: solder-mask green, gold plating, silkscreen white.
   Each component is styled in one place below; there are no later override blocks.
   When you change this file, bump the ?v= number on every page (see README). */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --green-950: #0b241e;
  --green-900: #10332a;
  --green-700: #1d4a3e;
  --gold: #c9a65b;
  --gold-soft: #e4d2a4;
  --gold-deep: #84651f;
  --ivory: #f4f2ec;
  --paper: #f5f6f3;
  --white: #ffffff;
  --text: #16231f;
  --muted: #56625d;
  --muted-dark: #a9b8b1;
  --line: #dde1dc;
  --line-dark: rgba(244, 242, 236, .14);
  --field: #848e89;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --max: 1220px;
  --gutter: clamp(20px, 4vw, 44px);
  --radius: 4px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }

/* Focus: deep gold on light backgrounds, bright gold on the dark green areas (both at least 3:1) */
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 2px; }
.site-header :focus-visible, .site-footer :focus-visible, .hero :focus-visible,
.page-head :focus-visible, .section-dark :focus-visible, .contact-card :focus-visible { outline-color: var(--gold); }

h1, h2, h3 { margin: 0 0 .5em; color: inherit; text-wrap: balance; overflow-wrap: break-word; }
h1, h2 { font-family: var(--serif); font-weight: 420; letter-spacing: -0.015em; font-variation-settings: "opsz" 72; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.08; }
h3 { font-family: var(--sans); font-size: 1.12rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.005em; }
p { margin: 0 0 1em; max-width: 66ch; text-wrap: pretty; }
.lead { font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.6; color: var(--muted); max-width: 56ch; }
.meta {
  font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.6rem;
}
.meta span { white-space: nowrap; display: inline-block; }
.meta span + span::before { content: "·"; margin: 0 .7em; color: var(--gold-soft); opacity: .7; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-paper { background: var(--paper); }
.section-dark { background: var(--green-900); color: var(--ivory); }
.section-dark .lead, .section-dark p { color: var(--muted-dark); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head p { color: var(--muted); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--green-900); color: var(--ivory); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px;
  font: inherit; font-weight: 600; font-size: .98rem; letter-spacing: .01em;
  border-radius: var(--radius); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn-gold { background: var(--gold); color: var(--green-950); }
.btn-gold:hover { background: var(--gold-soft); color: var(--green-950); }
.btn-green { background: var(--green-900); color: var(--ivory); }
.btn-green:hover { background: var(--green-700); color: var(--ivory); }
.btn-line { border-color: var(--green-900); color: var(--green-900); }
.btn-line:hover { background: var(--green-900); color: var(--ivory); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Header. The logo is kept small on purpose: 40px tall on desktop, 36px on phones. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--green-950); color: var(--ivory); border-bottom: 1px solid var(--line-dark); }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav-links { display: flex; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ivory); text-decoration: none; font-size: .98rem; font-weight: 500; padding: 8px 0; border-bottom: 1px solid transparent; opacity: .86; }
.nav-links a:hover { opacity: 1; border-bottom-color: rgba(244,242,236,.4); }
.nav-links a[aria-current="page"] { opacity: 1; border-bottom-color: var(--gold); }
.nav-contact { display: flex; align-items: center; gap: 20px; }
.nav-phone { color: var(--ivory); text-decoration: none; font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; opacity: .86; }
.nav-phone:hover { color: var(--ivory); opacity: 1; }
.nav-phone svg { width: 18px; height: 18px; color: var(--gold); }
.nav .btn { min-height: 44px; padding: 0 20px; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .js .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; min-height: 44px; padding: 0 16px;
    background: none; border: 1px solid var(--line-dark); border-radius: var(--radius);
    font: inherit; font-weight: 600; color: var(--ivory); cursor: pointer;
  }
  .js .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--green-950); border-bottom: 1px solid var(--line-dark);
    flex-direction: column; align-items: stretch; gap: 0; padding: 4px var(--gutter) 24px;
  }
  .js .nav-open .nav { display: flex; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { display: block; padding: 15px 0; border-bottom: 1px solid var(--line-dark); opacity: 1; }
  .nav-links a[aria-current="page"] { border-bottom-color: var(--line-dark); color: var(--gold); }
  .nav-contact { flex-direction: column; align-items: stretch; margin-top: 18px; }
  .no-js .header-inner { flex-wrap: wrap; padding: 12px 0; }
  .no-js .nav { width: 100%; flex-wrap: wrap; }
}
@media (max-width: 600px) { .site-header .brand img { height: 36px; } }

/* Circuit artwork (home hero and inner page heads) */
.hero { position: relative; overflow: hidden; background: var(--green-900); color: var(--ivory); }
.hero-inner { position: relative; z-index: 1; padding-top: clamp(80px, 12vw, 160px); padding-bottom: clamp(64px, 9vw, 112px); }
.hero h1 { max-width: 11ch; margin-bottom: .4em; }
.hero .lead { color: var(--muted-dark); margin-bottom: 2.4rem; max-width: 46ch; }
.traces {
  position: absolute; top: 0; right: -4%; height: 100%; width: 62%; color: var(--gold); pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%); mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
}
.traces svg { width: 100%; height: 100%; }
.traces .t { fill: none; stroke: currentColor; stroke-width: 1.3; opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
.traces .v { fill: var(--green-900); stroke: currentColor; stroke-width: 1.3; opacity: .7; }
.traces .chip { fill: var(--green-950); stroke: currentColor; stroke-width: 1.4; opacity: .9; }
.traces .pad { fill: currentColor; opacity: .75; }
.traces .chip-label { fill: currentColor; font-family: var(--serif); font-size: 26px; letter-spacing: .02em; opacity: .9; }
.traces .chip-year { fill: currentColor; font-family: var(--sans); font-size: 11px; letter-spacing: .3em; opacity: .6; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .traces .t { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.3,.6,.2,1) forwards; }
  .traces .t.d1 { animation-delay: .12s; }
  .traces .t.d2 { animation-delay: .24s; }
  .traces .t.d3 { animation-delay: .36s; }
  .traces .t.d4 { animation-delay: .48s; }
  .traces .v { opacity: 0; animation: appear .4s ease forwards; animation-delay: 1.9s; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: .7; } }
}
/* Home hero on tablets and phones: the circuit artwork gets its own band under the text */
@media (max-width: 900px) {
  .hero { display: flex; flex-direction: column; }
  .hero-inner { padding-bottom: 8px; }
  .hero .traces {
    position: relative; order: 2; right: auto; left: -30%; width: 160%;
    height: clamp(300px, 88vw, 460px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  }
}
/* Home hero on phones: the top line breaks onto two deliberate lines */
@media (max-width: 560px) {
  .hero .meta span:first-child { display: block; margin-bottom: .55em; }
  .hero .meta span:nth-child(2)::before { content: none; }
}

/* Statement / intro */
.statement { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(40px, 7vw, 112px); align-items: start; }
.statement h2 { font-size: clamp(1.9rem, 3.3vw, 2.85rem); line-height: 1.16; margin: 0; }
.statement-body p { color: var(--muted); }
.statement-body .text-link { margin-top: .5em; display: inline-block; }
@media (max-width: 860px) { .statement { grid-template-columns: 1fr; } }

.text-link { font-weight: 600; color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.text-link:hover { color: var(--text); }

/* Product index (home). Photos sit in a thin frame so they don't float on the paper background. */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.index a {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) 148px; gap: 32px; align-items: center;
  padding: 28px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.index h3 { font-family: var(--serif); font-weight: 430; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; margin: 0; letter-spacing: -0.01em; font-variation-settings: "opsz" 48; }
.index p { color: var(--muted); margin: 0; }
.index img { width: 148px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.index a:hover h3 { color: var(--gold-deep); }
@media (max-width: 760px) {
  .index a { grid-template-columns: 1fr 96px; gap: 8px 20px; }
  .index h3 { grid-column: 1; }
  .index p { grid-column: 1; grid-row: 2; }
  .index img { grid-column: 2; grid-row: 1 / span 2; width: 96px; }
}

/* Principles (dark) */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; list-style: none; margin: 0; padding: 0; }
.principles li { border-top: 1px solid var(--gold); padding-top: 24px; }
.principles h3 { color: var(--ivory); }
.principles p { margin: 0; font-size: 1rem; }
@media (max-width: 960px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* Inner page heads */
.page-head { background: var(--green-900); color: var(--ivory); padding: clamp(64px, 9vw, 120px) 0 clamp(56px, 7vw, 88px); position: relative; overflow: hidden; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 4.3rem); max-width: 16ch; }
.page-head .lead { color: var(--muted-dark); margin-bottom: 0; }
.page-head .meta a { color: var(--gold); text-decoration: none; }
.page-head .meta a:hover { text-decoration: underline; }
.page-head .traces { width: 46%; opacity: .85; }
@media (max-width: 900px) { .page-head .traces { display: none; } }

/* Split image + text (About) */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 104px); align-items: center; }
.split-media { margin: 0; }
.split-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.split p { color: var(--muted); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split-media img { aspect-ratio: 4 / 3; } }

.leader { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 104px); }
.leader .lead { color: var(--text); }
.pullquote { margin: 40px 0 0; padding-left: 28px; border-left: 1px solid var(--gold); font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.25; font-weight: 400; font-style: italic; font-variation-settings: "opsz" 48; }
@media (max-width: 860px) { .leader { grid-template-columns: 1fr; } }

.duo { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 104px); }
.grid-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.grid-list li { padding: 26px 28px 26px 0; border-bottom: 1px solid var(--line); }
.grid-list li:nth-child(even) { padding: 26px 0 26px 28px; border-left: 1px solid var(--line); }
.grid-list p { color: var(--muted); margin: 0; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .grid-list { grid-template-columns: 1fr; }
  .grid-list li, .grid-list li:nth-child(even) { padding: 22px 0; border-left: 0; }
}

/* Products catalogue */
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 36px 0 0; list-style: none; padding: 0; }
.jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border: 1px solid var(--line-dark); border-radius: 999px; color: var(--ivory); text-decoration: none; font-size: .95rem; }
.jump a:hover { border-color: var(--gold); color: var(--gold); }
.catalogue-group { padding: clamp(64px, 8vw, 104px) 0; border-bottom: 1px solid var(--line); }
.catalogue-group:nth-of-type(odd) { background: var(--paper); }
.cg-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.cg-intro { position: sticky; top: calc(var(--header-h) + 40px); }
.cg-intro img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 28px; background: var(--white); border: 1px solid var(--line); }
.cg-intro h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.cg-intro p { color: var(--muted); }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.items li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.items h3 { margin: 0 0 6px; font-size: 1.15rem; }
.items p { margin: 0; color: var(--muted); }
/* A small photo to the right of the product line it shows; the text column keeps the rest */
.items li.has-img { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 24px; align-items: start; }
.items .item-img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
@media (max-width: 860px) { .cg-grid { grid-template-columns: 1fr; } .cg-intro { position: static; } }
@media (max-height: 640px) { .cg-intro { position: static; } }
@media (max-width: 600px) {
  .items li.has-img { grid-template-columns: minmax(0, 1fr) 68px; gap: 16px; }
  .items .item-img { width: 68px; height: 68px; }
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.form h2 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field label .req { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--white);
  border: 1px solid var(--field); border-radius: var(--radius); padding: 13px 15px; min-height: 52px;
}
.field textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: var(--green-900); outline: none; box-shadow: 0 0 0 3px rgba(201,166,91,.45); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 26px; }
.form-foot p { margin: 0; color: var(--muted); font-size: .95rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.contact-card { background: var(--green-900); color: var(--ivory); border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); }
.contact-card h2 { font-size: 1.9rem; margin-bottom: 1em; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: grid; grid-template-columns: 26px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line-dark); }
.contact-list li > div { min-width: 0; overflow-wrap: anywhere; }
.contact-list svg { width: 21px; height: 21px; color: var(--gold); margin-top: 3px; }
.contact-list strong { display: block; font-weight: 600; font-size: .85rem; letter-spacing: .06em; color: var(--muted-dark); margin-bottom: 2px; }
.contact-list a { color: var(--ivory); text-decoration: none; font-size: 1.06rem; }
.contact-list a:hover { color: var(--gold); }
.contact-list span { color: var(--muted-dark); }
.contact-list address { color: var(--ivory); font-style: normal; }
.contact-list address + span { display: inline-block; margin-top: 8px; }

.map-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.map-card { padding: clamp(28px, 4vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.map-card h3 { font-family: var(--serif); font-weight: 450; font-size: 1.6rem; margin: 0; }
.map-card address { font-style: normal; font-size: 1.08rem; line-height: 1.55; }
.map-card .btn { align-self: flex-start; margin-top: 10px; }
.map-phone { margin: 0; }
.map-phone a { color: var(--green-900); font-weight: 600; text-decoration: none; }
.map-frame { min-height: 400px; background: var(--paper); }
.map-frame iframe { width: 100%; height: 100%; min-height: 400px; border: 0; display: block; }
@media (max-width: 800px) { .map-wrap { grid-template-columns: 1fr; } }

.sales-offices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 40px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.sales-offices h3 { margin: 0; color: var(--muted); font-size: 1rem; font-weight: 600; }
.sales-offices ul { display: flex; flex-wrap: wrap; gap: 8px 40px; list-style: none; margin: 0; padding: 0; }
.sales-offices li { font-family: var(--serif); font-size: 1.45rem; font-weight: 430; font-variation-settings: "opsz" 36; }

/* Message pages (thanks, 404) */
.message { min-height: 58vh; display: flex; align-items: center; }
.message h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); max-width: 18ch; }

/* Footer */
.site-footer { background: var(--green-950); color: var(--muted-dark); padding: 72px 0 32px; font-size: .96rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.4fr; gap: 40px; }
.footer-grid .brand { margin-bottom: 20px; }
.footer-grid .brand img { height: 48px; }
.footer-grid p { max-width: 32ch; }
.site-footer h2 { font-family: var(--sans); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 9px; }
.site-footer a { color: var(--ivory); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer address { font-style: normal; color: var(--ivory); margin-bottom: 14px; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-dark); font-size: .88rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
