/* ===== ruins — handcrafted jewelry from old metal parts and hinges ===== */

:root {
  --bg: #0a0a0a;
  --panel: #0e0e0e;
  --ink: #c9c6c0;
  --ink-dim: #8a877f;
  --ink-faint: #67645c;
  --line: #2a2825;
  --line-soft: #1c1b18;
  --accent: #d8d4cc;
  --warn: #8a3b2e;
  --mono: "SFMono-Regular", "JetBrains Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #fff; }

img { display: block; max-width: 100%; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

/* ---- generic label / utility ---- */
.lbl { color: var(--ink-dim); text-transform: lowercase; }
.tag { color: var(--ink-faint); }
.hl { color: #fff; }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.up { text-transform: uppercase; letter-spacing: 0.18em; }

.sectionhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sectionhead .ttl { color: var(--ink-dim); }
.sectionhead .ttl b { color: var(--ink); font-weight: 400; }

.sectionhead .tag { min-width: 56px; text-align: right; }

/* big floating prev/next arrows on the sides of the selected panel */
.selarrow {
  position: absolute; top: 0;
  z-index: 6;
  width: 74px; min-height: 74px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  border: 1px solid var(--ink-faint);
  background: rgba(8,8,8,0.55);
  color: var(--accent);
  line-height: 1; padding: 10px 6px;
  cursor: pointer;
  backdrop-filter: blur(3px);
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.selarrow .ar { font-size: 30px; line-height: 1; }
.selarrow .lb { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.selarrow.prev { left: -86px; }
.selarrow.next { right: -86px; }
.selarrow:hover { background: var(--ink); color: #000; border-color: var(--ink); transform: scale(1.07); }
.selarrow:active { transform: scale(0.96); }

/* ===== top bar ===== */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px 14px;
  gap: 24px;
}
.brand {
  font-size: 40px;
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 500;
}
.brand .meta {
  display: block;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-top: 8px;
  font-weight: 400;
  text-transform: uppercase;
}
.tagline {
  flex: 1;
  color: var(--ink-dim);
  max-width: 360px;
  padding-top: 6px;
}
.cart {
  text-align: right;
  color: var(--ink-dim);
  white-space: nowrap;
  padding-top: 4px;
}
.cart b { color: #6aab6a; font-weight: 400; }

.wl-wrap { position: relative; margin-top: 8px; }
.wl-trigger {
  background: none; border: none; cursor: pointer;
  color: var(--ink-dim); font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.02em; padding: 0;
}
.wl-trigger:hover { color: #fff; }
.wl-trigger #wl-count { color: var(--ink); }
.wl-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 260px; background: var(--panel);
  border: 1px solid var(--line); z-index: 100; padding: 12px 14px;
}
.wl-drop ul { list-style: none; margin: 0; padding: 0; }
.wl-drop li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px dotted var(--line);
}
.wl-drop li:last-child { border-bottom: none; }
.wl-drop li span { color: var(--ink); font-size: 12px; }
.wl-code { color: var(--ink-faint) !important; margin-left: 6px; }
.wl-empty { color: var(--ink-faint); margin: 0; text-align: center; font-size: 12px; }
.wl-item-btn {
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--ink); font-family: var(--mono); font-size: 12px;
  padding: 0; flex: 1;
}
.wl-item-btn:hover { color: #fff; }
.wl-remove {
  background: none; border: none; cursor: pointer;
  color: var(--ink-faint); font-family: var(--mono); font-size: 11px;
  padding: 0 2px; flex-shrink: 0;
}
.wl-remove:hover { color: #fff; }

/* ===== main grid: sidebar + content ===== */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 16px 16px 28px;
  font-size: 11px;
}
.sidebar .block { margin-bottom: 26px; }
.sidebar .kv { color: var(--ink-faint); line-height: 1.7; }
.sidebar .kv b { color: var(--ink-dim); font-weight: 400; }

.nav h4, .sidebar h4 {
  margin: 0 0 10px;
  font-weight: 400;
  color: var(--ink-dim);
}
.nav ul { list-style: none; margin: 0 0 14px; padding: 0; }
.nav li { padding: 3px 0; }
.nav li a { display: flex; justify-content: space-between; color: var(--ink); }
.nav li a::before { content: "›"; color: var(--ink-faint); margin-right: 8px; }
.nav li a span { color: var(--ink-faint); }
.nav li a:hover { color: #fff; }
.nav .divider { height: 1px; background: var(--line-soft); margin: 12px 0; }

.viewarchive {
  display: block;
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: center;
  color: var(--ink);
  margin-bottom: 26px;
  transition: background .15s;
}
.viewarchive:hover { background: #161412; color: #fff; }

.creed { color: var(--ink-faint); line-height: 1.7; }
.creed p { margin: 0 0 9px; }

.mark { color: var(--ink-faint); font-size: 16px; margin-bottom: 12px; }

/* ===== content ===== */
.content { min-width: 0; }

/* hero */
.hero { position: relative; border-bottom: 1px solid var(--line); }
.hero img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(0.35) contrast(1.05) brightness(0.82);
}
.hero .frame {
  position: absolute; inset: 14px;
  border: 1px solid rgba(201,198,192,0.18);
  pointer-events: none;
}
.hero .enter {
  position: absolute; left: 24px; bottom: 24px;
  border: 1px solid var(--ink-dim);
  background: rgba(8,8,8,0.6);
  padding: 9px 16px;
  color: var(--accent);
  backdrop-filter: blur(2px);
}
.hero .enter:hover { background: #000; color:#fff; }
.hero .warn {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -68%);
  text-align: center; color: var(--accent); max-width: 260px;
  font-size: 14px;
  background: rgba(8,8,8,0.5);
  border: 1px solid rgba(201,198,192,0.18);
  padding: 15px 22px;
  backdrop-filter: blur(2px);
}
.hero .warn .dot { color: var(--warn); }
.hero .crosshair {
  position: absolute; right: 22px; bottom: 22px;
  color: var(--ink-faint); font-size: 16px; line-height: 1;
}

/* constructs grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.card {
  position: relative;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.card-add {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 22px; height: 22px;
  background: rgba(8,8,8,0.75); border: 1px solid var(--line);
  color: var(--ink-faint); font-size: 15px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); padding: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.card-add:hover { background: var(--ink); color: #000; border-color: var(--ink); }
.card-add.added { color: var(--ink); border-color: var(--ink-dim); }
.card:nth-child(4n) { border-right: none; }
.card .num { color: var(--ink-faint); margin-bottom: 8px; }
.card .ph {
  background: #060606;
  border: 1px solid var(--line-soft);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.card .ph img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.4) contrast(1.05) brightness(0.86);
  transition: transform .4s ease, filter .4s ease;
}
.card:hover .ph img { transform: scale(1.05); filter: grayscale(0) contrast(1.1) brightness(1); }
/* zoom all the way out so the full piece (incl. the coiled "snake") shows */
.card .ph img.fit-snake { object-fit: contain; object-position: center bottom; }
.card .name { margin-top: 10px; color: var(--ink); }
.card .code { color: var(--ink-faint); }

/* selected / featured */
.selected {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.selected .col {
  padding: 20px 18px;
  transition: opacity .2s ease, transform .2s ease;
}
.selected .col.left {
  display: flex; flex-direction: column;
}
.selected.swapping .col { opacity: 0; }
.selected .col.left { border-right: 1px solid var(--line); }
.selected .feat-img {
  position: relative;
  border: 1px solid var(--line-soft);
  background: #060606;
  overflow: hidden;
  margin-bottom: 16px;
}
.selected .feat-img img {
  width: 100%; height: auto; display: block;
  filter: grayscale(0.3) contrast(1.05) brightness(0.85);
  transition: opacity .15s ease;
}

/* small arrows inside the photo, for pieces with more than one image */
.imgarrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 34px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(201,198,192,0.25);
  background: rgba(8,8,8,0.5);
  color: var(--accent);
  font-size: 24px; line-height: 1; padding-bottom: 3px;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background .15s, color .15s;
}
.imgarrow.prev { left: 10px; }
.imgarrow.next { right: 10px; }
.imgarrow:hover { background: var(--ink); color: #000; }
.imgcount {
  position: absolute; bottom: 10px; right: 10px; z-index: 3;
  background: rgba(8,8,8,0.55);
  border: 1px solid rgba(201,198,192,0.2);
  color: var(--accent);
  padding: 3px 8px; letter-spacing: 0.06em;
  backdrop-filter: blur(2px);
}
.spec { list-style: none; margin: 0; padding: 0; }
.spec li {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px dotted var(--line);
}
.spec li span:first-child { color: var(--ink-dim); }
.spec li span:last-child { color: var(--ink); text-align: right; }

.featblock { margin-top: 18px; }
.featblock h6 { margin: 0 0 6px; font-weight: 400; color: var(--ink-dim); }
.featblock p { margin: 0; color: var(--ink); font-size: 15px; }
.featblock .matlist { margin: 4px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink); }
.featblock .matlist li::before { color: var(--ink); }

.feat-title {
  color: var(--ink); margin: 0 0 4px; font-size: 13px; font-weight: 400;
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
}
.feat-code { color: var(--ink-faint); white-space: nowrap; }
.feat-sub { color: var(--ink-faint); margin: 0 0 16px; }

.bullets { margin: 14px 0; padding-left: 0; list-style: none; color: var(--ink-dim); }
.bullets li { padding: 2px 0; }
.bullets li::before { content: "—"; color: var(--ink-faint); margin-right: 8px; }

.price-row {
  display: flex; align-items: baseline; gap: 10px;
  margin: 18px 0 14px;
}
.price-row .price { font-size: 20px; color: #fff; }
.price-row .unit { color: var(--ink-faint); }

.actions { display: flex; gap: 10px; }
.btn {
  flex: 1; text-align: center;
  border: 1px solid var(--ink-dim);
  padding: 11px 12px; color: var(--accent);
  background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: #000; }
.btn.ghost { border-color: var(--line); color: var(--ink-dim); }
.btn.ghost:hover { background: #161412; color: #fff; }

/* diagrams */
.diagrams h5 {
  margin: 4px 0 8px; font-weight: 400; color: var(--ink-dim);
}
.diagram {
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(0deg, rgba(255,255,255,0.015), rgba(255,255,255,0.015)),
    #070707;
  padding: 14px; margin-bottom: 16px;
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram .cap { color: var(--ink-faint); margin-top: 8px; }
.specsheet {
  display: inline-block; border: 1px solid var(--line);
  padding: 8px 14px; color: var(--ink-dim); margin-top: 4px;
}
.specsheet:hover { background:#161412; color:#fff; }

/* origin / process */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}
.step { border-right: 1px solid var(--line); padding: 14px; }
.step:last-child { border-right: none; }
.step .stepnum { color: var(--ink-faint); margin-bottom: 8px; }
.step .stepnum b { color: var(--ink); font-weight: 400; }
.step .ph {
  background:#060606; border:1px solid var(--line-soft);
  aspect-ratio: 3/4; overflow:hidden;
}
.step .ph img {
  width:100%; height:100%; object-fit:cover;
  filter: grayscale(0.55) contrast(1.05) brightness(0.8);
}
.step h6 { margin: 10px 0 4px; font-weight: 400; color: var(--ink); }
.step p { margin: 0; color: var(--ink-faint); }

.origin-note {
  padding: 18px; color: var(--ink);
  border-bottom: 1px solid var(--line);
  display:flex; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.origin-note p { margin:0; max-width: 420px; }

/* ===== footer ===== */
.footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.footer .fcol { padding: 22px 18px; border-right: 1px solid var(--line); }
.footer .fcol:last-child { border-right: none; }
.footer h4 { margin: 0 0 12px; font-weight: 400; color: var(--ink-dim); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 3px 0; }
.footer .brandfoot { font-size: 26px; color: var(--accent); letter-spacing: 0.04em; }
.footer .legal { color: var(--ink-faint); line-height: 1.7; margin-top: 14px; }

.subbar {
  display:flex; justify-content:center;
  padding: 16px 18px; color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* ===== contact ===== */
.contact-lead {
  font-size: 16px; line-height: 1.6; color: var(--ink);
  margin: 0 0 22px;
}
.contact-email {
  display: inline-block; font-size: 18px; color: var(--accent);
  border-bottom: 1px solid var(--ink-faint); padding-bottom: 3px;
}
.contact-email:hover { border-color: #fff; }

.cform { display: grid; gap: 12px; }
.cform label { display: block; color: var(--ink-dim); margin-bottom: 6px; }
.cform input,
.cform textarea {
  width: 100%; background: #060606; border: 1px solid var(--line);
  color: var(--ink); font-family: var(--mono); font-size: 12px;
  padding: 10px 12px; resize: vertical;
}
.cform input:focus,
.cform textarea:focus { outline: none; border-color: var(--ink-dim); }
.cform .btn { flex: 0 0 auto; justify-self: start; padding: 11px 22px; }

/* ===== responsive ===== */
/* not enough room in the page margin to float the arrows fully outside,
   so tuck them just inside the panel edges */
@media (max-width: 1360px) {
  .selarrow.prev { left: 12px; }
  .selarrow.next { right: 12px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line);
    display:grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(4n) { border-right: 1px solid var(--line); }
  .card:nth-child(2n) { border-right: none; }
  .selected { grid-template-columns: 1fr; }
  .selected .col.left { border-right: none; border-bottom:1px solid var(--line); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .footer { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .topbar { flex-direction: column; gap: 12px; }
  .grid { grid-template-columns: 1fr; }
  .card { border-right: none !important; }
  .process { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr; }
  .brand { font-size: 34px; }
}
