/* RST Innovative Solutions LLC - site styles.
   Layout "Aperture": the seven-bladed logo is the hero and opens like an iris; the blade angles cut
   the service cards and section edges; projects orbit the logo's heptagon core.
   One committed dark look on the logo navy (no light theme by design). */

@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --night: #222237;     /* logo navy: page ground */
  --deep: #18182a;      /* hero and projects bands */
  --raised: #2a2a45;    /* cards, inputs */
  --line: #3b3b5c;
  --ink: #f1f3fa;
  --soft: #b6bbd6;
  --cyan: #1ebbf0;
  --blue: #1d6fe8;
  --mint: #39dfaa;
  --gold: #e9c886;      /* champagne: calls to action and fine details only */
  --gold-ink: #241d0e;
  --danger: #ff9a8f;
  --brand: linear-gradient(135deg, var(--cyan) 0%, var(--blue) 100%);
  --brand-soft: linear-gradient(120deg, var(--cyan) 0%, var(--mint) 100%);

  --f-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --f-body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --s-xs: .8125rem;
  --s-sm: .9375rem;
  --s-md: 1.0625rem;
  --s-lg: 1.25rem;
  --s-xl: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  --s-xxl: clamp(2.2rem, 1.2rem + 4vw, 4.1rem);

  --wrap: 74rem;
  --cut: 1.6rem;        /* size of the blade-angle corner cut */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--s-md);
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--cyan); text-underline-offset: .22em; }
a:hover { color: var(--mint); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--s-xxl); font-weight: 450; }
h2 { font-size: var(--s-xl); }
h3 { font-size: 1.05rem; letter-spacing: 0; line-height: 1.3; }
p { margin: 0; max-width: 62ch; }
ul, ol { margin: 0; padding: 0; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--raised); color: var(--ink); padding: .5rem .75rem; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 48rem) {
  .wrap { padding-left: max(36px, env(safe-area-inset-left, 0px)); padding-right: max(36px, env(safe-area-inset-right, 0px)); }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .7rem;
  font-family: var(--f-mono); font-size: var(--s-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 1.75rem; height: 1px; background: var(--gold); }
.lead { font-size: var(--s-lg); line-height: 1.6; color: var(--soft); max-width: 50ch; }
.grad { background: var(--brand-soft); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Brand lockup: vector mark + original wordmark, recoloured through a mask ----------------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.wordmark {
  display: block; background: currentColor;
  -webkit-mask: var(--wm) no-repeat center / contain; mask: var(--wm) no-repeat center / contain;
}
.wordmark.rst { --wm: url("../brand/wordmark-rst.png"); width: 58px; height: 26px; }
.wordmark.full { --wm: url("../brand/wordmark-full.png"); width: 150px; height: 80px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Header ------------------------------------------------------------------------------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--deep); }
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.nav { display: flex; align-items: center; gap: .15rem; }
.nav a { color: var(--soft); text-decoration: none; font-size: var(--s-sm); padding: .5rem .8rem; border-radius: 4px; }
.nav a:hover { color: var(--ink); }
.nav .btn { margin-left: .6rem; }
.nav-toggle { display: none; }
@media (max-width: 50rem) {
  .nav-toggle { display: inline-flex; font: inherit; font-size: var(--s-sm); color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 4px; padding: .45rem .8rem; cursor: pointer; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--deep); border-bottom: 1px solid var(--line);
    padding: .5rem max(16px, env(safe-area-inset-right, 0px)) 1.25rem max(16px, env(safe-area-inset-left, 0px)); }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .25rem; }
  .nav .btn { margin: .75rem 0 0; justify-content: center; }
}

/* ---- Buttons: the cut corner repeats the blade angle ---------------------------------------- */
.btn {
  --c: .7rem;
  display: inline-flex; align-items: center; gap: .55rem;
  font: inherit; font-weight: 600; font-size: var(--s-sm); letter-spacing: .01em;
  padding: .85rem 1.35rem; border: 0; cursor: pointer; text-decoration: none;
  background: var(--gold); color: var(--gold-ink) !important;
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
  transition: filter .2s, transform .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: var(--raised); color: var(--ink) !important; box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--cyan); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---- Hero ---------------------------------------------------------------------------------- */
