/* Colors: the palette (--near-black, --white, --grey, --blue, --red) is defined
   ONLY in backend/proofplates/brand.py and written into each page's <head>.
   Never write a color value in this file; use the roles below or the palette names. */

:root {
  --background: var(--white);
  --text: var(--near-black);
  --line: var(--near-black);
  --placeholder: var(--grey);
  --accent: var(--blue);
  --on-accent: var(--white);
  --error: var(--red);
  --line-heavy: 3px;
  --bar-height: 4rem; /* menu bar; logo stays 44 x 46 px inside it */
}

/* Inter, self-hosted (SIL Open Font License, see fonts/Inter-OFL.txt).
   One variable font file covers every weight from 100 to 900. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--background);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.5;
}

/* Light grey helper text: Inter Light */
.hint {
  font-weight: 300;
  color: var(--placeholder);
}

a { color: inherit; }

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

/* Landing page */

.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 1rem 2.5rem;
}

/* One grid holds both forms, so every box shares one width:
   column 1 holds the boxes (20.5rem), column 2 the arrow buttons. */
.landing-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 20.5rem) 3.5rem;
  grid-template-rows: 1fr auto auto 1fr auto;
  column-gap: 0.75rem;
  max-width: 100%;
}

/* Title spans the full grid: its left side lines up with the boxes,
   its right side with the arrow buttons. BETA takes the extra width. */
.landing-grid > .title-frame {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: stretch;
  margin-bottom: 3rem;
}

.landing-grid > .access,
.landing-grid > .signed-in {
  grid-column: 1 / -1;
  grid-row: 3;
}

.landing-grid > .request {
  grid-column: 1 / -1;
  grid-row: 5;
  margin-top: 3rem;
}

.access,
.signed-in,
.request,
.request-form {
  display: grid;
  grid-template-columns: subgrid;
  column-gap: inherit;
  align-items: end;
}

.landing h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
}

/* PROOF PLATES | BETA title in a heavy frame.
   Letter strokes match the 3px box lines: Inter regular strokes are
   ~0.093 of the font size, so 32px gives 3px. */

.landing h1.title-frame {
  display: flex;
  font-size: min(2rem, 8.4vw); /* shrinks slightly only on the narrowest phones */
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  border: var(--line-heavy) solid var(--line);
}

.title-name,
.title-tag {
  padding: 0.35em 0.4em 0.3em;
  white-space: nowrap;
}

@media (max-width: 26rem) {
  .landing h1.title-frame { letter-spacing: 0; }
  .title-name,
  .title-tag { padding: 0.35em 0.2em 0.3em; }
}

.title-tag {
  flex: 1;
  text-align: center;
  color: var(--background);
  background: var(--line);
}

/* Boxed text fields: square corners, heavy lines, stacked boxes share a line */

.field {
  display: block;
  width: 100%;
  min-width: 0;
  height: 3.5rem;
  margin: 0;
  padding: 0 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--background);
  border: var(--line-heavy) solid var(--line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.field::placeholder {
  font-weight: 300;
  color: var(--placeholder);
  text-transform: uppercase;
  opacity: 1;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  position: relative;
  z-index: 1;
}

.field.invalid {
  border-color: var(--error);
  position: relative;
  z-index: 1;
}

.field.received::placeholder { color: var(--accent); }

.field-stack .field ~ .field { margin-top: calc(-1 * var(--line-heavy)); }

/* Square arrow button, used across the site */

.arrow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
  padding: 0.6rem;
  color: var(--background);
  background: var(--line);
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.arrow-button svg {
  display: block;
  width: 100%;
  height: 100%;
}

.arrow-button:focus-visible {
  color: var(--on-accent);
  background: var(--accent);
  outline: none;
}

@media (hover: hover) {
  .arrow-button:hover {
    color: var(--on-accent);
    background: var(--accent);
  }
}

.access .form-error { grid-column: 1 / -1; }

.form-error {
  margin: 0.75rem 0 0;
  color: var(--error);
  font-size: 0.9rem;
}

/* Request beta access, at the bottom of the landing page */

.request-text {
  grid-column: 1;
  margin: 0 0 0.6rem;
  font-size: 1rem;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: nowrap;
}

.request-form { grid-column: 1 / -1; }

/* Narrow phones: the line may wrap, so it can no longer line up with the box edge */
@media (max-width: 30rem) {
  .request-text { white-space: normal; }
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Logo home button: top-left on every page */

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--bar-height);
  height: var(--bar-height);
  padding: 0;
  color: var(--text);
}

