/* ==========================================================================
   Ontological Renderer — design tokens
   Palette: cold, near-black, with a single electric-blue "signal" accent.
   Type: IBM Plex Mono for anything computational/structural,
         IBM Plex Sans for anything read as prose.
   ========================================================================== */

:root {
  --bg: #0a0a0c;
  --surface: #14151a;
  --surface-hover: #1b1c22;
  --grid-line: #26282e;
  --grid-line-strong: #35373f;
  --text: #ecebe6;
  --text-dim: #8b8d93;
  --text-faint: #55575e;
  --accent: #6ea8ff;
  --accent-dim: rgba(110, 168, 255, 0.14);
  --accent-strong: rgba(110, 168, 255, 0.4);

  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;

  --unit: 8px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--unit) * 3);
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--grid-line);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(var(--unit) * 2.5);
  padding-bottom: calc(var(--unit) * 2.5);
}

.mark {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: var(--unit);
}

.mark span.id {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: calc(var(--unit) * 3);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.nav-links a {
  color: var(--text-dim);
}
.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--grid-line);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: calc(var(--unit) * 6);
  align-items: center;
  padding-top: calc(var(--unit) * 9);
  padding-bottom: calc(var(--unit) * 9);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin: 0 0 calc(var(--unit) * 2) 0;
}

.hero h1 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.25;
  margin: 0 0 calc(var(--unit) * 3) 0;
  letter-spacing: -0.01em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p.lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 calc(var(--unit) * 4) 0;
}

.hero-actions {
  display: flex;
  gap: var(--unit);
}

/* Hero: static placeholder for the material panel (no simulation, no canvas) */
.calc-grid-frame {
  border: 1px solid var(--grid-line);
  background: var(--surface);
  padding: calc(var(--unit) * 1.5);
  aspect-ratio: 1 / 1;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--grid-line) 0,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 10px
    );
  border: 1px solid var(--grid-line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.calc-caption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: var(--unit);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding: calc(var(--unit) * 1.25) calc(var(--unit) * 2.25);
  border: 1px solid var(--grid-line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #05070d;
}

.btn-primary:hover {
  background: var(--text);
  border-color: var(--text);
  color: #05070d;
}

.btn-small {
  font-size: 0.72rem;
  padding: calc(var(--unit) * 0.9) calc(var(--unit) * 1.5);
}

/* ---------- Section scaffolding ---------- */

section {
  border-bottom: 1px solid var(--grid-line);
}

.section-head {
  padding-top: calc(var(--unit) * 7);
  padding-bottom: calc(var(--unit) * 3);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--unit);
}

.section-head h2 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.section-head .section-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- Process (numbered — this is a literal, ordered algorithm) ---------- */

.process-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--grid-line);
  margin-bottom: calc(var(--unit) * 7);
}

.process-step {
  background: var(--surface);
  padding: calc(var(--unit) * 3);
}

.process-step .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.8rem;
  display: block;
  margin-bottom: var(--unit);
}

.process-step h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin: 0 0 var(--unit) 0;
  font-weight: 500;
}

.process-step p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Works grid ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--grid-line);
  margin-bottom: calc(var(--unit) * 7);
}

.work-card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease;
}

.work-card:hover {
  background: var(--surface-hover);
}

.work-coord {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: var(--unit) calc(var(--unit) * 1.5) 0;
}

.work-thumb {
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(
      45deg,
      var(--grid-line) 0,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 10px
    );
  border-top: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  margin-top: var(--unit);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.work-info {
  padding: calc(var(--unit) * 1.5) calc(var(--unit) * 1.5) calc(var(--unit) * 2);
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 0.75);
  flex: 1;
}

.work-info h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin: 0;
  font-weight: 500;
}

.work-info .meta {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.work-info .enquire-btn {
  margin-top: var(--unit);
  align-self: flex-start;
}

/* ---------- Contact / Enquire section ---------- */

.contact-wrap {
  padding-bottom: calc(var(--unit) * 8);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--unit) * 6);
}

.contact-copy p {
  color: var(--text-dim);
  max-width: 40ch;
}

form.enquire-form {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 0.75);
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.field input,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--grid-line-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: calc(var(--unit) * 1.25);
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.form-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  min-height: 1.4em;
}
.form-status.ok { color: var(--accent); }
.form-status.err { color: #ff7a6e; }

/* ---------- Newsletter ---------- */

.newsletter-wrap {
  padding-top: calc(var(--unit) * 7);
  padding-bottom: calc(var(--unit) * 7);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--unit) * 6);
  align-items: end;
}

.newsletter-row {
  display: flex;
  gap: var(--unit);
}
.newsletter-row input {
  flex: 1;
  min-width: 0;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 860px) {
  .newsletter-wrap {
    grid-template-columns: 1fr;
    gap: calc(var(--unit) * 3);
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-bottom: none;
}
.site-footer .wrap {
  padding-top: calc(var(--unit) * 3);
  padding-bottom: calc(var(--unit) * 3);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ---------- Modal (enquire from a specific work) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 8, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: calc(var(--unit) * 2);
}
.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--grid-line-strong);
  max-width: 480px;
  width: 100%;
  padding: calc(var(--unit) * 3);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: calc(var(--unit) * 2);
}

.modal-head h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-mono);
  cursor: pointer;
  font-size: 0.9rem;
}
.modal-close:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }
  .process-steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .process-steps,
  .works-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}
