/* ==========================================================================
   Roble Robotics — Biomedical Technology
   assets/css/site.css
   Single stylesheet. Design tokens live in :root — edit there, not below.
   ========================================================================== */

/* --- 1. Fonts ------------------------------------------------------------ */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/manrope-latin-wght-normal.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: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('/assets/fonts/manrope-latin-ext-wght-normal.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;
}

/* --- 2. Tokens ----------------------------------------------------------- */

:root {
  /* Surfaces */
  --paper:      #F7F6F3;   /* warm white — primary background          */
  --paper-2:    #EFEDE8;   /* stone tint — alternating bands           */
  --black:      #000000;   /* deep black — inverted band, primary type */

  /* Type colours */
  --ink:        #000000;
  --carbon:     #26241F;   /* body copy on paper                       */
  --stone:      #6E6B62;   /* metadata, secondary copy (AA on paper)   */
  --rule:       #D7D3CB;   /* hairlines                                */
  --rule-dark:  #2E2C28;   /* hairlines on black                       */

  /* Accent — sampled from the oak leaf in the logo. Used sparingly. */
  --ember:      #A9420A;   /* on light surfaces                        */
  --amber:      #C87A0C;   /* on dark surfaces                         */
  --russet:     #5E2F04;

  /* Rhythm */
  --pad:  clamp(20px, 5vw, 84px);
  --gap:  clamp(18px, 2.2vw, 40px);
  --band: clamp(84px, 11.5vw, 190px);
  --maxw: 1560px;

  /* Motion */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --slow: 1.05s;
}

/* --- 3. Reset ------------------------------------------------------------ */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--carbon);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.62;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection { background: var(--ember); color: var(--paper); }

/* --- 4. Layout primitives ----------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}

.band { padding-block: var(--band); }
.band--tight { padding-block: clamp(56px, 7vw, 116px); }

.rule { height: 1px; background: var(--rule); border: 0; }

.u-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: var(--pad); top: 8px;
  transform: translateY(-160%);
  background: var(--black); color: var(--paper);
  padding: 10px 16px; z-index: 200; font-size: .875rem;
}
.skip:focus { transform: none; }

/* --- 5. Typography ------------------------------------------------------- */

.t-display {
  font-size: clamp(2.6rem, 8.4vw, 7.1rem);
  font-weight: 300;
  line-height: 0.97;
  letter-spacing: -0.038em;
  color: var(--ink);
}

.t-title {
  font-size: clamp(2rem, 4.4vw, 3.7rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.032em;
  color: var(--ink);
}

.t-sub {
  font-size: clamp(1.375rem, 2.3vw, 2.05rem);
  font-weight: 350;
  line-height: 1.14;
  letter-spacing: -0.024em;
  color: var(--ink);
}

.t-lead {
  font-size: clamp(1.0625rem, 1.28vw, 1.3125rem);
  font-weight: 350;
  line-height: 1.55;
  letter-spacing: -0.012em;
  color: var(--carbon);
  max-width: 46ch;
}

.t-body { max-width: 62ch; }
.t-body + .t-body { margin-top: 1.15em; }

.t-meta {
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--stone);
}

.t-num {
  font-size: .8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ember);
}

.link {
  display: inline-block;
  color: var(--ink);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .5s var(--ease), color .3s ease;
}
.link:hover { color: var(--ember); background-size: 0% 1px; background-position: 100% 100%; }

.link--quiet { color: var(--stone); background-size: 0 1px; }
.link--quiet:hover { color: var(--ember); background-size: 100% 1px; background-position: 0 100%; }

/* --- 6. Header ----------------------------------------------------------- */

.site-head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 90;
  border-bottom: 1px solid transparent;
}

.site-head.is-pinned {
  position: fixed;
  background: var(--paper);
  border-bottom-color: var(--rule);
  animation: pin-in .5s var(--ease) both;
}

@keyframes pin-in {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: clamp(64px, 6vw, 88px);
}

.brand { display: block; line-height: 0; }
.brand img { width: auto; height: clamp(26px, 2.3vw, 32px); }

.nav {
  display: flex;
  gap: clamp(20px, 2.3vw, 42px);
  font-size: .9375rem;
  font-weight: 450;
  letter-spacing: -0.008em;
}
.nav a { color: var(--carbon); transition: color .3s ease; }
.nav a:hover { color: var(--ember); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 3px;
  background: var(--ember);
}

.site-head__end { display: flex; align-items: center; gap: 18px; }
.nav-contact {
  font-size: .9375rem;
  font-weight: 450;
  color: var(--carbon);
  transition: color .3s ease;
}
.nav-contact:hover { color: var(--ember); }

