/* Joseph Oprea portfolio. Shop drawing on paper: ink linework, one red accent. */

/* Self-hosted variable fonts, Latin subset (from Google Fonts, SIL Open Font License). */
@font-face { font-family: "Archivo Narrow"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("assets/fonts/archivo-narrow-latin.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("assets/fonts/jetbrains-mono-latin.woff2") format("woff2"); }

:root {
  --paper: #efe7d7;
  --paper-2: #e6dcc8;
  --ink: #171b1d;
  --muted: #5f5f57;
  --accent: #b43d28;
  --faint: rgba(23, 27, 29, .18);
  --grid: rgba(23, 27, 29, .075);
  --display: "Archivo Narrow", "Arial Narrow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --text: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--mono);
  /* 40 px drawing grid with an 8 px subgrid */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(rgba(23, 27, 29, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 29, .035) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
}
img, video, canvas, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header and title block ---------- */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-top: 28px; }
.meta { display: grid; gap: 3px; }
.meta .ok { color: var(--accent); }
.tb { border: 1.5px solid var(--ink); background: rgba(239, 231, 215, .9); min-width: 260px; }
.tb div { display: grid; grid-template-columns: 1fr 92px; border-bottom: 1px solid var(--ink); }
.tb div:last-child { border-bottom: 0; }
.tb span, .tb button { padding: 7px 8px; }
.tb div > :last-child { border-left: 1px solid var(--ink); }
.tb button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); background: none; border: 0; border-left: 1px solid var(--ink); cursor: pointer; text-align: left; }
.tb button[aria-pressed="true"] { color: var(--accent); }

