/* Turning Works — redesign
   Industrial, spec-sheet aesthetic: graphite + warm paper, brand red from the logo star,
   mono "drawing annotation" labels. */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@100..125,500..900&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --red: #c8102e;
  --red-dark: #9e0c24;
  --ink: #15171b;
  --graphite: #1e2127;
  --steel: #2b2f37;
  --muted: #5d636e;
  --paper: #f3f2ee;
  --paper-2: #e9e7e1;
  --white: #ffffff;
  --line: rgba(21, 23, 27, .12);
  --line-dark: rgba(255, 255, 255, .12);
  --display: "Archivo", "Arial Narrow", sans-serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-stretch: 112%; line-height: 1.05; letter-spacing: -.015em; margin: 0; font-weight: 800; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Annotation labels ---------- */
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 12px; }
.label::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.label .n { color: var(--red); }
.on-dark .label { color: rgba(255,255,255,.62); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-stretch: 110%; font-weight: 700; font-size: 15px; letter-spacing: .02em; text-decoration: none; padding: 15px 22px; border-radius: var(--radius); transition: background .2s, color .2s, border-color .2s, transform .2s; border: 1.5px solid transparent; cursor: pointer; }
.btn svg { width: 16px; height: 16px; transition: transform .2s; }
.btn:hover svg { transform: translateX(4px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: rgba(255,255,255,.75); font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; }
.topbar .wrap { display: flex; justify-content: flex-end; gap: 28px; padding-top: 9px; padding-bottom: 9px; }
.topbar a { text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.topbar a:hover { color: #fff; }
.topbar svg { width: 13px; height: 13px; color: var(--red); }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 84px; }
.brand img { height: 50px; width: auto; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { font-family: var(--display); font-stretch: 108%; font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 14px; position: relative; color: var(--ink); }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav a:not(.btn):hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .btn { margin-left: 14px; padding: 12px 18px; color: #fff; }
.menu-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .25s, opacity .25s; }

@media (max-width: 860px) {
  .topbar { display: none; }
  .site-header .wrap { height: 70px; }
  .brand img { height: 40px; }
  .menu-toggle { display: block; }
  .nav { position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 22px; gap: 0; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .nav a:not(.btn)::after { display: none; }
  .nav .btn { margin: 16px 0 0; justify-content: center; border-bottom: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Home hero ---------- */
.hero { position: relative; background: var(--graphite); color: #fff; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: url("/images/turning-works-parts.webp") center/cover no-repeat; filter: grayscale(1) contrast(1.1); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(21,23,27,.97) 0%, rgba(21,23,27,.9) 42%, rgba(21,23,27,.45) 100%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line-dark) 1px, transparent 1px), linear-gradient(90deg, var(--line-dark) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(90deg, #000 0%, transparent 70%); opacity: .5; }
.hero .wrap { padding-top: clamp(44px, 5vw, 64px); padding-bottom: clamp(52px, 5.5vw, 72px); }
.hero h1 { font-size: clamp(38px, 4.8vw, 66px); max-width: 18ch; margin: 16px 0 20px; }
.hero h1 em { font-style: normal; color: var(--red); display: block; }
.hero-lead { font-size: 16.5px; line-height: 1.6; color: rgba(255,255,255,.78); max-width: 720px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { position: absolute; right: var(--gutter); bottom: 22px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; color: rgba(255,255,255,.55); text-transform: uppercase; display: flex; gap: 22px; }
.hero-meta span::before { content: "+ "; color: var(--red); }
@media (max-width: 860px) { .hero-meta { display: none; } }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; background: var(--graphite); color: #fff; overflow: hidden; isolation: isolate; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line-dark) 1px, transparent 1px), linear-gradient(90deg, var(--line-dark) 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); opacity: .6; }
.page-hero .wrap { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.crumbs { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; color: rgba(255,255,255,.55); margin-bottom: 26px; }
.crumbs a { text-decoration: none; color: rgba(255,255,255,.8); }
.crumbs a:hover { color: #fff; }
.crumbs span { margin: 0 8px; color: var(--red); }
.page-hero h1 { font-size: clamp(40px, 6vw, 76px); margin-bottom: 24px; }
.page-hero .lead { color: rgba(255,255,255,.75); max-width: 700px; font-size: 18px; }
.page-hero .grid-2 { align-items: center; }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section.tight { padding: clamp(48px, 6vw, 72px) 0; }
.bg-white { background: var(--white); }
.bg-dark { background: var(--graphite); color: #fff; }
.section-head { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px 64px; align-items: start; margin-bottom: clamp(48px, 6vw, 80px); }
.section-head h2 { font-size: clamp(30px, 3.8vw, 52px); }
.section-head p { color: var(--muted); max-width: 560px; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Intro split (home) */
.intro { display: grid; grid-template-columns: 300px 1fr; gap: 64px; }
.intro aside { position: sticky; top: 120px; align-self: start; }
.intro aside h2 { font-size: clamp(28px, 3vw, 38px); margin-top: 18px; }
.intro .cols { columns: 2; column-gap: 48px; color: #3a3f48; }
.intro .cols p { break-inside: avoid; }
.intro .cols p:first-child { font-size: 19px; color: var(--ink); }
@media (max-width: 960px) { .intro { grid-template-columns: 1fr; gap: 28px; } .intro aside { position: static; } }
@media (max-width: 680px) { .intro .cols { columns: 1; } }

/* Software strip */
.software { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.software .wrap { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 32px; padding-top: 36px; padding-bottom: 36px; }
.logos { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; gap: 0; }
.logos li { list-style: none; display: flex; justify-content: center; align-items: center; padding: 10px 22px; height: 76px; border-left: 1px solid var(--line); }
.logos img { max-height: 44px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .72; mix-blend-mode: multiply; transition: filter .25s, opacity .25s; }
.logos li:hover img { filter: none; opacity: 1; }
.logos ul, ul.logos { margin: 0; padding: 0; }
@media (max-width: 960px) { .software .wrap { grid-template-columns: 1fr; } .logos { grid-template-columns: repeat(3, 1fr); } .logos li:nth-child(4) { border-left: 0; } }
@media (max-width: 560px) { .logos { grid-template-columns: repeat(2, 1fr); } .logos li { border-left: 0; } }

/* Feature rows */
.features { display: grid; gap: clamp(64px, 8vw, 112px); }
.feature { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(36px, 6vw, 96px); align-items: center; }
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media { position: relative; }
.feature-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.feature-media .tag { position: absolute; left: -1px; bottom: -1px; background: var(--red); color: #fff; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; padding: 10px 14px; }
.feature-media::before { content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 1px solid var(--line); border-radius: var(--radius); z-index: -1; }
.feature:nth-child(even) .feature-media::before { inset: -14px -14px 14px 14px; }
.feature h3 { font-size: clamp(26px, 2.8vw, 38px); margin: 18px 0 24px; max-width: 18ch; }
.feature .body { color: #3a3f48; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature:nth-child(even) .feature-media { order: 0; } .feature-media { max-width: 460px; } }

/* Capabilities band */
.caps { background: var(--red); color: #fff; overflow: hidden; }
.caps-track { display: flex; gap: 0; width: max-content; animation: marquee 32s linear infinite; }
.caps-track span { font-family: var(--display); font-stretch: 120%; font-weight: 800; font-size: clamp(22px, 2.6vw, 34px); padding: 22px 34px; white-space: nowrap; display: inline-flex; align-items: center; gap: 34px; }
.caps-track span::after { content: ""; width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.7); transform: rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .caps-track { animation: none; } }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.cta-band .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; padding-top: clamp(64px, 8vw, 104px); padding-bottom: clamp(64px, 8vw, 104px); }
.cta-band h2 { font-size: clamp(32px, 4.2vw, 58px); margin-top: 18px; }
.cta-band p { color: rgba(255,255,255,.7); margin-top: 20px; max-width: 560px; }
.cta-contacts { display: grid; gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.cta-contacts a { background: var(--ink); padding: 24px 26px; text-decoration: none; display: grid; gap: 4px; transition: background .2s; }
.cta-contacts a:hover { background: var(--steel); }
.cta-contacts small { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.cta-contacts strong { font-family: var(--display); font-stretch: 110%; font-size: clamp(20px, 2vw, 26px); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.cta-contacts strong svg { width: 20px; height: 20px; color: var(--red); }
@media (max-width: 860px) { .cta-band .wrap { grid-template-columns: 1fr; } }

/* About: expertise cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--white); padding: clamp(28px, 3.5vw, 48px); position: relative; transition: background .25s; }
.card:hover { background: #fbfaf8; }
.card .num { font-family: var(--mono); font-size: 13px; color: var(--red); letter-spacing: .1em; }
.card h3 { font-size: clamp(22px, 2.2vw, 30px); margin: 18px 0 16px; }
.card p { color: #4a505a; }
.card::after { content: ""; position: absolute; top: 0; left: 0; width: 0; height: 3px; background: var(--red); transition: width .35s; }
.card:hover::after { width: 100%; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

.panel { padding: clamp(32px, 4vw, 56px); border: 1px solid var(--line-dark); }
.panel h2 { font-size: clamp(28px, 3vw, 40px); margin: 18px 0 22px; }
.panel p { color: rgba(255,255,255,.72); }

.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: why; }
.why > div { border-top: 2px solid var(--ink); padding-top: 22px; }
.why h3 { font-size: 21px; margin-bottom: 12px; }
.why h3::before { counter-increment: why; content: "0" counter(why); display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--red); letter-spacing: .1em; margin-bottom: 14px; }
.why p { color: #4a505a; font-size: 16px; }
@media (max-width: 960px) { .why { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .why { grid-template-columns: 1fr; } }

.closing { margin-top: clamp(56px, 7vw, 88px); display: flex; justify-content: space-between; align-items: center; gap: 32px; padding: 36px 40px; background: var(--white); border-left: 4px solid var(--red); }
.closing p { font-size: 19px; max-width: 760px; margin: 0; }
.closing .btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 860px) { .closing { flex-direction: column; align-items: flex-start; } }

.about-figure { background: #fff; border-radius: var(--radius); padding: 28px; position: relative; }
.about-figure img { width: 100%; height: auto; }
.about-figure figcaption { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 16px; display: flex; justify-content: space-between; }

/* Services */
.svc-index { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); margin-top: 48px; }
.svc-index a { background: var(--graphite); padding: 20px 22px; text-decoration: none; display: grid; gap: 6px; transition: background .2s; }
.svc-index a:hover { background: var(--steel); }
.svc-index small { font-family: var(--mono); font-size: 11.5px; color: var(--red); letter-spacing: .12em; }
.svc-index strong { font-family: var(--display); font-stretch: 110%; font-size: 17px; font-weight: 700; }
@media (max-width: 860px) { .svc-index { grid-template-columns: 1fr 1fr; } }

.service { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; padding: clamp(64px, 8vw, 112px) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.service:last-child { border-bottom: 0; }
.service:nth-child(even) .service-media { order: -1; }
.service h2 { font-size: clamp(30px, 3.6vw, 50px); margin: 18px 0 26px; }
.service .body { color: #3a3f48; }
.service .btn { margin-top: 30px; }
.service-media { position: relative; }
.service-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); background: var(--paper-2); }
.service-media .corner { position: absolute; width: 28px; height: 28px; border-color: var(--red); border-style: solid; }
.service-media .c1 { top: -10px; left: -10px; border-width: 2px 0 0 2px; }
.service-media .c2 { bottom: -10px; right: -10px; border-width: 0 2px 2px 0; }
@media (max-width: 860px) { .service { grid-template-columns: 1fr; } .service:nth-child(even) .service-media { order: 0; } }

.spec { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); }
.spec div { padding: 18px 20px; }
.spec div + div { border-left: 1px solid var(--ink); }
.spec small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.spec strong { font-family: var(--display); font-stretch: 115%; font-size: clamp(28px, 3vw, 40px); font-weight: 800; }
.spec strong span { font-size: .5em; color: var(--red); margin-left: 4px; }
.spec-note { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.contact-item { background: var(--white); padding: 26px 28px; display: grid; grid-template-columns: 44px 1fr; gap: 18px; }
.contact-item .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; color: var(--red); }
.contact-item .ico svg { width: 20px; height: 20px; }
.contact-item small { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.contact-item a { text-decoration: none; font-family: var(--display); font-stretch: 108%; font-weight: 700; font-size: 20px; }
.contact-item a:hover { color: var(--red); }
.contact-item address { font-style: normal; line-height: 1.55; }
.form-card { background: var(--graphite); color: #fff; padding: clamp(28px, 4vw, 52px); border-radius: var(--radius); position: relative; }
.form-card::before { content: ""; position: absolute; top: 0; left: clamp(28px, 4vw, 52px); width: 64px; height: 3px; background: var(--red); }
.form-card h2 { font-size: clamp(26px, 2.6vw, 36px); margin: 16px 0 28px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.field input, .field textarea { width: 100%; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.18); color: #fff; font: inherit; font-size: 16px; padding: 14px 16px; border-radius: var(--radius); transition: border-color .2s, background .2s; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); background: rgba(255,255,255,.08); }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.35); }
.upload { border: 1.5px dashed rgba(255,255,255,.25); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; display: block; }
.upload:hover { border-color: var(--red); background: rgba(255,255,255,.03); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.field .upload { margin: 0; }
.upload strong { font-family: var(--display); font-weight: 700; display: block; font-size: 16px; letter-spacing: 0; text-transform: none; color: #fff; }
.upload span { font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.55); }
.form .btn { justify-content: center; width: 100%; font-size: 16px; padding: 17px; border: 0; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-top: 64px; padding-bottom: 48px; }
.site-footer .brand img { height: 56px; mix-blend-mode: multiply; }
.site-footer h4 { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--red); }
.site-footer .tagline { color: var(--muted); margin-top: 18px; max-width: 340px; font-size: 15px; }
.footer-base { border-top: 1px solid var(--line); }
.footer-base .wrap { display: flex; justify-content: space-between; padding-top: 22px; padding-bottom: 22px; font-family: var(--mono); font-size: 12px; color: var(--muted); grid-template-columns: none; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
