/* ==========================================================================
   NYU Makerspace — CNC Equipment Catalog
   Theme: "Design Lab Violet" — NYU violet + white, drafting-studio details
   ========================================================================== */
:root {
  --bg: #fffffe;
  --bg-2: #f4effa;
  --panel: #ffffff;
  --line: #e2d9ee;
  --ink: #201530;
  --muted: #766a89;
  --violet: #57068c;
  --violet-deep: #370657;
  --violet-tint: rgba(87, 6, 140, 0.08);
  --violet-tint-strong: rgba(87, 6, 140, 0.14);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --disp: "Fraunces", "Iowan Old Style", serif;
  --body: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 1.5px 1.5px, rgba(87, 6, 140, 0.14) 1.5px, transparent 0);
  background-size: 26px 26px;
  overflow-x: hidden;
  position: relative;
}

/* soft violet wash behind the very top of the page, like a studio wall wash */
body::before {
  content: "";
  position: fixed;
  top: -20vh; left: 50%; transform: translateX(-50%);
  width: 140vw; height: 60vh;
  background: radial-gradient(ellipse at center, rgba(87, 6, 140, 0.10), transparent 70%);
  pointer-events: none; z-index: 0;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: 0.025; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app { position: relative; z-index: 1; }

.page { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }

/* ---- Breadcrumbs + back button ---------------------------------------------- */
.crumbrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 18px 0 6px;
}
.crumbs {
  display: flex; flex-wrap: wrap; gap: 2px; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted);
}
/* Padding + matching negative margin grows the tap target to ~35px without
   visually inflating the breadcrumb row's height (thumb targets on mobile). */
.crumbs a {
  padding: 9px 5px; margin: -9px -5px; border-radius: 6px; display: inline-block;
}
.crumbs a:hover { color: var(--violet); background: var(--violet-tint); }
.crumbs__sep { color: var(--line); margin: 0 2px; }
.crumbs__here { color: var(--violet); font-weight: 600; padding: 9px 5px; margin: -9px -5px; display: inline-block; }

.backbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--violet-deep); background: var(--violet-tint);
  border: 1.5px solid var(--violet-tint-strong); border-radius: 999px;
  padding: 10px 16px 10px 12px; transition: all 0.15s ease; flex: none;
}
.backbtn:hover { color: #fff; background: var(--violet); border-color: var(--violet); }
.backbtn svg { flex: none; }

/* ---- Machine switcher (on machine hub) --------------------------------------- */
.switcher { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.switcher__label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 12px;
}
.switcher__chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 22px 24px 12px; position: relative; z-index: 1; }
.hero--tight { padding-bottom: 4px; }
.hero__bar {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--muted);
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.hero__home {
  transition: color 0.15s ease; display: inline-block;
  padding: 10px 6px; margin: -10px -6px; border-radius: 6px;
}
.hero__home:hover { color: var(--violet); }
.hero__status { display: inline-flex; align-items: center; gap: 8px; color: var(--violet); font-weight: 600; }
.hero__status i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--violet);
  box-shadow: 0 0 0 0 rgba(87, 6, 140, 0.5); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(87,6,140,0.45); }
  70% { box-shadow: 0 0 0 9px rgba(87,6,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(87,6,140,0); }
}

.hero__main { padding: 34px 0 24px; }
.hero__main--sub { padding: 12px 0 18px; }
.hero__eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em; color: var(--violet);
  margin-bottom: 14px; font-weight: 600;
}
.hero h1 {
  font-family: var(--disp); font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(48px, 11vw, 118px); line-height: 0.92;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 22px;
}
.hero h1 span {
  color: var(--bg); -webkit-text-stroke: 1.5px var(--violet);
  paint-order: stroke fill; font-style: italic;
}
.h1--sub { font-size: clamp(34px, 6.5vw, 60px); }
.h1--cat {
  font-family: var(--disp); font-weight: 700; font-style: italic; font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.01em; margin: 4px 0 18px; color: var(--violet-deep);
}
.hero__sub { max-width: 620px; margin-top: 20px; color: var(--muted); font-size: 15px; }

