@import url("fonts.css");

/* ============================================================
   Plumbing only. Nothing here is a design decision — no colour,
   no typeface, no layout. Each site writes its own visual system
   on top; this file only carries the things that must be right
   on every site and are invisible when they are.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* A sideways-scrollable page drags position:fixed elements out of view on
     phones. Clip rather than scroll. (clip, not hidden: hidden would make html
     a scroll container and break scroll-padding and sticky.) */
  overflow-x: clip;
}

body { margin: 0; }
/* Lock scrolling on the ROOT, not on body. html already has overflow-x:clip,
   so overflow:hidden on body turns body into its own scroll container — a
   position:sticky header then sticks to body and is thrown off-screen (with
   its close button) when the menu opens after scrolling. site.js puts
   .is-locked on <html> directly; a :has() selector was tried first and its
   style invalidation visibly lagged behind the menu opening. */
html.is-locked { overflow: hidden; }
/* [hidden] must win. A rule like `.gallery-more { display:flex }` outranks the
   browser's own `[hidden] { display:none }`, which left an empty "Show 0 more"
   button on screen whenever a gallery had nothing further to reveal. */
[hidden] { display: none !important; }

img, svg, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
/* A <button> inherits the user agent's grey `buttonface` unless something says
   otherwise. An outline/ghost button that sets only border-color and color then
   renders as light-grey with (often white) text on it — invisible. Reset here;
   any variant that wants a fill sets one and wins on specificity. */
