/* Just Rad Design — homepage.
   The page is a vertical flowchart you scroll through: content blocks are
   "nodes", joined by cadet connectors that draw themselves in on scroll. */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--jr-page);
  color: var(--jr-ink);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle dotted grid backdrop — reads like diagram paper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(37, 36, 32, 0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
}

img { max-width: 100%; }

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

:focus-visible {
  outline: 2px solid var(--jr-structure);
  outline-offset: 2px;
}

.jr-page {
  position: relative;
  z-index: 1;
  padding: calc(var(--space-8) + 104px) clamp(16px, 5vw, 48px) 0;
}

/* ============================================================
   TYPE PRIMITIVES
   ============================================================ */
.jr-h {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--jr-ink);
  margin: 0;
  text-wrap: balance;
}
.jr-h--2xl { font-size: var(--text-2xl); }
.jr-h--3xl { font-size: var(--text-3xl); }

.jr-p {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  color: var(--jr-ink);
  margin: 0;
  text-wrap: pretty;
}
.jr-p--muted { color: var(--jr-muted); }
.jr-p--base  { font-size: var(--text-base); }

/* Mono "system" label — uppercase, tracked, cadet. */
.jr-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--jr-structure-deep);
  background: rgba(4, 165, 187, 0.10);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ============================================================
   BUTTONS — warm salmon = action, always.
   ============================================================ */
.jr-btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease,
              color var(--dur-fast) ease, transform 80ms ease;
}
.jr-btn--lg { padding: 14px 26px; font-size: 1.125rem; }
.jr-btn:active { transform: translateY(1px); }

.jr-btn--primary { background: var(--cta); color: #fff; }
.jr-btn--primary:hover { background: var(--cta-hover); }

.jr-btn--secondary {
  background: transparent;
  color: var(--jr-ink);
  border-color: var(--jr-border);
}
.jr-btn--secondary:hover { border-color: var(--jr-muted); }

/* ============================================================
   NODE — the brand's signature device.
   ============================================================ */
.jr-node {
  background: #fff;
  border: 1.5px solid var(--node-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 160px;
  font-family: var(--font-sans);
  color: var(--jr-ink);
  box-shadow: var(--shadow-sm);
}
.jr-node__tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--jr-structure-deep);
  margin-bottom: 6px;
}
.jr-node__title { font-weight: var(--weight-semibold); font-size: 0.95rem; line-height: 1.25; margin: 0; }
.jr-node__body  { font-size: 0.85rem; color: var(--jr-muted); margin: 4px 0 0; line-height: 1.4; }

/* ============================================================
   NODE BLOCK — a whole section drawn as one flowchart node.
   ============================================================ */
.jr-block {
  width: 100%;
  margin: 0 auto;
  position: relative;
  background: #fff;
  border: 1.5px solid var(--jr-structure);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 52px);
  box-shadow: var(--shadow-md);
  max-width: var(--block-w, 880px);
}
.jr-block__tag { margin-bottom: var(--space-4); }
.jr-block--center { text-align: center; }

/* ============================================================
   REVEAL — elements draw themselves in as they scroll into view.
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: var(--reveal-from, translateY(24px));
  transition:
    opacity var(--reveal-dur, 600ms) var(--reveal-ease, var(--ease-standard)) var(--reveal-delay, 0ms),
    transform var(--reveal-dur, 600ms) var(--reveal-ease, var(--ease-standard)) var(--reveal-delay, 0ms);
}
[data-reveal].is-drawn { opacity: 1; transform: none; }

/* ============================================================
   CONNECTORS — cool = structure, so every connector is cadet.
   Each draws itself in via stroke-dashoffset once revealed.
   ============================================================ */
.jr-connector { display: flex; justify-content: center; position: relative; }
.jr-connector svg { overflow: visible; }

.jr-connector--fork,
.jr-connector--merge { display: block; width: 100%; }
.jr-connector--fork svg,
.jr-connector--merge svg { display: block; overflow: visible; }

.jr-line {
  fill: none;
  stroke: var(--jr-structure);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset var(--line-dur, 700ms) var(--ease-standard);
}
.is-drawn .jr-line { stroke-dashoffset: 0; }

.jr-arrow {
  fill: none;
  stroke: var(--jr-structure);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 200ms ease var(--arrow-delay, 600ms);
}
.is-drawn .jr-arrow { opacity: 1; }