/* ---- Good to know (machine spec callout) ----------------------------------- */
.goodtoknow {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--violet-tint); border: 1.5px solid var(--violet-tint-strong);
  border-radius: var(--radius); padding: 18px 22px; margin: 14px 0 28px;
}
.goodtoknow__icon { width: 20px; height: 20px; color: var(--violet); flex: none; margin-top: 1px; }
.goodtoknow__body { flex: 1; min-width: 0; }
.goodtoknow__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; font-weight: 600;
  color: var(--violet-deep); text-transform: uppercase; margin-bottom: 10px;
}
.goodtoknow__grid { display: flex; flex-wrap: wrap; gap: 8px 30px; }
.goodtoknow__grid > div { display: flex; align-items: baseline; gap: 7px; }
.goodtoknow__grid dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }
.goodtoknow__grid dd { font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* ---- Controls ------------------------------------------------------------ */
.controls {
  max-width: 1180px; margin: 0 auto; padding: 18px 0;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.controls--static { position: static; background: none; }
.search {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0 18px; height: 46px;
}
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input {
  flex: 1; height: 100%; background: none; border: 0; color: var(--ink);
  font-family: var(--body); font-size: 14px; outline: none;
}
.search input::placeholder { color: var(--muted); }

/* ---- Per-machine local search dropdown ------------------------------------- */
.searchwrap { position: relative; flex: 1; min-width: 220px; }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 32px -18px rgba(87, 6, 140, 0.35);
  overflow: hidden;
}
.dropdown:empty { display: none; border: none; box-shadow: none; }
.dropdown__row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 13px 18px; font-family: var(--body); font-size: 13.5px; color: var(--ink);
  border-bottom: 1px solid var(--line); transition: background 0.12s ease;
}
.dropdown__row:last-child { border-bottom: none; }
.dropdown__row:hover { background: var(--violet-tint); }
.dropdown__name { font-weight: 500; }
.dropdown__cat {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--muted);
  text-transform: uppercase; flex: none;
}
.dropdown__row--global {
  font-style: italic; color: var(--violet-deep); font-size: 13px;
}
.dropdown__row--global strong { font-style: normal; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em;
  color: var(--violet-deep); background: var(--violet-tint); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 9px 16px; cursor: pointer;
  transition: all 0.15s ease; display: inline-block;
}
.chip:hover { color: #fff; background: var(--violet); border-color: var(--violet); }
.chip--on { color: #fff; background: var(--violet); border-color: var(--violet); font-weight: 600; }
.chip--lg { padding: 15px 24px; font-size: 14px; border-radius: 10px; border-width: 1.5px; }
.chip--lg:hover { color: #fff; background: var(--violet); border-color: var(--violet); }

/* ---- Machine cards (home) -------------------------------------------------- */
.mgrid {
  display: grid; gap: 20px; padding-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.mcard {
  display: block; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: rise 0.5s both; animation-delay: calc(var(--i) * 70ms);
  box-shadow: 0 1px 2px rgba(32, 21, 48, 0.04);
}
.mcard:hover {
  transform: translateY(-5px); border-color: var(--violet);
  box-shadow: 0 18px 36px -18px rgba(87, 6, 140, 0.35), 0 0 0 1px var(--violet-tint);
}
.mcard__img { position: relative; aspect-ratio: 16 / 10; background: var(--bg-2); }
.mcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard__body { padding: 20px 22px 24px; }
.mcard__body h2 { font-family: var(--disp); font-weight: 700; font-size: 25px; letter-spacing: -0.01em; color: var(--violet-deep); }
.mcard__body p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* ---- Category cards (machine hub) ------------------------------------------ */
.cgrid {
  display: grid; gap: 14px; padding-top: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.ccard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; transition: all 0.18s ease;
  animation: rise 0.45s both; animation-delay: calc(var(--i) * 60ms);
  box-shadow: 0 1px 2px rgba(32, 21, 48, 0.04);
}
.ccard:hover { border-color: var(--violet); transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(87,6,140,0.35); }
.ccard__icon { width: 38px; height: 38px; color: var(--violet); }
.ccard__icon svg { width: 100%; height: 100%; }
.ccard h3 { font-family: var(--disp); font-weight: 700; font-size: 18px; color: var(--ink); }
.ccard__count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }

/* ---- Grid (equipment cards) ------------------------------------------------ */
.grid {
  padding: 12px 0 40px;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.card {
  display: block; background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; outline: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: rise 0.5s both; animation-delay: calc(var(--i) * 45ms);
  box-shadow: 0 1px 2px rgba(32, 21, 48, 0.04);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card:hover, .card:focus-visible {
  transform: translateY(-4px); border-color: var(--violet);
  box-shadow: 0 16px 32px -18px rgba(87, 6, 140, 0.35), 0 0 0 1px var(--violet-tint);
}
.card__img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.card:hover .card__img img { transform: scale(1.05); }
.card__code {
  position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--violet); background: rgba(255,255,255,0.88); border: 1px solid var(--violet-tint-strong);
  padding: 3px 8px; border-radius: 999px;
}
.card__body { padding: 16px 17px 19px; }
.card__cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--violet); text-transform: uppercase; }
.card__name { font-family: var(--disp); font-weight: 700; font-size: 20px; margin: 8px 0 5px; letter-spacing: -0.01em; color: var(--ink); }
.card__tag { font-size: 12.5px; color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }
.empty a { color: var(--violet); }

/* ---- Faceted filter browser (End Mills / Turning Tools) -------------------- */
.fbar {
  display: flex; flex-direction: column; gap: 16px; padding: 18px 20px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  margin: 10px 0 18px;
}
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.frow__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted);
  text-transform: uppercase; flex: none; width: 78px;
}
.frow__chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--violet-deep);
  background: var(--violet-tint); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 12px; cursor: pointer; transition: all 0.15s ease;
}
.fchip:hover { border-color: var(--violet); }
.fchip--on { color: #fff; background: var(--violet); border-color: var(--violet); }
.fchip--off { color: var(--muted); background: transparent; opacity: 0.45; cursor: default; pointer-events: none; }
.fchip__count {
  font-size: 10px; min-width: 18px; text-align: center; padding: 2px 5px; border-radius: 999px;
  background: rgba(255,255,255,0.5); color: inherit;
}
.fchip--on .fchip__count { background: rgba(255,255,255,0.25); }
.fchip--off .fchip__count { background: transparent; }
.fclear {
  align-self: flex-start; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--violet); text-decoration: underline; text-underline-offset: 3px;
}
.fcount { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 14px; }