.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 18px 0 0; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-color: var(--ink); }
/* Phone-only sound toggle; desktop uses the one in the title block. */
.nav-sound { display: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); background: none; border: 1px solid var(--ink); padding: 4px 8px; cursor: pointer; }
.nav-sound[aria-pressed="true"], .tb button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 72px; }
.eyebrow { color: var(--accent); margin: 0; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; font-weight: 700; }
h1 { font-size: clamp(44px, 6.6vw, 92px); line-height: .88; letter-spacing: -.04em; margin: 12px 0 18px; }
.sub { font-family: var(--text); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: #353837; max-width: 560px; margin: 0 0 26px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border: 1.5px solid var(--ink); text-decoration: none; color: var(--paper); background: var(--ink); cursor: pointer; }
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.plotter { margin: 0; position: relative; border: 1.5px solid var(--ink); background: rgba(239, 231, 215, .6); }
.plotter canvas { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; }
.dro { display: grid; gap: 6px; background: var(--ink); color: var(--paper); padding: 8px 10px; font-variant-numeric: tabular-nums; }
.dro-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dro .st { padding: 2px 7px; border: 1px solid currentColor; }
.dro .st.run { color: #f0a08f; }
.dro .st.insp { color: #9fd3c0; }
.dro .st.idle { color: #c9c2b2; }
.dro .ln { color: #c9c2b2; font-weight: 400; }
.dro-axes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; border-block: 1px solid rgba(239, 231, 215, .25); padding-block: 6px; }
.dro-axes span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 4px; }
.dro-axes i { font-style: normal; color: #c9c2b2; grid-column: 1 / -1; font-size: 9px; }
.dro-axes b { font-size: 15px; letter-spacing: 0; }
.dro-axes small { font-size: 9px; color: #c9c2b2; align-self: end; padding-bottom: 2px; }
.dro .gl { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; text-transform: none; color: #f0e7d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px 16px; background: rgba(239, 231, 215, .92); border: 1px solid var(--ink); padding: 7px 10px; }
.readout b { color: var(--accent); }

/* ---------- Section heads (frame line draws in) ---------- */
.section-head { position: relative; display: flex; align-items: baseline; gap: 14px; padding-top: 14px; margin: 24px 0 0; }
.section-head::before { content: ""; position: absolute; left: 0; top: 0; height: 1.5px; width: 100%; background: var(--ink); transform-origin: left; }
.section-head.draw::before { transform: scaleX(0); transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.section-head.draw.in::before { transform: scaleX(1); }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin: 0; letter-spacing: -.02em; }
.section-head .hint { margin-left: auto; color: var(--muted); }

/* ---------- 01 Builds roadmap ---------- */
.builds { padding-top: 24px; }
.road { position: relative; }
.road-stage { padding: 28px 0 8px; }
.track { list-style: none; margin: 0; padding: 0 var(--gutter); display: grid; gap: 20px; max-width: 1180px; margin-inline: auto; }
.road-rule { display: none; }

.card { border: 1.5px solid var(--ink); background: rgba(239, 231, 215, .85); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card > * { flex-shrink: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pn { font-size: 13px; font-weight: 700; }
.tag { border: 1.5px solid var(--accent); color: var(--accent); padding: 4px 8px; white-space: nowrap; }
.tag.muted { border-color: var(--muted); color: var(--muted); }
.tag.warn { background: var(--accent); color: var(--paper); }
.card h3 { font-size: 30px; line-height: .95; margin: 0; }
.yr { margin: -6px 0 0; color: var(--muted); }
.outcome, .why, .credit, .bio, .lede, .svc p { font-family: var(--text); line-height: 1.5; margin: 0; }
.outcome { font-size: 15px; color: #2b2e2f; }
.why { font-size: 13.5px; color: #3d403f; }
.credit { font-size: 13px; color: var(--muted); }
.note { color: var(--muted); margin: 0; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--faint); }
dt, dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--faint); font-size: 12px; }
dt { color: var(--muted); padding-right: 16px; text-transform: uppercase; letter-spacing: .08em; }
.links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: auto; }

.media { position: relative; border: 1.5px solid var(--ink); background: #c9c4b8; aspect-ratio: 16 / 9; overflow: hidden; }
.media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.callout { position: absolute; left: 10px; top: 10px; background: rgba(239, 231, 215, .92); border: 1px solid var(--ink); padding: 5px 7px; }
.callout.b { left: auto; top: auto; right: 10px; bottom: 10px; }

/* Restricted: 45 degree hatch, stamped label, reason line. Never blur. */
.hatch {
  position: relative; min-height: 96px; border: 1.5px solid var(--ink); overflow: hidden;
  background: repeating-linear-gradient(45deg, transparent 0 7px, rgba(23, 27, 29, .55) 7px 8.5px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.hatch.tall { min-height: 220px; flex: 1; }
.stamp { background: var(--paper); color: var(--accent); border: 2px solid var(--accent); padding: 6px 12px; font-size: 13px; transform: rotate(-4deg); }
/* With motion on, the JO-07 stamp waits hidden until it lands (main.js adds .land). */
.motion #jo-07 .stamp:not(.land) { opacity: 0; }
.stamp.land { animation: stamp .45s cubic-bezier(.16, 1, .3, 1) both; }
.reason { background: var(--paper); padding: 2px 6px; }
.hatch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(239, 231, 215, .35) 50%, transparent 55%); transform: translateY(-100%); }
.hatch:hover::after { animation: scanline 1.2s linear infinite; }
@keyframes scanline { to { transform: translateY(100%); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-4deg) scale(1.8); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

.mesh { width: 100%; height: auto; }
.mesh .links-g path { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.mesh .nodes circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.mesh .link { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.mesh .node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.mesh .node.lit { fill: var(--accent); stroke: var(--accent); }
.mesh .node.dst.lit { fill: var(--ink); stroke: var(--ink); }
.mesh .ring { fill: none; stroke: var(--accent); stroke-width: 1; }
.mesh .hop { font: 700 8px var(--mono); fill: var(--accent); }
.mesh .trunk { stroke: var(--ink); stroke-width: 2; }
.mesh .trunk.down { stroke: var(--accent); stroke-dasharray: 2 5; }
.mesh .lbl { font: 700 7px var(--mono); letter-spacing: .12em; fill: var(--muted); }
.mesh .lbl.bad { fill: var(--accent); }
.mesh-cap { margin: -4px 0 0; color: var(--muted); }

/* Desktop: pinned horizontal roadmap. JS sets the section height and the track offset. */
@media (min-width: 900px) {
  .road.pinned .road-stage { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
  .road.pinned .track { display: flex; gap: 24px; max-width: none; margin: 0; padding: 0 var(--gutter); width: max-content; will-change: transform; }
  .road.pinned .card { width: 340px; flex: none; max-height: 82vh; overflow: auto; }
  .road.pinned .card.wide { width: 560px; }
  .road.pinned .road-rule { display: block; height: 2px; margin: 18px var(--gutter) 0; background: var(--faint); }
  .road-rule i { display: block; height: 100%; width: 0; background: var(--accent); }
}
@media (min-width: 640px) and (max-width: 899px) {
  .track { grid-template-columns: 1fr 1fr; }
  .card.wide, .card.restricted { grid-column: 1 / -1; }
}

/* ---------- JO-05.1 scroll to print ---------- */
.scrub { height: 320vh; position: relative; margin-top: 40px; }
.scrub-stage { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.scrub-frame { position: relative; border: 1.5px solid var(--ink); background: #c9c4b8; aspect-ratio: 16 / 9; max-height: 70vh; margin-inline: auto; width: min(100%, calc(70vh * 16 / 9)); }
.scrub-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scrub-frame .readout { right: auto; }
.bar { height: 3px; background: var(--faint); }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.scrub-cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); }

.jo05-more { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px 40px; padding: 24px 0 8px; border-top: 1px solid var(--faint); }
.nozzle { grid-column: 1 / -1; margin: 0; display: grid; gap: 8px; }
.nozzle figcaption { color: var(--muted); }
/* JO-05.2 layer viewer */
.lv { grid-column: 1 / -1; display: grid; gap: 12px; }
.lv .section-head { margin-top: 8px; }
.lv-lede, .lv-note { font-family: var(--text); line-height: 1.5; margin: 0; max-width: 680px; }
.lv-lede { font-size: 15px; color: #2b2e2f; }
.lv-note { font-size: 13px; color: var(--muted); }
.lv-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); }
.seg button { font: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.lv-stage { position: relative; border: 1.5px solid var(--ink); background: #e9e1d0; aspect-ratio: 16 / 10; max-height: 70vh; width: 100%; max-width: 100%; touch-action: pan-y; overflow: hidden; }
.lv-stage canvas { display: block; width: 100%; height: 100%; }
.lv-wait { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.lv-dro { position: absolute; left: 10px; top: 10px; z-index: 1; background: var(--ink); color: var(--paper); padding: 8px 10px; display: grid; gap: 6px; font-variant-numeric: tabular-nums; max-width: calc(100% - 20px); }
.lv-axes { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 14px; }
.lv-axes i { font-style: normal; color: #c9c2b2; font-size: 11px; display: block; }
.lv-axes b { font-size: 14px; letter-spacing: 0; }
.lv-dro code { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; text-transform: none; color: #f0e7d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; }
.lv-controls output { min-width: 9ch; text-align: right; font-variant-numeric: tabular-nums; }
.lv-controls input[type=range] { width: 100%; accent-color: var(--accent); }
.lv-controls .btn { justify-self: start; }
.lv-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.lv-legend .sw { display: inline-block; width: 22px; height: 8px; vertical-align: middle; margin-right: 6px; }
@media (max-width: 600px) { .lv-stage { aspect-ratio: 1 / 1; } .lv-dro { padding: 6px 8px; gap: 4px; } .lv-axes b { font-size: 12px; } .lv-dro code { display: none; } .lv-controls { grid-template-columns: 1fr auto; } .lv-controls label { grid-column: 1 / -1; margin-bottom: -6px; } .lv-axes { grid-template-columns: repeat(2, auto); } }

.press { margin: 0; border-top: 1.5px solid var(--ink); padding-top: 14px; }
.press p { font-family: var(--display); text-transform: uppercase; font-size: 24px; line-height: 1.15; margin: 0 0 8px; }
.fusion { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.fusion iframe { width: 100%; aspect-ratio: 4 / 3; border: 1.5px solid var(--ink); background: #fff; }

.bench { margin: 40px 0 0; border: 1px dashed var(--ink); padding: 16px 20px; }
.bench h3 { margin: 0 0 8px; }
.bench ul { margin: 0; padding-left: 18px; font-family: var(--text); font-size: 14px; line-height: 1.7; }

/* ---------- 02 Work with me ---------- */
.work, .bg, .contact { padding-top: 96px; }
.lede { font-size: clamp(17px, 1.8vw, 21px); max-width: 680px; margin: 20px 0 28px; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.svc { border: 1.5px solid var(--ink); background: rgba(239, 231, 215, .85); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.svc h3 { font-size: 26px; margin: 0; line-height: 1; text-wrap: balance; }
.svc p { font-size: 14.5px; color: #2b2e2f; }

/* JO-03: a mock order sheet scrolls past a scanner line. */
.scan { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--ink); background: #fbf7ee; overflow: hidden; }
.sheet { position: absolute; left: 0; right: 0; top: 0; font-size: 11px; }
.sheet .ln { display: grid; grid-template-columns: 2.2em 1fr 1fr 2.2em; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--faint); }
.sheet .ln.bad { color: var(--accent); background: rgba(180, 61, 40, .08); }
.sheet .ln.bad::after { content: "Mismatch"; grid-column: 1 / -1; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.beam { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--accent); }
.flags { position: absolute; right: 8px; top: 8px; background: var(--ink); color: var(--paper); padding: 4px 8px; }
.flags b { color: #ff9a85; }

.studio-note { font-family: var(--text); font-size: 15px; color: var(--muted); margin: 22px 0 0; }


/* ---------- 03 Background ---------- */
.bg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 28px; }
.bio { font-size: 16px; margin-bottom: 14px; }
.langs { color: var(--muted); }
/* Timeline drawn as a dimension line that grows with scroll; JS sets --grow. */
.timeline { --grow: 1; list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: grid; gap: 26px; font-family: var(--text); font-size: 15px; line-height: 1.45; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 1.5px; background: var(--ink); transform-origin: top; transform: scaleY(var(--grow)); }
.timeline li { position: relative; display: grid; gap: 4px; transition: opacity .5s, transform .5s; }
.timeline li::before { content: ""; position: absolute; left: -27px; top: 4px; width: 13px; height: 1.5px; background: var(--ink); }
.timeline li.wait { opacity: 0; transform: translateX(-8px); }
.timeline .mono { color: var(--accent); }
.tools { list-style: none; padding: 0; margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tools li { border: 1px solid var(--ink); padding: 6px 10px; }

/* ---------- 04 Contact ---------- */
.invites { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.invite { border: 1.5px solid var(--ink); padding: 24px; display: grid; gap: 14px; align-content: start; justify-items: start; background: rgba(239, 231, 215, .85); }
.invite h3 { font-size: 34px; margin: 0; line-height: 1; }
.invite p { font-family: var(--text); margin: 0; line-height: 1.5; }
.contact-links { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 80px; padding-bottom: 32px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .services, .bg-grid, .invites, .jo05-more { grid-template-columns: 1fr; }
  .section-head .hint { display: none; }
}
@media (max-width: 640px) {
  .tb { display: none; }
  .nav-sound { display: inline-block; }
  .scrub-cap span:last-child { display: none; }
}

/* ---------- Reduced motion: final states, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .section-head.draw::before { transform: none; }
  .scrub { height: auto; }
  .scrub-stage { position: static; height: auto; padding: 24px var(--gutter); }
  .timeline li.wait { opacity: 1; transform: none; }
}

/* Project form */
.project-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.project-form .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.field input, .field select, .field textarea { font: 15px/1.4 var(--text); color: var(--ink); background: #fbf7ee; border: 1.5px solid var(--ink); border-radius: 0; padding: 10px 12px; width: 100%; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.field [aria-invalid="true"] { border-color: var(--accent); background: #fbeee9; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-status { font-family: var(--text); font-size: 14px; margin: 0; }
.form-status.ok { color: #2f6b45; }
.form-status.err { color: var(--accent); }
.form-alt { font-size: 13.5px; color: var(--muted); }
.mono-inline { font-family: var(--mono); }
.invite#start { grid-column: 1 / -1; }
@media (max-width: 640px) { .project-form { grid-template-columns: 1fr; } }

/* Longer annotation lines stay mono but in sentence case so they read easily. */
.plain { text-transform: none; letter-spacing: .04em; font-weight: 400; font-size: 12px; }