/* The little sage "jump to next section" badge riding on a connector. */
.jr-flow-label {
  position: absolute;
  left: calc(50% + 18px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  background: var(--jr-flow-green-deep);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 300ms ease var(--label-delay, 500ms), background var(--dur-fast) ease;
}
.is-drawn .jr-flow-label { opacity: 1; }
.jr-flow-label:hover { background: var(--jr-flow-green-hover); }

.jr-connector--merge .jr-flow-label { left: calc(50% + 86px); top: 74%; --label-delay: 700ms; }

.jr-hconnector { display: flex; align-items: center; justify-content: center; }
.jr-hconnector svg { overflow: visible; }

/* ============================================================
   STAGGER — subtle horizontal jog, a hand-placed back-and-forth rhythm.
   ============================================================ */
.jr-stagger {
  transform: translateX(var(--jog, 0px));
  scroll-margin-top: 96px;
}

/* ============================================================
   FLOATING NAV
   ============================================================ */
.jr-nav {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-pill);
  background: rgba(252, 251, 247, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--jr-structure);
  box-shadow: var(--shadow-md);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.jr-nav::-webkit-scrollbar { display: none; }

.jr-nav a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--jr-structure-deep);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.jr-nav a:hover { background: var(--jr-structure-tint); }
.jr-nav a[aria-current="true"] {
  font-weight: var(--weight-semibold);
  color: #fff;
  background: var(--jr-structure);
}

/* ============================================================
   HERO
   ============================================================ */
.jr-hero-flow {
  display: flex;
  gap: var(--space-6);
  align-items: center;
  flex-wrap: wrap;
}
.jr-hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  flex: 1 1 420px;
  min-width: 0;
}
.jr-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-mono);
  color: var(--jr-structure-deep);
  font-weight: var(--weight-medium);
}
.jr-hero-title {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: var(--jr-ink);
  text-wrap: balance;
}
.jr-hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.jr-hero-portrait {
  flex: 0 0 220px;
  width: 220px;
  align-self: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--jr-structure);
}
.jr-hero-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================================
   THESIS
   ============================================================ */
.jr-thesis-flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-6) 0;
}
.jr-thesis-flow > .jr-node { flex: 1; min-width: 0; border-color: var(--jr-bd-5); }

/* ============================================================
   SERVICES — a fork into six streams, then a merge.
   ============================================================ */
.jr-fork-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.jr-fork-grid + .jr-fork-grid { margin-top: var(--space-5); }
.jr-fork-grid .jr-node { min-width: 0; padding: 20px 22px; }

/* ============================================================
   WORK — expanding project nodes.
   ============================================================ */
.jr-work-list { display: flex; flex-direction: column; gap: var(--space-4); }

.jr-work {
  background: var(--surface-card);
  border: 1.5px solid var(--jr-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.jr-work:hover,
.jr-work.is-open { border-color: var(--jr-structure); }
.jr-work.is-open { background: var(--jr-surface); }

.jr-work-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}
.jr-work-head-main { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }

.jr-work-title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  line-height: 1.2;
  color: var(--jr-ink);
  letter-spacing: -0.01em;
  margin: 0;
}
.jr-work-cats { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-1); }
.jr-work-cat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--jr-muted);
  padding: 4px 10px;
  border: 1px solid var(--jr-border);
  border-radius: var(--radius-sm);
  background: var(--jr-bg);
  white-space: nowrap;
}

/* The +/× control. Its ::after stretches over the whole header so the
   entire row is the hit target, without nesting a heading inside a button. */
.jr-work-toggle {
  flex-shrink: 0;
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--jr-structure);
  background: transparent;
  color: var(--jr-structure-deep);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.jr-work-toggle::after { content: ""; position: absolute; inset: 0; cursor: pointer; }
.jr-work-toggle .jr-plus { transition: transform 180ms ease; }
.jr-work-toggle[aria-expanded="true"] .jr-plus { transform: rotate(45deg); }

.jr-work-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms var(--ease-standard);
}
.jr-work.is-open .jr-work-panel { grid-template-rows: 1fr; }
.jr-work-panel > div { overflow: hidden; }

.jr-work-cols {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  gap: var(--space-7);
  align-items: start;
}
.jr-work-copy > * + * { margin-top: var(--space-5); }
.jr-work-copy > :first-child { margin-top: var(--space-4); }

