/* Alchemical Machines Inc. — 2026 redesign
   Dark industrial / bronze-copper. Vanilla CSS, system fonts, mobile-first. */

:root {
  --bg: #0b0a09;
  --bg-2: #121010;
  --surface: #171412;
  --surface-2: #1e1a17;
  --ink: #efe9df;
  --ink-soft: #b9afa1;
  --ink-mute: #857b6e;
  --bronze: #b87333;
  --copper: #e0a06a;
  --copper-deep: #8a5126;
  --line: rgba(239, 233, 223, 0.10);
  --line-strong: rgba(184, 115, 51, 0.45);
  --metal: linear-gradient(120deg, #7d4a22 0%, #d99a62 38%, #f0c291 50%, #b87333 68%, #6e421f 100%);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --gutter: 20px;
  --max: 1240px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul { list-style: none; }
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }
::selection { background: var(--bronze); color: #fff; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--bronze); color: #fff; padding: 10px 16px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.block { padding: 72px 0; }
.block.tight { padding: 48px 0; }

/* ---------- type ---------- */
.eyebrow, .section-num, .num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
}
.eyebrow { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--metal); }

h1, h2, h3 { font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
h1 {
  font-size: clamp(38px, 9vw, 92px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
h2 { font-size: clamp(28px, 5vw, 48px); font-weight: 300; letter-spacing: -0.03em; }
h3 { font-size: clamp(21px, 2.6vw, 28px); font-weight: 400; letter-spacing: -0.015em; line-height: 1.2; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 62ch; }

.section-head {
  display: grid;
  gap: 10px 24px;
  margin-bottom: 40px;
  align-items: end;
}
.section-head .rule { height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 10, 9, 0.82);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.site-header.scrolled { background: rgba(11, 10, 9, 0.95); border-bottom-color: var(--line-strong); }
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  letter-spacing: 0.2em; text-decoration: none; white-space: nowrap;
}
.brand::before {
  content: ""; width: 14px; height: 14px; flex: none;
  border: 1.5px solid var(--bronze); transform: rotate(45deg);
  background: radial-gradient(circle, var(--copper) 0 2px, transparent 2.5px);
}
.brand em {
  font-style: normal;
  background: var(--metal); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

.nav-toggle {
  margin-left: auto; width: 44px; height: 44px; display: grid; place-content: center; gap: 6px;
  background: none; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease), opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.main-nav {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  display: none; flex-direction: column;
  background: var(--bg); border-bottom: 1px solid var(--line-strong);
  padding: 8px var(--gutter) 24px;
}
.nav-open .main-nav { display: flex; }
.main-nav a {
  font-size: 18px; text-decoration: none; padding: 16px 0;
  border-bottom: 1px solid var(--line); color: var(--ink-soft);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--copper); }

.header-phone {
  display: none;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  text-decoration: none; white-space: nowrap;
  padding: 10px 16px; border: 1px solid var(--line-strong); color: var(--copper);
  transition: background .25s, color .25s;
}
.header-phone:hover { background: var(--bronze); color: #fff; border-color: var(--bronze); }

/* ---------- buttons ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  padding: 16px 26px; min-height: 52px; cursor: pointer;
  transition: transform .25s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.btn-brass {
  color: #140d07; background: var(--metal); background-size: 180% 100%; background-position: 0 0;
  border: 1px solid transparent;
}
.btn-brass:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(184, 115, 51, .7); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--copper); color: var(--copper); transform: translateY(-2px); }

/* ---------- hero (home) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(88vh, 820px); display: flex; align-items: flex-end;
  padding: 120px 0 56px;
}
.hero-photo {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 40%;
  filter: grayscale(.75) sepia(.35) contrast(1.05) brightness(.7);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11,10,9,.55) 0%, rgba(11,10,9,.35) 35%, rgba(11,10,9,.92) 100%),
    linear-gradient(90deg, rgba(11,10,9,.85) 0%, rgba(11,10,9,.2) 70%);
}
.hero-panel { max-width: 980px; }
.hero-panel h1 { margin-bottom: 26px; }
.hero-panel p { font-size: clamp(17px, 2vw, 21px); color: var(--ink-soft); max-width: 52ch; margin-bottom: 36px; }

/* facts strip */
.facts-strip { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.facts-strip .inner { max-width: var(--max); margin: 0 auto; display: grid; }
.facts-strip span {
  padding: 20px var(--gutter); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; line-height: 1.5; color: var(--ink-soft);
}
.facts-strip span:first-child { border-top: none; }

/* ---------- sub-page hero ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 88px 0 72px; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(184,115,51,.22), transparent 70%),
    var(--bg-2);
}
.page-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px; background: var(--metal); opacity: .7;
}
.page-hero h1 { max-width: 18ch; font-size: clamp(36px, 7.5vw, 76px); }
.page-hero p { margin-top: 24px; max-width: 58ch; color: var(--ink-soft); font-size: clamp(17px, 2vw, 20px); }

/* ---------- split ---------- */
.split { display: grid; gap: 40px; align-items: center; }
.split .body h3 { margin-bottom: 22px; }
.split .body p { color: var(--ink-soft); margin-bottom: 16px; max-width: 60ch; }
.split .body p strong { color: var(--ink); font-weight: 600; }
.split .body p strong:first-child { color: var(--copper); }
.img-frame { position: relative; }
.img-frame::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1;
  border: 1px solid var(--line-strong);
}
.img-frame { isolation: isolate; }
.img-frame img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  filter: grayscale(.6) sepia(.3) contrast(1.05) brightness(.85);
}
.img-frame .tag {
  position: absolute; left: 0; bottom: 0;
  background: var(--bg); border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--copper);
  padding: 10px 16px;
}

/* aside / contact panel */
.aside {
  background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--bronze);
  padding: 32px 28px;
}
.aside h3 { font-size: 20px; margin-bottom: 18px; color: var(--copper); }
.aside h3:not(:first-child) { margin-top: 36px; }
.aside li { padding: 12px 0 12px 22px; border-top: 1px solid var(--line); color: var(--ink-soft); position: relative; }
.aside li::before { content: ""; position: absolute; left: 0; top: 22px; width: 8px; height: 8px; border: 1px solid var(--copper); transform: rotate(45deg); }
.aside p { color: var(--ink-soft); }
.contact-body .detail { margin-bottom: 26px; padding-left: 20px; border-left: 1px solid var(--line-strong); }
.contact-body .detail strong { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); font-weight: 600; margin-bottom: 4px; }
.contact-body .detail a { text-decoration: none; border-bottom: 1px solid var(--bronze); }
.contact-body .detail a:hover { color: var(--copper); }
.contact-body .btn { margin-top: 12px; }

