/*
  QIMKAWAN — design tokens
  Layout concept: an offshore engineering drawing. Title-block grids hold credentials,
  spec readouts carry real units, and a crane hook on the right edge gauges the scroll.
*/
:root {
  color-scheme: light;
  /* Color */
  --steel-950: #0F1720;   /* deep marine steel, hero + footer ground */
  --steel-900: #16212C;
  --steel-800: #1F2D3A;
  --steel-600: #3C4D5D;
  --steel-400: #7D8C99;
  --concrete:  #E8EAE7;   /* deck-plate grey, light bands */
  --paper:     #F6F7F5;
  --ink:       #121A22;
  --signal:    #EE6A1F;   /* logo safety orange */
  --signal-deep:#B94C0C;  /* orange that passes on light grounds */
  --line-dark: rgba(255,255,255,.12);
  --line-light: rgba(18,26,34,.14);
  /* Type */
  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-spec: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--paper);
}

/* Side gutter — one wrapper per band */
.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
@media (min-width: 768px) {
  .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}
@media (min-width: 1280px) {
  .wrap { padding-left: max(64px, env(safe-area-inset-left, 0px)); padding-right: max(96px, env(safe-area-inset-right, 0px)); }
}

/* Type scale */
.display, .h1, .h2, .h3 { font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.03em; }
.display { font-size: clamp(2.4rem, 5.8vw, 5.2rem); line-height: 1; font-weight: 800; }
.h1 { font-size: clamp(2.1rem, 4.5vw, 4rem); line-height: 1.04; font-weight: 800; }
.h2 { font-size: clamp(1.7rem, 3.1vw, 2.65rem); line-height: 1.1; font-weight: 700; }
.h3 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.lede { font-size: clamp(1.08rem, 1.4vw, 1.28rem); line-height: 1.6; max-width: 62ch; }
.prose-measure { max-width: 64ch; }
.kicker { font-family: var(--font-body); font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--signal-deep); }
.on-dark .kicker { color: var(--signal); }
.spec { font-family: var(--font-spec); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-light);
}
.nav-link { position: relative; font-weight: 600; font-size: .92rem; color: var(--ink); padding-block: .4rem; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.mega { visibility: hidden; opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.mega-host:hover .mega, .mega-host:focus-within .mega { visibility: visible; opacity: 1; transform: none; }
.mega a:hover .mega-title { color: var(--signal-deep); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .65rem; font-weight: 700; font-size: .95rem; padding: .95rem 1.35rem; border-radius: 2px; transition: background .2s ease, color .2s ease, border-color .2s ease; line-height: 1.1; }
/* keep Tailwind visibility helpers working on .btn (site.css loads after Tailwind) */
.btn.hidden { display: none; }
@media (min-width: 768px) { .btn.md\:inline-flex { display: inline-flex; } }
.btn-signal { background: var(--signal); color: #1A0D04; }
.btn-signal:hover { background: #FF7D33; }
.btn-ghost-dark { border: 1px solid rgba(255,255,255,.35); color: #fff; }
.btn-ghost-dark:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn-ghost-light { border: 1px solid var(--line-light); color: var(--ink); background: transparent; }
.btn-ghost-light:hover { border-color: var(--ink); }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* Engineering title block: credentials grid */
.titleblock { display: grid; border-top: 1px solid var(--line-dark); border-left: 1px solid var(--line-dark); }
.titleblock > * { border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); min-width: 0; }
.titleblock.light { border-color: var(--line-light); }
.titleblock.light > * { border-color: var(--line-light); }

/* Drawing grid backdrop */
.drawing-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 48px 48px;
}
.drawing-grid-light {
  background-image:
    linear-gradient(to right, rgba(18,26,34,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18,26,34,.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Hero annotation callout */
.callout { position: absolute; display: flex; align-items: center; gap: .6rem; color: #fff; font-size: .78rem; font-weight: 600; pointer-events: none; }
.callout .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--signal); background: rgba(15,23,32,.6); box-shadow: 0 0 0 6px rgba(238,106,31,.18); flex: none; }
.callout .leader { height: 1px; width: 56px; background: rgba(255,255,255,.7); flex: none; }
.callout .tag { background: rgba(15,23,32,.78); border: 1px solid rgba(255,255,255,.18); padding: .45rem .65rem; backdrop-filter: blur(6px); white-space: nowrap; }

/* Service index — hover reveals the photo on desktop */
.svc-row { position: relative; display: grid; gap: 1rem; align-items: center; border-top: 1px solid var(--line-light); padding-block: 1.6rem; transition: background .25s ease; }
.svc-row:last-child { border-bottom: 1px solid var(--line-light); }
@media (min-width: 1024px) {
  .svc-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; padding-inline: 1rem; }
  .svc-row:hover { background: var(--concrete); }
  .svc-row .svc-thumb { display: none; }
}
.svc-row .svc-arrow { width: 52px; height: 52px; border: 1px solid var(--line-light); display: grid; place-items: center; transition: background .25s ease, border-color .25s ease, transform .25s ease; }
.svc-row:hover .svc-arrow { background: var(--signal); border-color: var(--signal); transform: rotate(-45deg); }
.svc-preview { position: sticky; top: 7rem; aspect-ratio: 4 / 5; overflow: hidden; background: var(--steel-900); max-width: 100%; }
.svc-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity .45s ease, transform .9s ease; }
.svc-preview img.is-on { opacity: 1; transform: none; }

/* Photo frame with registration ticks */
.frame { position: relative; overflow: hidden; background: var(--steel-900); max-width: 100%; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; z-index: 2; pointer-events: none; }
.frame::before { top: 12px; left: 12px; border-top: 2px solid var(--signal); border-left: 2px solid var(--signal); }
.frame::after { bottom: 12px; right: 12px; border-bottom: 2px solid var(--signal); border-right: 2px solid var(--signal); }
.frame .cap { position: absolute; left: 0; bottom: 0; z-index: 2; background: rgba(15,23,32,.82); color: #E9EDF0; font-size: .75rem; padding: .5rem .8rem; }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.spec-table th, .spec-table td { text-align: left; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line-light); vertical-align: top; }
.spec-table thead th { font-size: .8rem; font-weight: 700; color: var(--steel-600); background: var(--concrete); border-bottom: 2px solid var(--ink); }
.spec-table tbody th { font-weight: 700; }

/* Readout figure for real specs */
.readout { font-family: var(--font-spec); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.on-dark .readout { color: #fff; }

/* Sub navigation (products page) */
.subnav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 73px); z-index: 30; background: var(--steel-950); border-bottom: 1px solid var(--line-dark); }
.subnav a { color: #B9C3CC; font-weight: 600; font-size: .88rem; padding: 1rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover, .subnav a.is-active { color: #fff; border-bottom-color: var(--signal); }

/* Chips (rental builder, inquiry types) */
.chip { position: relative; display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--line-light); padding: .7rem .95rem; font-weight: 600; font-size: .9rem; cursor: pointer; user-select: none; transition: background .2s, border-color .2s, color .2s; background: var(--paper); }
.chip .box { width: 14px; height: 14px; border: 1.5px solid currentColor; display: grid; place-items: center; flex: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:has(input:checked) .box { background: var(--signal); border-color: var(--signal); }
.chip:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }

/* Form */
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: .45rem; color: var(--steel-600); }
.field input, .field select, .field textarea {
  width: 100%; background: var(--paper); border: 1px solid var(--line-light); border-radius: 2px;
  padding: .9rem 1rem; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(238,106,31,.25); }
.field .err { display: none; color: #A3260F; font-size: .8rem; margin-top: .35rem; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #A3260F; }
.field.invalid .err { display: block; }

/* Crane hook scroll gauge — the signature moment */
.hook-gauge { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 74px); right: max(28px, calc(env(safe-area-inset-right, 0px) + 28px)); bottom: 116px; width: 36px; z-index: 40; pointer-events: none; display: none; }  /* stops above the WhatsApp button */
@media (min-width: 1280px) { .hook-gauge { display: block; } }
.hook-gauge .rail { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(to bottom, rgba(125,140,153,.45) 0 6px, transparent 6px 12px); }
.hook-gauge .cable { position: absolute; left: calc(50% - 1px); top: 0; width: 3px; background: linear-gradient(90deg, #2a2f35, #58616b, #2a2f35); height: 0; }
.hook-gauge .block { position: absolute; left: 0; width: 36px; transform: translateY(0); will-change: transform; }
.hook-gauge .readout { position: absolute; right: 44px; top: 18px; font-size: .7rem; color: var(--steel-400); white-space: nowrap; }

/* Hero entrance — one orchestrated load sequence, visible at rest */
@media (prefers-reduced-motion: no-preference) {
  .load-seq > * { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .load-seq > *:nth-child(2) { animation-delay: .08s; }
  .load-seq > *:nth-child(3) { animation-delay: .16s; }
  .load-seq > *:nth-child(4) { animation-delay: .24s; }
  .hero-photo img { animation: settle 1.6s cubic-bezier(.2,.7,.2,1) both; }
  .callout { animation: rise 1s .5s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes rise { from { transform: translateY(14px); opacity: .001; } to { transform: none; opacity: 1; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Mobile menu */
.mobile-menu { position: fixed; inset: 0; z-index: 70; background: var(--steel-950); color: #fff; overflow-y: auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.mobile-menu a.m-link { display: flex; justify-content: space-between; align-items: center; padding-block: 1rem; border-bottom: 1px solid var(--line-dark); font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; padding: .8rem 1.1rem; font-size: .9rem; font-weight: 600; border-left: 3px solid var(--signal); }

/* WhatsApp chat button — bottom right on every page */
.wa-bubble {
  position: fixed; z-index: 45;
  right: max(20px, calc(env(safe-area-inset-right, 0px) + 20px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex; align-items: center; gap: .75rem;
  color: #fff; text-decoration: none;
}
.wa-icon {
  position: relative; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; background: #25D366; color: #fff;
  box-shadow: 0 12px 28px -8px rgba(15, 23, 32, .5), 0 0 0 4px rgba(255, 255, 255, .9);
  transition: transform .25s ease, background .25s ease;
}
.wa-icon::after {   /* soft ring that draws the eye once, then rests */
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25D366; opacity: 0;
}
.wa-label {
  background: var(--ink); color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap;
  padding: .55rem .85rem; border-left: 3px solid #25D366;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 32, .55);
  opacity: 0; transform: translateX(8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.wa-bubble:hover .wa-icon, .wa-bubble:focus-visible .wa-icon { transform: scale(1.06); background: #1EBE5A; }
.wa-bubble:hover .wa-label, .wa-bubble:focus-visible .wa-label { opacity: 1; transform: none; }
.wa-bubble:focus-visible { outline: none; }
.wa-bubble:focus-visible .wa-icon { outline: 3px solid var(--signal); outline-offset: 4px; }
@media (hover: none) { .wa-label { display: none; } }
@media (max-width: 640px) { .wa-icon { width: 54px; height: 54px; } .wa-icon svg { width: 27px; height: 27px; } }
@media (prefers-reduced-motion: no-preference) {
  .wa-icon::after { animation: wa-ring 2.4s ease-out 1.2s 3; }
}
@keyframes wa-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
body:has(.mobile-menu:not([hidden])) .wa-bubble { display: none; }

/* Contact page map */
.map-frame { height: clamp(380px, 52vw, 520px); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: grayscale(.35) contrast(1.05); transition: filter .4s ease; }
.map-frame:hover iframe { filter: none; }
.map-card { position: absolute; left: 16px; bottom: 16px; z-index: 3; max-width: calc(100% - 32px); background: rgba(15, 23, 32, .92); color: #fff; padding: 1.25rem 1.35rem; border-left: 3px solid var(--signal); backdrop-filter: blur(6px); }
@media (min-width: 768px) { .map-card { left: 32px; bottom: 32px; max-width: 340px; } }
@media (max-width: 520px) {
  .map-frame { height: auto; display: flex; flex-direction: column; overflow: visible; background: transparent; }
  .map-frame iframe { position: relative; height: 340px; }
  .map-card { position: relative; left: 0; bottom: 0; max-width: none; }
}
.justify-end { justify-content: flex-end; }