.menu-btn {
  display: none;
  background: none;
  border: 0;
  padding: 10px 0 10px 10px;
  cursor: pointer;
}
.menu-btn i {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--ink);
  transition: transform .45s var(--ease), opacity .3s ease;
}
.menu-btn i + i { margin-top: 7px; }
.menu-btn[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] i:last-child  { transform: translateY(-4px) rotate(-45deg); }

/* Mobile overlay */
.menu {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.menu[data-open="true"] { opacity: 1; pointer-events: auto; }
.menu__list {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.4vw, 18px);
}
.menu__list a {
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.menu__foot { margin-top: clamp(40px, 9vw, 64px); }

/* --- 7. Hero ------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(120px, 15vh, 210px);
  padding-bottom: clamp(26px, 5vh, 64px);
}

.hero__grid { row-gap: clamp(38px, 5.4vw, 78px); }

.hero__meta   { grid-column: 1 / 3;  align-self: end; }
.hero__title  { grid-column: 3 / 13; }
.hero__lead   { grid-column: 8 / 13; }

.hero__meta span { display: block; }
.hero__meta span:first-child { color: var(--carbon); }



/* Signal rule — noise resolving into a detected pulse. */
.hero > .wrap:last-child { margin-top: clamp(56px, 11vh, 160px); }

.signal { position: relative; }
.signal svg {
  width: 100%;
  height: clamp(64px, 7.4vw, 104px);
  display: block;
}
.signal path {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.signal__dot {
  position: absolute;
  left: 76.25%;
  top: 18.4%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--ember);
  border-radius: 50%;
}

/* --- 8. Full-bleed media -------------------------------------------------- */

.bleed { width: 100%; overflow: hidden; }
.bleed img {
  width: 100%;
  height: clamp(280px, 56vh, 720px);
  object-fit: cover;
}

.frame { overflow: hidden; background: var(--paper-2); }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* --- 9. Creed (scroll typography) ---------------------------------------- */

.creed { padding-block: clamp(110px, 17vw, 300px); }
.creed__a { grid-column: 2 / 11; }
.creed__b { grid-column: 5 / 13; margin-top: clamp(56px, 9vw, 160px); }
.creed p { font-weight: 300; }
.creed__b p { color: var(--stone); }

/* --- 10. Section headers -------------------------------------------------- */

.head { align-items: end; row-gap: clamp(20px, 3vw, 34px); }
.head__title { grid-column: 1 / 8; }
.head__aside { grid-column: 9 / 13; }

@media (max-width: 900px) {
  .head__title, .head__aside { grid-column: 1 / -1; }
}

/* --- 11. Index list (Areas of Exploration) -------------------------------- */

.index { margin-top: clamp(44px, 6vw, 88px); border-top: 1px solid var(--rule); }

.index__row {
  display: grid;
  grid-template-columns: 68px minmax(0, 4.6fr) minmax(0, 6fr);
  column-gap: var(--gap);
  padding-block: clamp(28px, 3.4vw, 50px);
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.index__row > .t-num { padding-top: .55em; }
.index__d { padding-top: .3em; }
.index__t { font-size: clamp(1.3rem, 2vw, 1.85rem); font-weight: 350; letter-spacing: -0.025em; line-height: 1.14; color: var(--ink); }
.index__d { color: var(--stone); max-width: 52ch; }

@media (max-width: 900px) {
  .index__row {
    grid-template-columns: 44px minmax(0, 1fr);
    row-gap: 10px;
  }
  .index__d { grid-column: 2; }
}

/* --- 12. Phase sequence (Research) ---------------------------------------- */

.phases {
  margin-top: clamp(46px, 6vw, 92px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: var(--gap);
  border-top: 1px solid var(--rule);
}
.phase { padding-top: 22px; position: relative; }
.phase::before {
  content: "";
  position: absolute;
  top: -3px; left: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--rule);
}
.phase:first-child::before { background: var(--ember); }
.phase__n { display: block; margin-bottom: 6px; }
.phase__t { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.phase__d { margin-top: 8px; font-size: .9375rem; color: var(--stone); max-width: 30ch; }

@media (max-width: 900px) {
  .phases { grid-template-columns: 1fr; border-top: 0; }
  .phase { border-top: 1px solid var(--rule); padding-block: 20px 22px; }
}

/* --- 13. Projects --------------------------------------------------------- */

.work { margin-top: clamp(48px, 6vw, 92px); }

.project { padding-block: clamp(46px, 6vw, 96px); border-top: 1px solid var(--rule); }
.project:first-child { border-top: 0; padding-top: 0; }

.project__media { grid-column: 1 / 9; }
.project__body  { grid-column: 10 / 13; align-self: end; }
.project:nth-child(even) .project__media { grid-column: 5 / 13; order: 2; }
.project:nth-child(even) .project__body  { grid-column: 1 / 4; order: 1; }

.project__media .frame { aspect-ratio: 8 / 5; }
.project__media img { transition: transform 1.4s var(--ease); }
.project a:hover .frame img { transform: scale(1.025); }

.project__title { margin-top: 18px; }
.project__desc { margin-top: 14px; color: var(--stone); max-width: 42ch; }
.project__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 22px; }

@media (max-width: 1000px) {
  .project__media,
  .project__body,
  .project:nth-child(even) .project__media,
  .project:nth-child(even) .project__body { grid-column: 1 / -1; order: 0; }
  .project__body { margin-top: 26px; }
}

/* --- 14. Inverted principle band ------------------------------------------ */

.creedo {
  background: var(--black);
  color: rgba(247, 246, 243, .72);
  padding-block: clamp(110px, 15vw, 240px);
}
.creedo__title {
  grid-column: 1 / 10;
  color: var(--paper);
  font-size: clamp(1.9rem, 4.4vw, 3.7rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.032em;
}
.creedo__note { grid-column: 1 / 8; margin-top: clamp(26px, 3vw, 44px); max-width: 54ch; }
.creedo__note b { color: var(--amber); font-weight: 500; }

@media (max-width: 900px) {
  .creedo__title, .creedo__note { grid-column: 1 / -1; }
}

/* --- 15. Prose pages ------------------------------------------------------ */

.page-head { padding-top: clamp(140px, 19vh, 260px); padding-bottom: clamp(46px, 6vw, 92px); }
.page-head__eyebrow { grid-column: 1 / 3; align-self: end; }
.page-head__title { grid-column: 3 / 12; }
.page-head__lead  { grid-column: 3 / 9; margin-top: clamp(28px, 3.2vw, 48px); }

@media (max-width: 900px) {
  .page-head__eyebrow, .page-head__title, .page-head__lead { grid-column: 1 / -1; }
  .page-head__eyebrow { margin-bottom: 20px; }
}

.prose { row-gap: clamp(34px, 4.4vw, 60px); }
.prose__aside { grid-column: 1 / 3; }
.prose__main  { grid-column: 3 / 9; }
.prose__wide  { grid-column: 3 / 12; }
.prose__side  { grid-column: 10 / 13; }

@media (max-width: 900px) {
  .prose__aside, .prose__main, .prose__wide, .prose__side { grid-column: 1 / -1; }
}

.deflist { border-top: 1px solid var(--rule); }
.deflist > div {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  column-gap: var(--gap);
  padding-block: clamp(22px, 2.4vw, 34px);
  border-bottom: 1px solid var(--rule);
}
.deflist dt { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.deflist dd { margin: 0; color: var(--stone); max-width: 54ch; }

@media (max-width: 760px) {
  .deflist > div { grid-template-columns: 1fr; row-gap: 8px; }
}

.note {
  border-left: 1px solid var(--rule);
  padding-left: clamp(16px, 1.6vw, 26px);
  color: var(--stone);
  font-size: .9375rem;
  max-width: 56ch;
}

/* --- 16. Contact ---------------------------------------------------------- */

.contact__form { grid-column: 7 / 13; }
.contact__info { grid-column: 1 / 6; }

@media (max-width: 1000px) {
  .contact__form, .contact__info { grid-column: 1 / -1; }
  .contact__form { margin-top: clamp(46px, 6vw, 80px); }
}

.field { display: block; margin-bottom: clamp(22px, 2.4vw, 32px); }
.field > span {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--stone);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  font-size: 1.0625rem;
  color: var(--ink);
  border-radius: 0;
  transition: border-color .35s ease;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 0; border-bottom-color: var(--ember); }
.field input::placeholder, .field textarea::placeholder { color: #A9A69D; }

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--carbon) 50%),
                    linear-gradient(135deg, var(--carbon) 50%, transparent 50%);
  background-position: right 6px center, right 1px center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 24px;
}

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

.btn {
  display: inline-block;
  background: var(--black);
  color: var(--paper);
  border: 1px solid var(--black);
  padding: 14px 30px;
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border-radius: 0;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
.btn:hover { background: var(--ember); border-color: var(--ember); }

.formnote { margin-top: 18px; font-size: .875rem; color: var(--stone); }

.alert {
  border-left: 2px solid var(--ember);
  padding: 14px 0 14px 18px;
  margin-bottom: clamp(28px, 3vw, 44px);
  font-size: .9375rem;
  color: var(--carbon);
}


/* --- 17. Footer ----------------------------------------------------------- */

.site-foot { border-top: 1px solid var(--rule); padding-block: clamp(52px, 6vw, 96px) clamp(30px, 3vw, 44px); }
.site-foot__brand { grid-column: 1 / 5; }
.site-foot__nav   { grid-column: 7 / 10; }
.site-foot__meta  { grid-column: 11 / 13; }

.site-foot__brand img { width: clamp(150px, 15vw, 208px); }
.site-foot__brand p { margin-top: 20px; }

.site-foot__nav li + li { margin-top: 9px; }
.site-foot__nav a { font-size: .9375rem; color: var(--carbon); }
.site-foot__nav a:hover { color: var(--ember); }

.site-foot__bottom {
  margin-top: clamp(52px, 6vw, 100px);
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 30px;
}

@media (max-width: 900px) {
  .site-foot__brand { grid-column: 1 / -1; }
  .site-foot__nav   { grid-column: 1 / -1; margin-top: 44px; }
  .site-foot__meta  { grid-column: 1 / -1; margin-top: 30px; }
}

/* --- 18. 404 -------------------------------------------------------------- */

.lost { min-height: 78vh; display: flex; align-items: center; }
.lost__title { grid-column: 3 / 11; }
.lost__body  { grid-column: 3 / 8; margin-top: clamp(26px, 3vw, 40px); }
@media (max-width: 900px) { .lost__title, .lost__body { grid-column: 1 / -1; } }

/* --- 19. Responsive collapse ---------------------------------------------- */

@media (max-width: 1100px) {
  .hero__meta  { grid-column: 1 / 4; }
  .hero__title { grid-column: 4 / 13; }
  .hero__lead  { grid-column: 6 / 13; }
  .creed__a { grid-column: 1 / 12; }
  .creed__b { grid-column: 4 / 13; }
}

@media (max-width: 900px) {
  .nav, .nav-contact { display: none; }
  .menu-btn { display: block; }

  .hero { padding-top: clamp(112px, 15vh, 160px); }
  .hero__meta, .hero__title, .hero__lead { grid-column: 1 / -1; }
  .hero__meta { align-self: start; }
  .hero__lead { max-width: 40ch; }

  .creed__a, .creed__b { grid-column: 1 / -1; }
  }

/* --- 20. Motion ----------------------------------------------------------- */

/* Reveals only apply once JS confirms support — no-JS renders fully visible. */
.js .reveal > .line > span,
.js .reveal.line > span { transform: translateY(102%); }
.js .reveal.is-in > .line > span,
.js .reveal.is-in.line > span {
  transform: translateY(0);
  transition: transform var(--slow) var(--ease);
}
.js .reveal > .line:nth-child(2) > span { transition-delay: .07s; }
.js .reveal > .line:nth-child(3) > span { transition-delay: .14s; }

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.line > span { display: block; }

.js .wipe { clip-path: inset(0 0 100% 0); }
.js .wipe.is-in {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.15s var(--ease);
}

.js .fade { opacity: 0; }
.js .fade.is-in { opacity: 1; transition: opacity .95s var(--ease) .12s; }

.js .load-rise .line > span { animation: rise 1.05s var(--ease) both; }
.js .load-rise .line:nth-child(2) > span { animation-delay: .09s; }
.js .load-rise .line:nth-child(3) > span { animation-delay: .18s; }
@keyframes rise { from { transform: translateY(102%); } to { transform: translateY(0); } }

/* Hero signal draw — the single page-load moment. */
.signal path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .signal path { animation: draw 2.2s var(--ease) .35s forwards; }
.no-js .signal path,
html:not(.js) .signal path { stroke-dashoffset: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.signal__dot, .js .signal__dot, .js html:not(.js) .signal__dot,
html:not(.js) @keyframes settle { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal > .line > span,
  .js .reveal.line > span,
  .js .load-rise .line > span { transform: none; animation: none; }
  .js .wipe { clip-path: none; }
  .js .fade { opacity: 1; }
  .signal path { stroke-dashoffset: 0; }
  .signal__dot,   .site-head.is-pinned { animation: none; }
}

/* --- 21. Print ------------------------------------------------------------ */

@media print {
  .site-head, .menu, .signal, .bleed { display: none; }
  body { background: #fff; color: #000; }
}