/* ---------- service rows (home) ---------- */
.svc-list { border-bottom: 1px solid var(--line); }
.svc-row {
  display: grid; grid-template-columns: 44px 1fr 24px; gap: 14px; align-items: center;
  padding: 26px 0; border-top: 1px solid var(--line); text-decoration: none;
  position: relative; transition: padding .35s var(--ease), background .35s;
}
.svc-row::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 0; background: var(--metal);
  transition: width .5s var(--ease);
}
.svc-row:hover::before { width: 100%; }
.svc-row .idx { font-family: var(--mono); font-size: 13px; color: var(--copper); letter-spacing: .1em; }
.svc-row .name { display: block; font-size: clamp(19px, 3vw, 30px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; }
.svc-row .hint { font-size: 14.5px; color: var(--ink-mute); margin-top: 6px; }
.svc-row .arrow { color: var(--copper); transition: transform .35s var(--ease); justify-self: end; }
.svc-row:hover .arrow { transform: translateX(6px); }
.svc-row:hover .name { color: var(--copper); }
.section-foot { margin-top: 44px; }

/* ---------- gallery ---------- */
.gallery { display: grid; gap: 28px; }
.g-item { background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.g-item img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  filter: grayscale(.65) sepia(.3) contrast(1.05) brightness(.85);
  transition: transform .8s var(--ease), filter .5s;
}
.g-item:hover img { transform: scale(1.04); filter: grayscale(.2) sepia(.2) contrast(1.05) brightness(.95); }
.g-item .imgbox { overflow: hidden; }
.g-item figcaption { padding: 22px 22px 26px; color: var(--ink-soft); font-size: 15px; border-top: 1px solid var(--line-strong); }
.g-item figcaption strong { display: block; color: var(--ink); font-weight: 500; font-size: 18px; margin-bottom: 6px; letter-spacing: -0.01em; }

/* ---------- materials ---------- */
.mat-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.mat-card { background: var(--surface); padding: 30px 26px; color: var(--ink-soft); font-size: 15px; line-height: 1.8; transition: background .3s; }
.mat-card:hover { background: var(--surface-2); }
.mat-card strong {
  display: block; margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--copper); font-weight: 600;
}