button { background: transparent; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Reveal-on-scroll. The JS failsafe shows everything if the observer
   never runs, so content can never be stranded invisible. */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease, ease), transform .7s var(--ease, ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

@media print {
  .site-header, .lightbox, .skip-link, .gallery-more, .filters, .map-consent, .callbar { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff !important; color: #000 !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; color: #555; }
}

/* =====================================================================
   Jimmy Jib Greece — "spec sheet"
   Graphite and a faint blueprint grid for the white crane drawings, amber
   measure marks, the elephant logo. Archivo / Archivo Narrow, IBM Plex Mono
   for every figure. Colours checked for WCAG AA (ratios in comments).
   ===================================================================== */
:root {
  --bg: #0e1012;
  --bg-2: #13161a;
  --panel: #171b20;
  --line: #2a3037;
  --grid: rgba(255, 255, 255, .04);
  --text: #ece9e2;          /* 15.6:1 on --bg */
  --muted: #aaa69d;         /* 7.9:1 on --bg, 7.0:1 on --panel */
  --amber: #f5b82e;         /* 10.9:1 on --bg; #111 on it 10.6:1 */
  --amber-2: #ffcb55;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --narrow: "Archivo Narrow", "Archivo", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { font: 400 1.0625rem/1.65 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.wrap { width: min(1220px, 100% - 2 * clamp(20px, 4vw, 48px)); margin-inline: auto; }
h1, h2, h3 { font-family: var(--narrow); font-weight: 700; line-height: 1.05; letter-spacing: -.005em; color: var(--text); text-wrap: balance; }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
a { color: var(--amber); text-underline-offset: .2em; }
.ico { width: 1.15rem; height: 1.15rem; flex: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: .7rem 1.1rem; background: var(--amber); color: #111; font-weight: 600; border-radius: 4px; }
.skip-link:focus { top: 12px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.svg-defs path { fill: var(--amber); }

.eyebrow { display: flex; align-items: center; gap: .7rem; margin: 0 0 1rem; font: 500 .8rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.eyebrow::before { content: ""; width: 28px; height: 9px; border: solid var(--amber); border-width: 0 1.5px; background: linear-gradient(var(--amber), var(--amber)) center / 100% 1.5px no-repeat; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 40rem; }
.note { margin-top: 1.25rem; font-size: .98rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: .75rem 1.25rem; border: 1.5px solid transparent; border-radius: 4px; font: 600 1rem/1.15 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.btn-amber { background: var(--amber); color: #111; }
.btn-amber:hover { background: var(--amber-2); color: #111; }
.btn-line { border-color: rgba(236, 233, 226, .38); color: var(--text); }
.btn-line:hover { border-color: var(--amber); color: var(--amber); }
.btn-meta { font: 500 .78rem/1 var(--mono); color: var(--muted); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); height: var(--header-h); }
.brand { margin-right: auto; display: block; padding: .3rem 0; }
.brand img { width: auto; height: 38px; }
.nav { display: flex; gap: .2rem; }
.nav a { padding: .55rem .8rem; color: var(--text); text-decoration: none; font-weight: 500; border-radius: 4px; }
.nav a:hover { color: var(--amber); }
.nav a[aria-current] { color: var(--amber); box-shadow: inset 0 -2px 0 var(--amber); border-radius: 0; }
.header-contact { display: flex; gap: .3rem; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); border: 1px solid var(--line); border-radius: 50%; }
.icon-btn:hover { color: #111; background: var(--amber); border-color: var(--amber); }
.nav-toggle { display: none; position: relative; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { position: absolute; left: 50%; width: 18px; height: 2px; margin-left: -9px; background: var(--text); transition: transform .3s var(--ease), background-color .2s; }
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; left: 0; margin: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.is-open .nav-toggle span { background: transparent; }
.is-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.is-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero, .size-drawing { background-color: var(--bg); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 40px 40px; }
.hero { padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.8rem, 6.4vw, 5.2rem); line-height: .98; }
.hero .lead { margin-top: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.hero-drawing { margin: 0; }
.hero-drawing img { width: 100%; }
.hero-drawing figcaption { display: flex; align-items: center; gap: .8rem; margin-top: 1rem; font: 500 .85rem/1.3 var(--mono); color: var(--muted); }
.hero-drawing figcaption span { padding: .2rem .5rem; border: 1px solid var(--amber); color: var(--amber); }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head .lead { margin-top: .9rem; }

/* ---------- Crane sizes ---------- */
.size-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.sizes:not(.is-tabbed) .size-tabs { display: none; }
.size-tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; min-width: 6.25rem; padding: .9rem 1rem .8rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); cursor: pointer; text-align: left; }
.size-tab:hover { color: var(--text); }
.size-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--amber); }
.size-name { font: 600 1.15rem/1.1 var(--narrow); }
.size-reach { font: 500 .8rem/1.2 var(--mono); }
.size-tab[aria-selected="true"] .size-reach { color: var(--amber); }
.size-panels { margin-top: clamp(1.5rem, 3vw, 2.25rem); }
.sizes:not(.is-tabbed) .size-panel + .size-panel { margin-top: 3rem; }
.size-panel { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "draw radius" "specs radius"; gap: 1.25rem 1.5rem; }
.size-panel:focus-visible { outline-offset: 8px; }
.size-panel:target:focus-visible { outline: none; }   /* opened from a #size-… link, not by keyboard */
.size-drawing { grid-area: draw; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); }
.size-drawing h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; font-size: clamp(2rem, 3.6vw, 2.8rem); }
.size-drawing h3 span { font: 500 .85rem/1.2 var(--mono); color: var(--amber); letter-spacing: .04em; }
.size-drawing img { width: 100%; margin-top: 1rem; }
.size-radius { grid-area: radius; }
.radius { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); }
.r-label { font: 500 11px var(--mono); fill: var(--muted); letter-spacing: .04em; }
.r-weight { font: 700 30px var(--narrow); fill: var(--text); }
.r-arc { fill: none; stroke: var(--text); stroke-width: 1.5; }
.r-ghost { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 4; }
.r-mast { stroke: var(--amber); stroke-width: 3; }
.r-cam, .r-pivot { fill: var(--amber); }
.r-base { fill: var(--muted); }
.r-dim { stroke: var(--amber); stroke-width: 1.4; }
.r-value { font: 600 14px var(--mono); fill: var(--amber); }
.r-min { font: 500 12px var(--mono); fill: var(--text); }
.r-swing { fill: none; stroke: var(--muted); stroke-width: 1.3; }
.specs { grid-area: specs; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1.25rem; margin: 0; }
.specs div { padding: .8rem 0 .9rem; border-top: 1px solid var(--line); }
.specs dt { font: 500 .75rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: .3rem 0 0; font: 500 1.45rem/1.1 var(--mono); color: var(--text); }
.specs .is-key dd { color: var(--amber); }

.compare { margin-top: clamp(3rem, 6vw, 4.5rem); }
.compare h3 { font-size: 1.7rem; margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; min-width: 820px; border-collapse: collapse; }
th, td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
thead th { font: 600 1.05rem/1.2 var(--narrow); color: var(--text); background: var(--panel); }
tbody th { text-align: left; font-weight: 500; color: var(--muted); }
td { font: 500 .95rem/1.2 var(--mono); }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tr.is-key td, tr.is-key th { color: var(--amber); }

/* ---------- Our Work ---------- */
.work { background: var(--bg-2); border-block: 1px solid var(--line); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.work h2 { margin-bottom: 1.2rem; }
.work p { color: var(--muted); max-width: 40rem; }
.work .lead { color: var(--text); }
.work .btn { margin-top: .6rem; }
.stats { list-style: none; }
.stats li { display: grid; gap: .2rem; padding: 1.2rem 0; border-top: 1px solid var(--line); }
.stats li:last-child { border-bottom: 1px solid var(--line); }
.stats strong { font: 700 clamp(3rem, 6.5vw, 4.6rem)/.95 var(--narrow); color: var(--amber); }
.stats span { font: 500 .9rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* ---------- Documents ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.doc-group { border: 1px solid var(--line); background: var(--panel); }
.doc-group h3 { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.25rem; font-size: 1.4rem; border-bottom: 1px solid var(--line); }
.doc-group h3 .ico { color: var(--amber); width: 1.4rem; height: 1.4rem; }
.doc-group ul { list-style: none; }
.doc-group li + li { border-top: 1px solid var(--line); }
.doc-group a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .8rem; padding: .95rem 1.25rem; color: var(--text); text-decoration: none; }
.doc-group a .ico { grid-row: span 2; margin-top: .2rem; color: var(--amber); }
.doc-title { font-weight: 500; line-height: 1.35; }
.doc-meta { font: 500 .78rem/1.2 var(--mono); color: var(--muted); }
.doc-group a:hover { background: rgba(245, 184, 46, .08); }
.doc-group a:hover .doc-title { color: var(--amber); text-decoration: underline; text-underline-offset: .2em; }

/* ---------- Contact ---------- */
.contact-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 2rem clamp(2rem, 5vw, 4rem); align-items: center; padding: clamp(2rem, 5vw, 3.5rem); border: 1px solid var(--line); border-top: 3px solid var(--amber); background: var(--panel); }
.contact-card h2 { margin-bottom: 1rem; }
.contact-actions { display: grid; gap: .8rem; }
.contact-person { display: flex; align-items: center; gap: .6rem; margin: 0 0 .2rem; font: 600 1.3rem/1.2 var(--narrow); }
.contact-person .ico { color: var(--amber); }
.btn-mail { word-break: break-all; }

/* ---------- Footer ---------- */
.site-footer { padding: 2.5rem 0 2rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; }
.footer-logo { width: auto; height: 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--amber); text-decoration: underline; }
.footer-links .ico { width: .95rem; height: .95rem; color: var(--muted); }
.colophon { margin: 0; font: 500 .82rem/1.3 var(--mono); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .work-grid, .contact-card { grid-template-columns: minmax(0, 1fr); }
  .size-panel { grid-template-columns: minmax(0, 1fr) 220px; }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .brand img { height: 30px; }
  .nav-toggle { display: block; }
  .header-contact { margin-left: auto; }
  .brand { margin-right: 0; }
  .nav { position: fixed; inset: var(--header-h) 0 0; flex-direction: column; gap: 0; padding: 1rem clamp(20px, 4vw, 48px) 2rem; background: var(--bg); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; overflow-y: auto; }
  .nav a { padding: 1rem .2rem; font: 700 1.9rem/1.1 var(--narrow); border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a[aria-current] { box-shadow: none; }
  .is-open .nav { opacity: 1; visibility: visible; }
  .size-panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "draw" "specs" "radius"; }
  .size-radius { max-width: 300px; }
}
@media (max-width: 420px) {
  .header-contact .icon-btn:first-child { display: none; }
  .specs dd { font-size: 1.25rem; }
}
