/* ==================================================================
   02 — LOFT CONVERSIONS & EXTENSIONS
   Not a homepage template with a hero-then-sections rhythm. Three
   full-viewport "sheets" in a drawing set, each composed completely
   differently from the others: a poster-style cover (type over a
   line drawing), a full-bleed line-draw-to-photo case study, and an
   oversized-type enquiry screen. Near-monochrome + one blueprint-blue
   accent, geometric sans + mono. Motion is clip-path wipes, an SVG
   line-draw signature moment, and a dimension callout — not opacity
   cross-fades. Design surface is 390px; desktop rules live in
   min-width queries.
================================================================== */

:root {
  /* Colour — near-monochrome + blueprint blue */
  --color-bg: #fafaf8;
  --color-panel: #f2f1ee;
  --color-ink: #141414;
  --color-ink-muted: #5c5c58;
  --color-accent: #1e56c9;
  --color-accent-soft: #e4ecfa;
  --color-border: #d8d6d0;
  --color-success: #1c6b3e;
  --color-error: #a13f2c;

  /* RGB triplets of the colours above, for any rgba() overlay/shadow/
     glow that needs a translucent version of a themed colour. Keep
     each one in sync with its hex value above. */
  --color-bg-rgb: 250, 250, 248;
  --color-ink-rgb: 20, 20, 20;
  --color-accent-rgb: 30, 86, 201;

  /* Type — geometric sans for headings/body, monospace for labels,
     annotations and metadata. No serif anywhere. */
  --font-heading: Futura, "Century Gothic", Avenir, "Avenir Next", sans-serif;
  --font-body: Futura, "Century Gothic", Avenir, "Avenir Next", sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radius — sharp by default, consistent with the drawing-sheet aesthetic */
  --radius-base: 0px;

  /* Motion */
  --transition-fast: 200ms;
  --transition-base: 350ms;
  --transition-slow: 600ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --content-max: 1200px;
  --callbar-height: 72px;

  /* Breakpoints — CSS custom properties cannot be referenced inside
     @media conditions, so these can't be wired into the media queries
     below directly. Listed here as the canonical values for reference:
     640px, 860px. */
}

/* ------------------------------------------------------------------
   ALTERNATE PALETTE — dark-mode inversion.
   To retheme: comment out the colour block in :root above and
   uncomment this one. Type, spacing, motion and grid stay untouched,
   so the retheme stays coherent.
------------------------------------------------------------------
:root {
  --color-bg: #121212;
  --color-panel: #1b1b1b;
  --color-ink: #f2f1ee;
  --color-ink-muted: #a8a6a0;
  --color-accent: #6fa8ff;
  --color-accent-soft: #1c2c47;
  --color-border: #2e2e2b;
  --color-success: #3fae72;
  --color-error: #e2664c;

  --color-bg-rgb: 18, 18, 18;
  --color-ink-rgb: 242, 241, 238;
  --color-accent-rgb: 111, 168, 255;
}
------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(var(--callbar-height) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
p,
figure {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
  width: 100%;
}

@media (min-width: 640px) {
  .inner {
    padding-inline: var(--space-7);
  }
}

/* ------------------------------------------------------------------
   Accessibility helpers
------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-3);
  z-index: 100;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  transition: top var(--transition-fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-3);
}

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

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

/* ------------------------------------------------------------------
   Clip-path wipe motion.

   No-JS / no-JS-yet safety: content is visible by default. The
   hidden "about to wipe in" state only applies once html.js is
   present, added synchronously by an inline script in <head> before
   first paint. Without JavaScript, that class never exists, so the
   cover, the case study and the enquiry screen are all fully visible
   from the first render.
------------------------------------------------------------------- */
html.js .wipe {
  clip-path: inset(0 0 0 100%);
}

.wipe {
  transition: clip-path var(--transition-slow) var(--ease-out);
}

html.js .wipe.is-visible {
  clip-path: inset(0 0 0 0%);
}

@media (prefers-reduced-motion: reduce) {
  html.js .wipe {
    clip-path: inset(0 0 0 0%);
    transition: none;
  }
}

/* ------------------------------------------------------------------
   Corner mark — the entire "header". No full-width bar; a small
   label sitting inside the cover screen itself.
------------------------------------------------------------------- */
.site-header {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 5;
}