/* ---------- services page cards ---------- */
.svc-grid { display: grid; gap: 28px; }
.svc-card {
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  transition: border-color .4s, transform .4s var(--ease);
}
.svc-card:hover { border-color: var(--line-strong); }
.svc-card::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--metal); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.svc-card:hover::after { transform: scaleX(1); }
.svc-card .card-body { padding: 30px 26px 28px; flex: 1; }
.svc-card h3 { margin: 12px 0 16px; }
.svc-card p { color: var(--ink-soft); font-size: 15.5px; }
.svc-card img {
  order: -1; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  filter: grayscale(.65) sepia(.3) contrast(1.05) brightness(.8);
  transition: filter .5s;
}
.svc-card:hover img { filter: grayscale(.2) sepia(.2) contrast(1.05) brightness(.92); }
.svc-card.plain { background: linear-gradient(160deg, var(--surface-2), var(--surface)); justify-content: center; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 80px; padding: 56px 28px; text-align: left;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(184,115,51,.28), transparent 70%),
    var(--surface);
}
.cta-band h2 { margin-bottom: 14px; max-width: 18ch; }
.cta-band p { color: var(--ink-soft); font-size: 18px; max-width: 50ch; margin-bottom: 32px; }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line-strong); margin-top: 0; }
.footer-inner { display: grid; gap: 40px; padding-top: 64px; padding-bottom: 48px; }
.f-col { font-size: 14.5px; color: var(--ink-soft); line-height: 1.9; }
.f-col strong { display: inline-block; margin-bottom: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.f-col p { margin-bottom: 14px; }
.f-col .brand { margin-bottom: 18px; }
.f-col a { text-decoration: none; }
.f-col a:not(.brand):hover { color: var(--copper); }
.f-col nav a { display: block; }
.footer-bar { border-top: 1px solid var(--line); }
.footer-bar .inner {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-mute);
}

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- ≥ 640px ---------- */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .block { padding: 96px 0; }
  .mat-grid { grid-template-columns: repeat(2, 1fr); }
  .facts-strip .inner { grid-template-columns: repeat(2, 1fr); }
  .facts-strip span { border-left: 1px solid var(--line); border-top: none; }
  .facts-strip span:nth-child(odd) { border-left: none; }
  .facts-strip span { border-bottom: 1px solid var(--line); }
  .facts-strip span:last-child { grid-column: 1 / -1; border-bottom: none; border-left: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .cta-band { padding: 72px 56px; }
}

/* ---------- ≥ 900px ---------- */
@media (min-width: 900px) {
  :root { --gutter: 48px; --header-h: 76px; }
  .nav-toggle { display: none; }
  .main-nav {
    position: static; display: flex; flex-direction: row; gap: 34px; margin-left: auto;
    background: none; border: none; padding: 0;
  }
  .main-nav a { font-size: 14px; padding: 6px 0; border: none; position: relative; letter-spacing: .02em; }
  .main-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--copper);
    transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
  }
  .main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
  .header-phone { display: inline-block; margin-left: 12px; }

  .section-head { grid-template-columns: auto auto 1fr; align-items: baseline; gap: 28px; }
  .section-head .rule { align-self: center; }

  .split { grid-template-columns: 7fr 5fr; gap: 80px; }
  .split.flip { grid-template-columns: 5fr 7fr; }
  .split.contact { grid-template-columns: 7fr 5fr; align-items: start; }

  .facts-strip .inner { grid-template-columns: repeat(5, 1fr); }
  .facts-strip span, .facts-strip span:nth-child(odd), .facts-strip span:last-child {
    grid-column: auto; border: none; border-left: 1px solid var(--line);
    padding: 26px 24px;
  }
  .facts-strip span:first-child { border-left: none; }

  .svc-row { grid-template-columns: 80px 1fr 40px; padding: 34px 0; }
  .svc-row:hover { padding-left: 14px; }

  .gallery { grid-template-columns: repeat(12, 1fr); gap: 32px; }
  .g-item { grid-column: span 6; }
  .g-item:nth-child(4n+1), .g-item:nth-child(4n+4) { grid-column: span 7; }
  .g-item:nth-child(4n+2), .g-item:nth-child(4n+3) { grid-column: span 5; }
  .g-item img { aspect-ratio: auto; height: 100%; min-height: 0; }
  .g-item { display: flex; flex-direction: column; }
  .g-item .imgbox { aspect-ratio: 16 / 10; }
  .g-item .imgbox img { height: 100%; }

  .mat-grid { grid-template-columns: repeat(4, 1fr); }
  .svc-grid { grid-template-columns: repeat(12, 1fr); gap: 32px; }
  .svc-card.span7 { grid-column: span 7; }
  .svc-card.span5 { grid-column: span 5; }
  .footer-inner { grid-template-columns: 1.6fr 1.1fr 1.1fr 1fr; gap: 56px; }
  .cta-band { padding: 96px 80px; margin-top: 110px; }
}

@media (min-width: 1200px) {
  .block { padding: 120px 0; }
  .block.tight { padding: 72px 0; }
}