.jr-work-ps { display: grid; gap: var(--space-3); }
.jr-work-ps > div { padding-left: var(--space-3); border-left: 2px solid var(--jr-border); }
.jr-work-ps .is-problem  { border-left-color: var(--jr-bd-1); }
.jr-work-ps .is-solution { border-left-color: var(--jr-bd-green); }
.jr-work-ps h4 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  margin: 0;
}
.jr-work-ps .is-problem h4  { color: var(--jr-bd-1); }
.jr-work-ps .is-solution h4 { color: var(--jr-bd-green); }
.jr-work-ps p { margin-top: 4px; }

.jr-metric {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(4, 165, 187, 0.10);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--jr-structure-deep);
  font-weight: var(--weight-semibold);
}

.jr-work-cta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.jr-work-cta a {
  display: inline-block;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  background: var(--jr-action);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition: background var(--dur-fast) ease, transform 120ms ease;
}
.jr-work-cta a:hover  { background: var(--jr-action-light); }
.jr-work-cta a:active { transform: translateY(1px); }
.jr-work-cta .jr-note { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--jr-muted); }

/* ---- gallery ---- */
.jr-work-img { margin-top: var(--space-4); }
.jr-gallery { position: relative; width: 100%; aspect-ratio: var(--ratio, 3 / 4); }
.jr-gallery img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}
.jr-gallery img.is-active { opacity: 1; pointer-events: auto; }

.jr-dots { display: flex; gap: 6px; justify-content: center; margin-top: var(--space-3); }
.jr-dots button {
  width: 8px; height: 8px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--jr-border);
  background: transparent;
  cursor: pointer;
  transition: width 200ms ease, background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.jr-dots button[aria-current="true"] {
  width: 20px;
  background: var(--jr-structure);
  border-color: var(--jr-structure);
}

/* ============================================================
   HOW I WORK
   ============================================================ */
.jr-step .jr-node {
  border-color: var(--jr-bd-green);
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* ============================================================
   ABOUT
   ============================================================ */
.jr-about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}
.jr-about-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.jr-about-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--jr-structure);
  aspect-ratio: 3 / 4;
}
.jr-about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.jr-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.jr-photo-grid figure {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--jr-border);
  aspect-ratio: 16 / 10;
}
.jr-photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================================
   SOCIAL PROOF
   ============================================================ */
.jr-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  padding: 0;
  list-style: none;
}
.jr-logos li {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--jr-muted);
  padding: 8px 16px;
  border: 1px solid var(--jr-border);
  border-radius: var(--radius-pill);
  background: var(--jr-bg);
}
.jr-quote { margin: 0 auto; max-width: 620px; }
.jr-quote p { font-style: italic; }
.jr-quote footer {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--jr-structure-deep);
}

/* ============================================================
   CONTACT
   ============================================================ */
.jr-block--terminal { border-width: 2px; border-color: var(--jr-structure); }

.jr-form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); }
.jr-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.jr-form input,
.jr-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--jr-border);
  background: var(--jr-bg);
  color: var(--jr-ink);
  outline: none;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.jr-form textarea { min-height: 120px; resize: vertical; }
.jr-form input:focus,
.jr-form textarea:focus {
  border-color: var(--jr-structure);
  box-shadow: var(--shadow-focus);
}

/* Honeypot: off-screen rather than display:none, which bots learn to skip. */
.jr-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.jr-sent {
  outline: none;
  margin-top: var(--space-6);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--jr-cat-5);
  border: 1.5px solid var(--jr-structure);
}
.jr-sent .jr-sent-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--jr-structure-deep);
  letter-spacing: var(--tracking-mono);
}
.jr-sent p { margin-top: var(--space-2); }

.jr-footer {
  text-align: center;
  margin-top: var(--space-7);
  padding-bottom: var(--space-8);
}
.jr-footer span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  color: var(--jr-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .jr-fork-grid,
  .jr-about-grid,
  .jr-photo-grid,
  .jr-form-grid { grid-template-columns: 1fr; }

  .jr-thesis-flow { flex-direction: column; }
  .jr-thesis-flow .jr-hconnector { transform: rotate(90deg); height: 32px; }

  .jr-stagger { transform: none; }
  .jr-hero-flow { flex-direction: column-reverse; }

  .jr-work-cols { grid-template-columns: 1fr; gap: 0; }
  .jr-work-img { max-width: 320px; }
}

/* ============================================================
   REDUCED MOTION — everything is simply already drawn.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; }
  .jr-line { stroke-dashoffset: 0; }
  .jr-arrow, .jr-flow-label { opacity: 1; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