.hero { position: relative; background: var(--deep); overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--cyan) 22%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -30% -15%; width: 55vw; height: 55vw; max-width: 700px; max-height: 700px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 12%, transparent), transparent 70%);
}
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; padding-block: clamp(3rem, 7vw, 6rem) clamp(4rem, 8vw, 7rem); }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3rem; } }
.hero .wrap > * { min-width: 0; }
.hero-copy { display: grid; gap: 1.6rem; align-content: center; }
.hero h1 em { font-style: normal; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* The iris. Every blade drifts out along its own line and turns a little, then closes again. */
.iris { position: relative; width: min(100%, 34rem); margin-inline: auto; aspect-ratio: 1180 / 1150; max-width: 100%; }
.iris svg { width: 100%; height: 100%; overflow: visible; display: block; }
/* The opening movement is SMIL inside the SVG (one clock for turn and slide); see build.py. */
.iris .orbit-ring { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 6 14; }
.iris-words {
  position: absolute; left: 50%; top: 51.2%; translate: -50% -50%;
  width: 40%; height: 14%; display: grid; place-items: center; pointer-events: none;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(.85rem, .55rem + 1.1vw, 1.25rem); color: var(--deep); letter-spacing: -.01em;
}
.iris-words span { grid-area: 1 / 1; opacity: 0; animation: word 36s infinite both; animation-delay: calc(var(--i) * 9s); }
.iris-words span:first-child { opacity: 1; }
@keyframes word { 0% { opacity: 0; } 2%, 22% { opacity: 1; } 25%, 100% { opacity: 0; } }

/* ---- Sections ------------------------------------------------------------------------------- */
.section { padding-block: clamp(4rem, 8vw, 7rem); position: relative; }
.section-head { display: grid; gap: 1rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.split { display: grid; gap: 2rem 4rem; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; } }
.split > * { min-width: 0; }
.prose-block { display: grid; gap: 1.1rem; color: var(--soft); }
.prose-block strong { color: var(--ink); font-weight: 600; }

.quote {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(1.2rem, .9rem + 1.2vw, 1.65rem); line-height: 1.4; letter-spacing: -.01em;
  padding-left: 1.4rem; border-left: 2px solid var(--gold); max-width: 30ch;
}

/* Service cards: one corner cut on the blade angle, and the matching logo blade as the icon. */
.cards { display: grid; gap: 1.25rem; list-style: none; }
@media (min-width: 52rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  position: relative; display: grid; gap: 1rem; align-content: start;
  padding: 2rem 1.75rem 2.25rem;
  background: linear-gradient(160deg, var(--raised), color-mix(in srgb, var(--raised) 55%, var(--night)));
  clip-path: polygon(0 0, calc(100% - var(--cut) * 2) 0, 100% calc(var(--cut) * 1.3), 100% 100%, 0 100%);
}
.card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--brand-soft); opacity: .55; }
.card .glyph { width: 44px; height: 44px; }
.card p { color: var(--soft); font-size: var(--s-sm); }
.card .num { font-family: var(--f-mono); font-size: var(--s-xs); color: var(--gold); letter-spacing: .1em; }

/* ---- Projects: cards travel around the heptagon core ----------------------------------------- */
.projects {
  background: var(--deep);
  clip-path: polygon(0 clamp(1.5rem, 4vw, 3.5rem), 100% 0, 100% 100%, 0 100%);
  padding-top: clamp(6rem, 11vw, 9rem);
}
.stage { position: relative; }
.stage-svg { display: none; }
.proj-list { list-style: none; display: grid; gap: 1rem; }
.proj {
  display: grid; gap: .35rem; padding: 1.25rem 1.4rem;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - 1rem) 0, 100% 1rem, 100% 100%, 0 100%);
  text-decoration: none; color: var(--ink);
}
.proj b { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; }
.proj span { color: var(--soft); font-size: var(--s-sm); }
.proj small { font-family: var(--f-mono); font-size: .75rem; color: var(--cyan); letter-spacing: .04em; }