@media (min-width: 640px) {
  .site-header {
    top: var(--space-6);
    left: var(--space-7);
  }
}

.logo {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Screens — full-viewport sheets. Each one below is composed
   differently; this class only supplies the shared full-height
   scaffold, not a repeated content template.
------------------------------------------------------------------- */
.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------
   Cover — poster: type over a full-bleed line drawing
------------------------------------------------------------------- */
.cover {
  justify-content: flex-end;
  padding-block: var(--space-9) var(--space-8);
  overflow: hidden;
}

.cover-drawing {
  position: absolute;
  inset: 0;
  color: var(--color-ink-muted);
  opacity: 0.55;
}

.cover-drawing svg {
  width: 100%;
  height: 100%;
}

/* The building itself draws in on load, stroke by stroke, before the
   dimension callout starts — same stroke-dashoffset technique as the
   case-study signature moment. JS sets the dasharray/dashoffset
   inline; without JS no inline style is ever applied, so the drawing
   simply renders fully formed by default (no-JS safe). */
.building-line {
  transition: stroke-dashoffset var(--transition-slow) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .building-line {
    transition: none;
  }
}

.cover-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--color-bg) 0%,
    var(--color-bg) 28%,
    rgba(var(--color-bg-rgb), 0) 62%
  );
}

.cover-meta {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 640px) {
  .cover-meta {
    top: var(--space-6);
    right: var(--space-7);
  }
}

.cover-content {
  position: relative;
  z-index: 2;
}

.cover-heading {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.6rem, 13vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.cover-line {
  margin-top: var(--space-5);
  font-size: 1.05rem;
  color: var(--color-ink-muted);
  max-width: 38ch;
}

.cover-actions {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid var(--color-ink);
  position: relative;
  transition: background var(--transition-fast) var(--ease-out),
    color var(--transition-fast) var(--ease-out),
    border-color var(--transition-fast) var(--ease-out);
  min-height: 48px;
}

.tab-primary {
  background: var(--color-ink);
  color: var(--color-bg);
}

.tab-primary:hover,
.tab-primary:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.tab-secondary {
  background: var(--color-bg);
  color: var(--color-ink);
}

.tab-secondary:hover,
.tab-secondary:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .tab {
    transition: none;
  }
}

/* Dimension callout — a leader line draws in, then its label fades
   in at the end of the line. A distinct micro-motion. */
.callout-line {
  stroke: var(--color-accent);
  stroke-width: 1.5;
  fill: none;
  transition: stroke-dashoffset var(--transition-slow) var(--ease-out);
}

html.js .callout-line {
  stroke-dashoffset: 100;
}

html.js .callout-line.is-visible {
  stroke-dashoffset: 0;
}

.callout-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-accent);
  background: rgba(var(--color-bg-rgb), 0.9);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-accent);
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-out);
  transition-delay: 400ms;
}

html.js .callout-label {
  opacity: 0;
}

html.js .callout-label.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html.js .callout-line {
    stroke-dashoffset: 0;
    transition: none;
  }

  html.js .callout-label {
    opacity: 1;
    transition: none;
    transition-delay: 0ms;
  }
}

@media (min-width: 860px) {
  .cover-heading {
    max-width: 14ch;
  }
}

/* ------------------------------------------------------------------
   Case Study — the signature line-draw-to-photo moment, full-bleed,
   no heading, no lede, no card. The drawing IS the screen.
------------------------------------------------------------------- */
.case-study {
  padding: 0;
  background: var(--color-panel);
}

.linedraw {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.linedraw svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: var(--space-8) var(--space-5);
  color: var(--color-accent);
}

@media (min-width: 640px) {
  .linedraw svg {
    padding: var(--space-9) var(--space-8);
  }
}

.linedraw svg path,
.linedraw svg line {
  transition: stroke-dashoffset var(--transition-slow) var(--ease-out);
}

.linedraw__photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-out);
  background-color: var(--color-panel);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(var(--color-ink-rgb), 0.045) 0px,
    rgba(var(--color-ink-rgb), 0.045) 1px,
    transparent 1px,
    transparent 14px
  );
}