/* Exactly 1/8 of the logo's drawing size, so its 2px lines sit on whole pixels */
.brand-logo {
  display: block;
  width: 44px;
  height: 46px;
}

.corner {
  position: absolute;
  top: 0;
  left: 0;
}

/* Inner pages: one boxed bar across the top.
   Every box shares its border with its neighbour. */

.site-header {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--background);
}

/* +1px so the border sits outside the 64px area and the logo stays on whole pixels */
.site-header .brand {
  width: calc(var(--bar-height) + 1px);
  border-right: 1px solid var(--line);
}

.menu { position: relative; }

.menu-bar,
.flyout {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-bar {
  display: flex;
  height: 100%;
}

.menu-item { display: flex; }

.menu-cell,
.flyout-cell,
.bar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: var(--background);
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.menu-cell {
  min-width: 9.5rem;
  border-right: 1px solid var(--line);
}

/* Fly-out: full width of the menu, one boxed row per page */

.flyout {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: -1px;
  right: 0;
  z-index: 10;
  border-left: 1px solid var(--line);
}

.menu-item.open .flyout { display: block; }

@media (hover: hover) {
  .menu-item:hover .flyout { display: block; }
}

.flyout-cell {
  height: 2.6rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Current page: black box, white text */

.menu-item.is-current > .menu-cell,
.flyout-cell[aria-current="page"] {
  color: var(--background);
  background: var(--text);
}

/* Hover, open, and keyboard focus: blue box, white text */

.brand:focus-visible,
.menu-item.open > .menu-cell,
.menu-cell:focus-visible,
.flyout-cell:focus-visible,
.bar-cell:focus-visible {
  color: var(--on-accent);
  background: var(--accent);
  outline: none;
}

@media (hover: hover) {
  .brand:hover,
  .menu-item:hover > .menu-cell,
  .flyout-cell:hover,
  .bar-cell:hover {
    color: var(--on-accent);
    background: var(--accent);
  }
}

.bar-fill { flex: 1; }

.signout {
  display: flex;
  margin: 0;
}

.bar-cell {
  font-weight: 400;
  border-left: 1px solid var(--line);
}

/* PORTAL: inverse cell (white on near-black); blue on hover like every box */
.portal-cell {
  color: var(--background);
  background: var(--text);
}

/* Narrow screens: menu drops to its own row under the logo */

@media (max-width: 40rem) {
  .site-header { flex-wrap: wrap; }
  .menu {
    order: 3;
    flex-basis: 100%;
    border-top: 1px solid var(--line);
  }
  .menu-bar { height: 3rem; }
  .menu-item { flex: 1; }
  .menu-item:last-child > .menu-cell { border-right: 0; }
  .menu-cell { flex: 1; min-width: 0; padding: 0 0.5rem; }
  .flyout { left: 0; right: 0; border-left: 0; }
  .flyout-cell { border-right: 0; }
  .signout, .signin { order: 2; }
}

.page {
  padding: 2.5rem 1.25rem 4rem;
}

.content {
  max-width: 42rem;
  margin: 0 auto;
}

.content h1 {
  margin-top: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
}

.content h2 { margin-top: 2rem; }

.field-note {
  margin: 0;
  align-self: center;
}

/* Signed-in Home: headline, intro, GET STARTED, line drawing on the right.
   The drawing is a transparency mask filled with the palette grey, so it
   follows brand.py like everything else. */

.home {
  position: relative;
  overflow: hidden;
  --art-top: clamp(1.5rem, 3vw, 3.5rem);    /* space between menu bar and drawing */
  --art-bottom: clamp(2.5rem, 4vw, 4rem);   /* space below the drawing and the button */
}

/* The drawing's left-most line sits at the centre of the window (its content
   starts 3.46% in from its own left edge, so 50% / 0.9654 = 51.8% wide).
   Anything below the hero is cropped by the horizontal line under it.
   It is a vector mask filled with the palette grey. */
.home-art {
  position: absolute;
  top: var(--art-top);
  right: 0;
  width: 51.8%;
  aspect-ratio: 5572 / 4600;
  background-color: var(--placeholder);
  -webkit-mask: url("../img/home-lines.34f006f76481.svg") no-repeat right top / contain;
  mask: url("../img/home-lines.34f006f76481.svg") no-repeat right top / contain;
}

.home-hero {
  position: relative;
  z-index: 1;
  /* Top: clear the tallest menu fly-out (rows of 2.6rem) plus a gap */
  padding: calc(var(--flyout-rows, 4) * 2.6rem + clamp(2rem, 3vw, 3rem)) clamp(1rem, 3.5vw, 4rem) var(--art-bottom);
}

.home-headline {
  margin: 0;
  font-size: clamp(2.5rem, 4.6vw, 5.25rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap; /* "PROOF PLATES," always on one line */
}

.home-accent { color: var(--accent); }

.home-intro {
  max-width: 17em;
  margin: clamp(1.75rem, 3.5vw, 3.5rem) 0 clamp(2rem, 4vw, 4rem);
  font-size: clamp(1.15rem, 1.7vw, 1.9rem);
  line-height: 1.38;
}

.home-intro p { margin: 0; }

/* Labelled arrow link: [ LABEL ][ arrow ], sharing one edge */

.arrow-link {
  display: inline-flex;
  height: 3.5rem;
  text-decoration: none;
  color: var(--text);
}

.arrow-link-label {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 1.25rem;
  font-weight: 400;
  text-transform: uppercase;
  border: var(--line-heavy) solid var(--line);
  border-right: 0;
  background: var(--background);
}

.arrow-link-icon {
  display: flex;
  width: 3.5rem;
  padding: 0.6rem;
  color: var(--background);
  background: var(--line);
}

.arrow-link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.arrow-link:focus-visible { outline: none; }

.arrow-link:focus-visible .arrow-link-label,
.arrow-link:focus-visible .arrow-link-icon {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

@media (hover: hover) {
  .arrow-link:hover .arrow-link-label,
  .arrow-link:hover .arrow-link-icon {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }
}

/* Narrow screens: drawing moves below the text */
@media (max-width: 56rem) {
  .home { display: flex; flex-direction: column; }
  .home-art {
    position: static;
    order: 2;
    width: 100%;
    max-width: none;
    margin-bottom: var(--art-bottom);
  }
  .home-hero { padding-top: clamp(2rem, 6vw, 3rem); padding-bottom: 1.5rem; }
}


/* Page shell: footer sits at the bottom of short pages */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.shell > main { flex: 1; }

/* Home sections below the drawing */

.home-section {
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1rem, 3.5vw, 4rem);
  border-top: 1px solid var(--line);
}

.home-expertise {
  max-width: 32em;
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 2.25rem);
  font-weight: 400;
  line-height: 1.3;
}

.section-heading {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(1.75rem, 3.2vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
}

/* OUR PROCESS: stacked tiles; clicking one opens its panel underneath.
   Tiles share their 3px borders; only one panel is open at a time. */

.process {
  max-width: 40rem;
  border-top: var(--line-heavy) solid var(--line);
}

.process-step { margin: 0; }

.process-tile {
  display: grid;
  grid-template-columns: 5.5rem 1fr 3.5rem;
  align-items: stretch;
  min-height: 4.5rem;
  list-style: none;
  cursor: pointer;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  background: var(--background);
  border: var(--line-heavy) solid var(--line);
  border-top: 0;
}

.process-tile::-webkit-details-marker { display: none; }
.process-tile::marker { content: ""; }

.process-tile > span {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
}

.process-number {
  justify-content: center;
  border-right: var(--line-heavy) solid var(--line);
}

.process-toggle {
  justify-content: center;
  font-weight: 300;
  font-size: 1.75rem;
}

.process-toggle::before { content: "+"; }
.process-step[open] .process-toggle::before { content: "\2212"; } /* minus sign */

.process-step[open] > .process-tile {
  color: var(--background);
  background: var(--text);
}

.process-step[open] .process-number { border-right-color: var(--background); }

.process-tile:focus-visible {
  outline: none;
  color: var(--on-accent);
  background: var(--accent);
}

@media (hover: hover) {
  .process-tile:hover {
    color: var(--on-accent);
    background: var(--accent);
  }
  .process-tile:hover .process-number { border-right-color: var(--on-accent); }
}

.process-panel {
  padding: 1.25rem 1.25rem 1.5rem 6.75rem; /* text lines up with the step name */
  font-size: 1.05rem;
  line-height: 1.55;
  border: var(--line-heavy) solid var(--line);
  border-top: 0;
  animation: flyout 0.22s ease-out;
}

.process-panel p { margin: 0 0 0.75rem; max-width: 34em; }
.process-panel p:last-child { margin-bottom: 0; }

@keyframes flyout {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .process-panel { animation: none; }
}

@media (max-width: 30rem) {
  .process-tile { grid-template-columns: 4rem 1fr 3rem; }
  .process-tile > span { padding: 0 0.75rem; }
  .process-panel { padding-left: 1.25rem; }
}

/* Footer: one boxed row, cells share 1px lines like the menu bar */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.footer-cell {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--text);
  border-right: 1px solid var(--line);
}

.footer-copy {
  flex: 1;
  text-transform: none;
}

a.footer-cell:focus-visible {
  outline: none;
  color: var(--on-accent);
  background: var(--accent);
}

@media (hover: hover) {
  a.footer-cell:hover {
    color: var(--on-accent);
    background: var(--accent);
  }
}

.site-footer > :last-child { border-right: 0; }

@media (max-width: 40rem) {
  .footer-copy { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); padding: 0.75rem 1.25rem; }
  .footer-cell:not(.footer-copy) {
    flex: 0 0 50%;
    justify-content: center;
    padding: 0 0.5rem;
    white-space: nowrap;
  }
  .footer-cell:nth-child(3), .footer-cell:nth-child(5) { border-right: 0; }
  .footer-cell:nth-child(2), .footer-cell:nth-child(3) { border-bottom: 1px solid var(--line); }
}

/* Button under the OUR PROCESS tiles */
.process-cta { margin-top: clamp(1.5rem, 3vw, 2.5rem); }

/* Our Process page */

.process-page { padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1rem, 3.5vw, 4rem) clamp(3rem, 6vw, 5rem); }