.fgroups { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.fgroup {
  display: flex; gap: 18px; background: var(--panel); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: 0 1px 2px rgba(32,21,48,0.04);
  animation: rise 0.4s both;
}
.fgroup__icon { width: 34px; height: 34px; color: var(--violet); flex: none; }
.fgroup__body { flex: 1; min-width: 0; }
.fgroup__body h3 {
  font-family: var(--disp); font-weight: 700; font-size: 19px; color: var(--violet-deep);
  letter-spacing: -0.01em;
}
.fgroup__tag { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.fgroup__badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.fbadge {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px;
}
.fgroup__notes { font-size: 13px; color: #4a3d5c; line-height: 1.6; }

@media (max-width: 640px) {
  .frow { flex-direction: column; align-items: flex-start; gap: 8px; }
  .frow__label { width: auto; }
  .fgroup { flex-direction: column; }
}

/* ---- Footer -------------------------------------------------------------- */
.foot {
  max-width: 1180px; margin: 0 auto; padding: 26px 24px 48px;
  border-top: 1px solid var(--line); display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted);
}

/* ---- Detail panel (inline, not a modal) ------------------------------------ */
.detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--panel); border: 1.5px solid var(--violet-tint-strong); border-radius: var(--radius);
  overflow: hidden; animation: pop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(32, 21, 48, 0.04);
}
@keyframes pop { from { transform: translateY(14px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.detail__img { position: relative; background: var(--bg-2); aspect-ratio: 1; }
.detail__img img { width: 100%; height: 100%; object-fit: cover; }
.detail__info { padding: 36px 32px; }
.detail__info h2 { font-family: var(--disp); font-weight: 700; font-size: 34px; letter-spacing: -0.01em; margin: 8px 0 6px; line-height: 1.05; color: var(--violet-deep); }
.modal__tag { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.guidebtn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  color: #fff; background: var(--violet); border: 1.5px solid var(--violet);
  border-radius: 999px; padding: 9px 16px 9px 13px; margin-bottom: 20px;
  transition: all 0.15s ease;
}
.guidebtn:hover { background: var(--violet-deep); border-color: var(--violet-deep); }
.guidebtn svg { flex: none; }
.guidebtn--off {
  color: var(--muted); background: var(--violet-tint); border-color: var(--line);
  cursor: default; pointer-events: none;
}
.spec { border-top: 1px solid var(--line); margin-bottom: 24px; }
.spec > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }
.spec dt { color: var(--muted); letter-spacing: 0.03em; }
.spec dd { color: var(--ink); text-align: right; font-weight: 500; }
.modal__notes { font-size: 14px; color: #4a3d5c; line-height: 1.65; }

@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; }
  .detail__img { aspect-ratio: 16 / 10; }
  .goodtoknow__grid { gap: 8px 20px; }
}