.linedraw__photo.is-visible {
  opacity: 1;
}

.photo-label {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-ink-muted);
  background: rgba(var(--color-bg-rgb), 0.9);
  padding: var(--space-1) var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .linedraw svg path,
  .linedraw svg line,
  .linedraw__photo {
    transition: none;
  }
}

.case-caption {
  position: relative;
  z-index: 2;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-ink-muted);
  background: var(--color-panel);
  border-top: 1px solid var(--color-border);
}

@media (min-width: 640px) {
  .case-caption {
    padding-inline: var(--space-7);
  }
}

/* ------------------------------------------------------------------
   About — a statement paired with a compact facts list. Composed
   differently again from the cover (type over image), the case study
   (full-bleed image, almost no text) and the enquiry screen (oversized
   type as the CTA): here it's a mid-scale statement next to a plain
   label/value list, the only screen with a two-zone split.
------------------------------------------------------------------- */
.about {
  /* Unlike the cover, case study and enquiry screens, this one isn't
     poster-scale content — forcing it to fill the viewport like the
     others just leaves dead space around a statement and a short
     list. Size it to its content instead, with generous but bounded
     padding as the "pause" between the two full-bleed screens either
     side of it. */
  min-height: 0;
  padding-block: var(--space-9);
}

.about-grid {
  display: grid;
  gap: var(--space-7);
}

.about-statement {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1.28;
  max-width: 22ch;
}

.about-specs {
  border-top: 1px solid var(--color-border);
}

.about-spec-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.about-spec-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
}

.about-spec-row dd {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

.token {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--color-ink-muted);
}

@media (min-width: 700px) {
  .about-spec-row {
    grid-template-columns: 1fr 2fr;
    align-items: baseline;
    gap: var(--space-5);
  }
}

@media (min-width: 860px) {
  .about-grid {
    grid-template-columns: 6fr 6fr;
    align-items: center;
  }
}

/* ------------------------------------------------------------------
   Enquiry — oversized type: the phone number is the CTA. Form is
   secondary and compact.
------------------------------------------------------------------- */
.enquiry {
  justify-content: center;
  padding-block: var(--space-8);
}

.enquiry-heading {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3.6rem);
  line-height: 1.02;
  max-width: 14ch;
}

.enquiry-phone {
  display: block;
  margin-top: var(--space-6);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2.2rem, 10vw, 4.4rem);
  line-height: 1;
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.enquiry-phone:hover,
.enquiry-phone:focus-visible {
  color: var(--color-ink);
}

.enquiry-email {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-ink-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}

.enquiry-email:hover,
.enquiry-email:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.enquiry-divider {
  margin-block: var(--space-8);
  border: none;
  border-top: 1px solid var(--color-border);
}

.enquiry-quote {
  border-left: 2px solid var(--color-accent);
  padding-left: var(--space-4);
  max-width: 44ch;
}

.enquiry-quote blockquote {
  margin: 0;
  font-size: 1rem;
  color: var(--color-ink-muted);
}

.enquiry-quote cite {
  display: block;
  margin-top: var(--space-2);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-ink-muted);
}

.enquiry-form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
  margin-bottom: var(--space-4);
}

.intake-form {
  display: grid;
  gap: var(--space-4);
  max-width: 480px;
}

.field {
  display: grid;
  gap: var(--space-2);
}

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

.field input,
.field textarea {
  font: inherit;
  font-size: 0.95rem;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-ink);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 1px;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.form-expectation {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-ink-muted);
}

.form-status {
  font-size: 0.88rem;
  min-height: 1.2em;
}

.form-status[data-state="success"] {
  color: var(--color-success);
}

.form-status[data-state="error"] {
  color: var(--color-error);
}

/* ------------------------------------------------------------------
   Footer — minimal, a single hairline, not a repeated section shape
------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-5);
}

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-ink-muted);
}

/* ------------------------------------------------------------------
   Sticky click-to-call bar
------------------------------------------------------------------- */
.call-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  background: var(--color-ink);
  border-top: 2px solid var(--color-accent);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.call-bar__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--callbar-height);
  color: var(--color-bg);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.98rem;
}

.call-bar__link .icon {
  color: var(--color-accent);
}

@media (min-width: 860px) {
  .call-bar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}