.process-page .section-heading { margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }

.process-page .lead {
  max-width: 34em;
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.4;
}

/* Numbered steps and service list: 3px boxes sharing borders, like the Home tiles */
.step-list,
.box-list {
  max-width: 52rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--line-heavy) solid var(--line);
}

.step-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  border: var(--line-heavy) solid var(--line);
  border-top: 0;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
  border-right: var(--line-heavy) solid var(--line);
}

.step-text {
  margin: 0;
  padding: 1.1rem 1.25rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

.process-page .section-break {
  margin: clamp(3rem, 6vw, 5rem) calc(-1 * clamp(1rem, 3.5vw, 4rem)) clamp(2.5rem, 5vw, 4rem);
  border: 0;
  border-top: 1px solid var(--line);
}

.box-list { max-width: 32rem; }

.box-list li {
  padding: 1rem 1.25rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 700;
  text-transform: uppercase;
  border: var(--line-heavy) solid var(--line);
  border-top: 0;
}

.process-page .closing {
  margin: clamp(2rem, 4vw, 3rem) 0 1.25rem;
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.4;
}

@media (max-width: 30rem) {
  .step-list li { grid-template-columns: 3.5rem 1fr; }
  .step-text { padding: 0.9rem 1rem; }
}

/* Our Process: steps on the left, quote flowchart on the right */
.steps-with-flow {
  display: grid;
  grid-template-columns: minmax(0, 52rem) 380px;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.flowchart { margin: 0; }
.flowchart svg { display: block; width: 100%; max-width: 380px; height: auto; }

.fc-box { fill: var(--background); stroke: var(--line); stroke-width: 3; }
.fc-end { fill: var(--text); }
.fc-line { fill: none; stroke: var(--line); stroke-width: 2; }
.fc-arrow { fill: var(--line); }
.fc-label {
  fill: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-anchor: middle;
  text-transform: uppercase;
}
.fc-on-dark { fill: var(--background); }
.fc-note { font-weight: 300; }
.fc-answer text { fill: var(--text); font-size: 11px; font-weight: 400; letter-spacing: 0.04em; }

@media (max-width: 75rem) {
  .steps-with-flow { grid-template-columns: minmax(0, 52rem); }
}

/* Links inside text: underlined, same colour as the text, blue on hover */
.step-text a,
.lead a,
.content a,
.home-intro a,
.process-panel a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.step-text a:focus-visible,
.lead a:focus-visible,
.content a:focus-visible,
.home-intro a:focus-visible,
.process-panel a:focus-visible {
  color: var(--accent);
  outline: none;
}

@media (hover: hover) {
  .step-text a:hover,
  .lead a:hover,
  .content a:hover,
  .home-intro a:hover,
  .process-panel a:hover { color: var(--accent); }
}
