/* R&D Sintessa Analytics */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  /* Colour */
  --ink: #0B121C;          /* near-black navy: hero, footer, text */
  --ink-soft: #1B2532;     /* hairlines on ink */
  --paper: #F4F1EA;        /* warm off-white */
  --paper-deep: #EAE6DC;   /* contact ground */
  --rule: #D5D0C3;         /* hairlines on paper */
  --slate: #5C6672;        /* secondary text on paper */
  --mist: #8E99A6;         /* secondary text on ink */
  --signal: #E0672C;       /* single accent, on ink */
  --signal-deep: #B4481A;  /* same accent, on paper */

  /* Type */
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --text: "IBM Plex Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Scale */
  --s-label: 0.6875rem;
  --s-small: 0.8125rem;
  --s-body: 1.0625rem;
  --s-mid: clamp(1.375rem, 2.4vw, 1.875rem);
  --s-lead: clamp(1.75rem, 4.2vw, 3.25rem);
  --s-mark: clamp(4.25rem, 19vw, 15rem);

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--s-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--signal); color: var(--ink); }

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

.hero {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--gutter);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: var(--s-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.figure {
  position: absolute;
  z-index: 0;
  top: 40%;
  right: -55%;
  width: 150vw;
  max-width: 68rem;
  transform: translateY(-50%);
  pointer-events: none;
  fill: none;
}

.figure .axes line { stroke: var(--ink-soft); stroke-width: 1; }
.figure .ticks line { stroke: #2A3646; }

.figure ellipse {
  stroke: #3A4758;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.figure .point { fill: var(--signal); }

.hero-main {
  position: relative;
  z-index: 1;
  align-self: end;
  padding-top: 6rem;
}

.mark {
  display: inline-grid;
  margin: 0;
  font-weight: 400;
}

/* R&D: same serif as the name, with the ampersand as the one coloured glyph. */
.mark-pre {
  font-family: var(--display);
  font-size: calc(var(--s-mark) * 0.27);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.mark-pre em,
.lockup em {
  font-style: italic;
  color: var(--signal);
  padding: 0 0.05em;
}

.mark-main {
  margin: 0.06em 0 0.02em -0.04em;
  font-family: var(--display);
  font-size: var(--s-mark);
  line-height: 0.86;
  letter-spacing: -0.025em;
}

/* Analytics: spread across the full width of the name, on a graduated scale. */
.mark-post {
  display: block;
  position: relative;
  margin-top: 0.5rem;
  padding-top: clamp(0.9rem, 1.6vw, 1.4rem);
  font-family: var(--mono);
  font-size: clamp(0.875rem, 1.9vw, 1.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.32em;
  /* Pull back the trailing letter-space so the final S sits flush right. */
  margin-right: -0.32em;
  text-align: right;
  text-transform: uppercase;
  color: var(--paper);
}

.mark-post i { font-style: normal; }

.mark-post::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0.32em;
  height: clamp(5px, 0.7vw, 9px);
  border-top: 1px solid var(--mist);
  border-right: 1px solid var(--mist);
  background: linear-gradient(90deg, var(--mist) 1px, transparent 1px) 0 0 / 2.5% 100%;
}

.opening {
  max-width: 27ch;
  margin: clamp(2rem, 5vh, 3.5rem) 0 0;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
}

.place {
  margin: 1.25rem 0 0;
  font-family: var(--mono);
  font-size: var(--s-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

/* ---------- Sheet ---------- */

.sheet {
  padding: clamp(4rem, 12vh, 9rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.entry {
  display: grid;
  gap: 1rem;
  padding: clamp(2rem, 5vh, 3.5rem) 0;
  border-top: 1px solid var(--rule);
}

.entry:last-child { border-bottom: 1px solid var(--rule); }

.entry-label {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--s-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

.num {
  display: inline-block;
  min-width: 2.75em;
  color: var(--signal-deep);
}

.entry-text {
  max-width: 44ch;
  margin: 0;
  color: var(--slate);
}

.entry-text--lead {
  max-width: 24ch;
  font-family: var(--display);
  font-size: var(--s-lead);
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

.entry-text--mid {
  max-width: 30ch;
  font-size: var(--s-mid);
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
}

.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.75rem;
  border-radius: 50%;
  background: var(--signal-deep);
  vertical-align: 0.08em;
  animation: pulse 2.8s ease-in-out infinite;
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  gap: 2.5rem;
  padding: clamp(4rem, 12vh, 8rem) var(--gutter);
  background: var(--paper-deep);
}

.contact-title {
  margin: 1.25rem 0 0;
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

form { max-width: 34rem; }

.row { margin-bottom: 2rem; }

label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: var(--s-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
  transition: color 200ms var(--ease);
}

.row:focus-within label { color: var(--signal-deep); }

input, select, textarea {
  display: block;
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid #B9B3A4;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  /* Underline that draws in from the left on focus. */
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat transparent;
  transition: background-size 380ms var(--ease);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  background-size: 100% 1px;
}

select {
  cursor: pointer;
  padding-right: 1.5rem;
}

.row:has(select) { position: relative; }

.row:has(select)::after {
  content: "";
  position: absolute;
  right: 0.25rem;
  bottom: 1.1rem;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1px solid var(--slate);
  border-bottom: 1px solid var(--slate);
  transform: rotate(45deg);
  pointer-events: none;
}

textarea { resize: vertical; min-height: 7rem; line-height: 1.5; }

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
  padding: 0.95rem 1.5rem 0.95rem 1.75rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: var(--s-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

.arrow {
  font-family: var(--text);
  font-size: 1rem;
  letter-spacing: 0;
  transition: transform 260ms var(--ease);
}

button:hover, .button:hover { background: transparent; color: var(--ink); }
button:hover .arrow { transform: translateX(0.4rem); }
button:active { transform: translateY(1px); }

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

.privacy {
  max-width: 34rem;
  margin: 2.5rem 0 0;
  font-size: var(--s-small);
  color: var(--slate);
}

/* Honeypot: off screen, not display:none, so simple bots still fill it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

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

.foot {
  padding: 3rem var(--gutter) 2rem;
  background: var(--ink);
  color: var(--mist);
}

.lockup {
  margin: 0 0 2.5rem;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  color: var(--paper);
}

.l-post {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: var(--s-label);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  vertical-align: 0.25em;
}

.foot-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink-soft);
  font-family: var(--mono);
  font-size: var(--s-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Notice page (contact.php output) ---------- */

.page {
  min-height: 100vh;
  padding: clamp(3rem, 12vh, 8rem) var(--gutter);
  background: var(--ink);
  color: var(--paper);
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1;
}

.notice { max-width: 34rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--ink-soft); }

.notice h2 {
  margin: 0 0 1.5rem;
  font-family: var(--mono);
  font-size: var(--s-label);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
}

.notice p { margin: 0 0 2rem; font-weight: 300; }

.page .button { border-color: var(--paper); background: var(--paper); color: var(--ink); }
.page .button:hover { background: transparent; color: var(--paper); }

/* ---------- Wider screens ---------- */

@media (min-width: 48rem) {
  .figure { top: 46%; right: -14%; width: 74vw; }

  .entry { grid-template-columns: minmax(10rem, 1fr) 3fr; gap: 2rem; }
  .entry-label { padding-top: 0.6em; }

  .contact { grid-template-columns: 2fr 3fr; gap: 4rem; }
  .contact-head { position: sticky; top: 3rem; align-self: start; }
}

@media (min-width: 80rem) {
  /* Offset the middle entry to break the column. */
  .entry:nth-child(2) .entry-text { margin-left: 22%; }
}

/* ---------- Motion ---------- */

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(1.25rem); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

@media (prefers-reduced-motion: no-preference) {
  .figure ellipse { animation: draw 2.4s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 200ms); }
  .figure .axes { animation: fade 1.6s ease both; }
  .figure .point { animation: fade 600ms ease 100ms both; }

  .bar { animation: fade 1.2s ease 300ms both; }
  .mark-main { animation: rise 1.1s var(--ease) 150ms both; }
  .mark-pre, .mark-post { animation: fade 1s ease 700ms both; }
  .opening { animation: rise 1s var(--ease) 750ms both; }
  .place { animation: fade 1s ease 1100ms both; }

  .js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 900ms var(--ease), transform 900ms var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
}
