/* ==========================================================================
   Pontus Materials: Independent Materials Failure Analysis
   ========================================================================== */

:root {
  --ink: #14213d;          /* deep navy, primary text/brand */
  --ink-soft: #3b4661;
  --muted: #5d6679;
  --paper: #fbfaf7;        /* warm off-white page */
  --tint: #f1eee7;         /* alternate section background */
  --card: #ffffff;
  --line: #e0dbd0;
  --accent: #b5542d;       /* oxidised copper */
  --accent-strong: #97421f;
  --accent-soft: #f6e3d9;
  --ref: #3f6f8f;          /* reference trace */
  --dark-bg: #14213d;
  --dark-text: #e9ecf3;
  --dark-muted: #aeb6c8;
  --dark-line: #2c3a5c;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 8px 24px rgba(20, 33, 61, .06);
  --container: 1120px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ecf3;
    --ink-soft: #c9cfdc;
    --muted: #9aa3b6;
    --paper: #0f1629;
    --tint: #141d33;
    --card: #182240;
    --line: #28345a;
    --accent: #e0835a;
    --accent-strong: #f09a73;
    --accent-soft: #3a2621;
    --ref: #7fb0d0;
    --dark-bg: #0a1020;
    --dark-line: #1f2a47;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
abbr[title] { text-decoration: none; cursor: help; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.eyebrow {
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .8em;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s;
  font-family: inherit;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink-soft); }
.btn-small { padding: .5em 1.1em; font-size: .92rem; }
.btn-light { background: #fff; color: #14213d; border-color: #fff; }
.btn-light:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #14213d; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-family: var(--serif); font-weight: 700; font-size: 1.05rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; }
.brand-tag { font-size: .74rem; color: var(--muted); letter-spacing: .04em; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .96rem; }
.site-nav a:not(.btn):hover { color: var(--accent); }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; position: absolute; left: 11px; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { content: ""; top: -7px; left: 0; }
.nav-toggle-bar::after { content: ""; top: 7px; left: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px; display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 14px; }
.hero-note { font-size: .92rem; color: var(--muted); }

.hero-figure {
  margin: 0; padding: 22px 22px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
/* Two SEM micrographs side by side. Each panel's flex-grow (set inline) equals its
   image's aspect ratio, so both render at the same height without cropping. */
.sem-pair { display: flex; gap: 10px; align-items: flex-start; }
.sem-panel { position: relative; flex-basis: 0; min-width: 0; margin: 0; }
.sem-panel img { display: block; width: 100%; height: auto; border-radius: 8px; background: #111; }
.sem-tag {
  position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 4px;
  background: rgba(0, 0, 0, .68); color: #fff; font-size: .74rem; font-weight: 600; line-height: 1.3;
}
.hero-figure figcaption { font-size: .86rem; color: var(--muted); font-style: italic; margin-top: 12px; }

.credentials {
  list-style: none; margin: 56px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: max-content max-content 1fr 1fr; gap: 18px 36px; align-items: start;
}
.credentials li { display: flex; flex-direction: column; }
.credentials .cred-text { padding-left: 24px; border-left: 1px solid var(--line); }
.credentials .cred-text span { line-height: 1.5; }
.credentials strong { font-family: var(--serif); font-size: 1.7rem; color: var(--ink); line-height: 1.1; }
.credentials span { font-size: .88rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-tint { background: var(--tint); }
.section-dark { background: var(--dark-bg); color: var(--dark-text); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: #f0a07b; }
.section-dark p { color: var(--dark-muted); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.section-intro { color: var(--muted); font-size: 1.05rem; }

/* Problems */
.problem-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.problem-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px;
}
.problem-q { font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--ink); }
.problem-a { font-size: .9rem; color: var(--muted); }

/* Services */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.service-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.service-card p { color: var(--ink-soft); font-size: .97rem; }
.service-icon {
  width: 46px; height: 46px; border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 16px;
}
.service-icon svg { width: 26px; height: 26px; }
.tags { list-style: none; margin: auto 0 0; padding: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: .76rem; font-weight: 600; color: var(--ink-soft); background: var(--tint); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }

.also-offer { margin-top: 36px; padding: 26px 28px; border-left: 3px solid var(--accent); background: var(--tint); border-radius: 0 var(--radius) var(--radius) 0; }
.also-offer h3 { font-size: 1.1rem; }
.also-offer ul { margin: 0; padding-left: 1.1em; color: var(--ink-soft); }
.also-offer li + li { margin-top: 8px; }

/* Toolkit */
.toolkit { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.technique-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.technique-list li {
  border: 1px solid var(--dark-line); border-radius: 8px; padding: 12px 10px; text-align: center;
  font-weight: 600; font-size: .9rem; color: var(--dark-text); background: rgba(255,255,255,.03);
}

/* Process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 56px; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0; font-family: var(--serif); font-size: 1.9rem; font-weight: 700; color: var(--accent);
}
.steps li::after { content: ""; position: absolute; top: 22px; left: 52px; right: -12px; height: 1px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps p { color: var(--ink-soft); font-size: .96rem; }
.confidential-note { margin-top: 32px; padding: 16px 20px; background: var(--tint); border-radius: var(--radius); color: var(--ink-soft); }

/* Rates */
.rate-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 20px; align-items: stretch; }
.rate-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.rate-card p:last-child { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.rate-card-featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.rate-label { font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.rate-price { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.1; margin-bottom: 2px; }
.rate-price span { font-size: 1.1rem; font-weight: 400; color: var(--muted); }
.rate-unit { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.rate-cta { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.rate-footnote { margin: 0; font-size: .92rem; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.contact-direct { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.contact-direct li { display: flex; flex-direction: column; }
.cd-label { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dark-muted); font-weight: 700; }
.cd-value { color: var(--dark-text); }
.contact-direct a { color: #fff; font-size: 1.08rem; text-decoration-color: rgba(255,255,255,.35); word-break: break-word; }
.contact-direct a:hover { color: #f0a07b; }

.contact-form {
  background: rgba(255,255,255,.04); border: 1px solid var(--dark-line); border-radius: 14px; padding: 28px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field label { font-size: .88rem; font-weight: 600; margin-bottom: 6px; color: var(--dark-text); }
.optional { font-weight: 400; color: var(--dark-muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--dark-text); background: rgba(0,0,0,.18);
  border: 1px solid var(--dark-line); border-radius: 8px; padding: 11px 12px; width: 100%;
}
.field select option { color: #14213d; }
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: #7d88a1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #f0a07b; box-shadow: 0 0 0 3px rgba(240,160,123,.25); }
.field [aria-invalid="true"] { border-color: #ff8a80; }
.field-check { flex-direction: row; gap: 10px; align-items: flex-start; }
.field-check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.field-check label { font-weight: 400; color: var(--dark-muted); font-size: .9rem; }
.field-check a { color: #f0a07b; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 14px 0 0; min-height: 1.5em; font-size: .95rem; }
.form-status.is-error { color: #ffb4a8; }
.form-status.is-success { color: #9fe0b5; }

/* Footer */
.site-footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Legal page */
.legal { padding: 64px 0 88px; }
.legal .container { max-width: 760px; }
.legal h2 { font-size: 1.4rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .toolkit, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .service-grid, .problem-list { grid-template-columns: repeat(2, 1fr); }
  .rate-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li::after { display: none; }
  .credentials { grid-template-columns: max-content 1fr; gap: 18px 36px; }
  .credentials .cred-text { grid-column: 1 / -1; padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }
  .hero { padding: 44px 0 32px; }
  .section { padding: 64px 0; }
  .service-grid, .problem-list, .steps, .field-row { grid-template-columns: 1fr; }
  .field-row { gap: 0; }
  .credentials { grid-template-columns: 1fr 1fr; margin-top: 40px; }
  .sem-tag { font-size: .68rem; left: 6px; bottom: 6px; }
  .technique-list { grid-template-columns: repeat(2, 1fr); }
  .contact-form { padding: 20px; }
  .brand-tag { display: none; }
}