@media (min-width: 52rem) {
  .stage { height: 34rem; }
  .stage-svg { display: block; position: absolute; left: 50%; top: 50%; width: 36rem; height: 34rem; translate: -50% -50%; overflow: visible; }
  .stage-svg .path { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 9; }
  .stage-svg .core { fill: url(#core-g); }
  .stage-svg text { fill: var(--deep); font-family: var(--f-display); font-weight: 600; font-size: 30px; text-anchor: middle; dominant-baseline: middle; }
  .proj-list { position: absolute; inset: 0; display: block; }
  .proj-list li { position: absolute; left: 50%; top: 50%; width: 15rem; translate: -50% -50%; transform: translate(var(--x, 0), var(--y, 0)); }
  .proj-list li:nth-child(1) { --x: -15rem; --y: -10rem; }
  .proj-list li:nth-child(2) { --x: 15rem;  --y: -6rem; }
  .proj-list li:nth-child(3) { --x: 2rem;   --y: 12.5rem; }
}

/* ---- Contact -------------------------------------------------------------------------------- */
.contact-grid { display: grid; gap: 3rem; }
@media (min-width: 60rem) { .contact-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 5rem; } }
.contact-grid > * { min-width: 0; }
.reach { display: grid; gap: 1.5rem; align-content: start; }
.reach dl { display: grid; gap: 1.25rem; margin: 0; }
.reach dt { font-family: var(--f-mono); font-size: var(--s-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.reach dd { margin: .2rem 0 0; font-family: var(--f-display); font-size: clamp(1rem, .9rem + .5vw, 1.3rem); font-weight: 400; word-break: break-word; }
.reach dd a { color: var(--ink); text-decoration: none; }
.reach dd a:hover { color: var(--mint); }

form { display: grid; gap: 1.1rem; }
.row2 { display: grid; gap: 1.1rem; }
@media (min-width: 40rem) { .row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: .4rem; }
.field label { font-size: var(--s-sm); font-weight: 600; }
.field label span { font-weight: 400; color: var(--soft); }
input, select, textarea {
  font: inherit; font-size: var(--s-md); color: var(--ink);
  background: var(--raised); border: 1px solid var(--line); border-radius: 2px;
  padding: .75rem .9rem; width: 100%;
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.field.bad input, .field.bad select, .field.bad textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: var(--s-xs); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: var(--s-sm); color: var(--soft); }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .25rem; flex: none; accent-color: var(--mint); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: var(--s-sm); padding: .9rem 1rem; }
.form-status.ok { background: color-mix(in srgb, var(--mint) 14%, var(--night)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 45%, transparent); }
.form-status.fail { box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }

/* ---- Plain pages (privacy, 404) ------------------------------------------------------------- */
.page-hero { background: var(--deep); padding-block: clamp(3rem, 7vw, 5rem); }
.page-hero .wrap { display: grid; gap: 1rem; }
.prose { display: grid; gap: 1rem; max-width: 68ch; color: var(--soft); }
.prose h2 { font-size: var(--s-lg); color: var(--ink); margin-top: 1.25rem; }

/* ---- Footer ---------------------------------------------------------------------------------- */
.site-foot { background: var(--deep); padding-block: 3.5rem 2rem; font-size: var(--s-sm); color: var(--soft); }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.foot-brand { display: flex; align-items: center; gap: 1rem; color: var(--ink); }
.foot-brand .brand-mark { width: 64px; height: 64px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; }
.foot-nav a { color: var(--soft); text-decoration: none; }
.foot-nav a:hover { color: var(--ink); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: var(--s-xs); }
.foot-base a { color: var(--soft); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .iris-words span { animation: none !important; }
  .iris-words span { opacity: 0; } .iris-words span:first-child { opacity: 1; }
  .btn { transition: none; }
}
