/* marckrebslegacy.com — "the gunsmith's bench"
   Deep walnut & charcoal, brass engraving accents, editorial serif. */

:root {
  --bg: #16120e;
  --bg-2: #1d1813;
  --panel: #211b15;
  --panel-2: #262019;
  --ink: #ede3d0;
  --ink-dim: #b5a892;
  --ink-faint: #857a67;
  --brass: #c8a35a;
  --brass-bright: #e6c47c;
  --brass-dim: rgba(200, 163, 90, 0.35);
  --hairline: rgba(200, 163, 90, 0.22);
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.075rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--brass); color: #17130d; }

a { color: var(--brass-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* ------------------------------ nav ------------------------------ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(to bottom, rgba(18, 14, 10, 0.92), rgba(18, 14, 10, 0));
  transition: background 0.4s;
}
.nav.scrolled {
  background: rgba(18, 14, 10, 0.94);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
}
.nav-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-name span { color: var(--brass); }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-family: var(--body);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--brass-bright); text-decoration: none; }

/* ------------------------------ hero ------------------------------ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(200, 163, 90, 0.10), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(120, 84, 40, 0.12), transparent 60%),
    linear-gradient(180deg, #14100c 0%, var(--bg) 100%);
}
/* fine machined lines */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 5px,
    rgba(237, 227, 208, 0.012) 6px
  );
}

.hero-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 30px;
  animation: rise 1.2s var(--ease) both;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.2rem, 9.5vw, 7rem);
  line-height: 1.02;
  letter-spacing: 0.015em;
  color: var(--ink);
  animation: rise 1.2s var(--ease) 0.15s both;
}

.hero-dates {
  margin-top: 26px;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-style: italic;
  color: var(--ink-dim);
  animation: rise 1.2s var(--ease) 0.3s both;
}

.hero-role {
  margin-top: 14px;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  animation: rise 1.2s var(--ease) 0.42s both;
}

.hero-rule {
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  margin: 38px auto 0;
  animation: rise 1.2s var(--ease) 0.55s both;
}

.hero-epigraph {
  margin-top: 36px;
  max-width: 560px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--ink-dim);
  animation: rise 1.2s var(--ease) 0.68s both;
}

.hero-cta {
  margin-top: 48px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  animation: rise 1.2s var(--ease) 0.8s both;
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-faint);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: fade 2s 1.6s both;
}
.hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 34px;
  margin: 10px auto 0;
  background: linear-gradient(var(--brass-dim), transparent);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------ buttons ------------------------------ */

.btn {
  display: inline-block;
  font-family: var(--body);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 15px 34px;
  border: 1px solid var(--brass-dim);
  color: var(--brass-bright);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.btn:hover {
  background: rgba(200, 163, 90, 0.1);
  border-color: var(--brass);
  text-decoration: none;
  transform: translateY(-2px);
}
.btn-solid {
  background: var(--brass);
  color: #17130d;
  border-color: var(--brass);
  font-weight: 600;
}
.btn-solid:hover { background: var(--brass-bright); border-color: var(--brass-bright); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ------------------------------ sections ------------------------------ */

section { padding: 110px 0; position: relative; }

.sec-label {
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 18px;
}

.sec-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  margin-bottom: 34px;
}

.ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  color: var(--brass-dim);
}
.ornament::before, .ornament::after {
  content: "";
  height: 1px;
  width: 46px;
  background: var(--brass-dim);
}
.ornament svg { flex: none; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------ story ------------------------------ */

.story-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 70px;
  align-items: start;
}

.story-text p { margin-bottom: 1.4em; color: var(--ink-dim); }
.story-text p strong { color: var(--ink); font-weight: 600; }

.story-text .lede {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.55;
  color: var(--ink);
}
.story-text .lede::first-letter {
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding: 6px 12px 0 0;
  color: var(--brass);
  font-family: var(--serif);
}

.story-aside {
  border: 1px solid var(--hairline);
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  padding: 40px 36px;
  position: sticky;
  top: 100px;
}
.story-aside h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--brass-bright);
}
.story-aside ul { list-style: none; }
.story-aside li {
  padding: 13px 0;
  border-bottom: 1px solid rgba(237, 227, 208, 0.07);
  font-size: 0.98rem;
  color: var(--ink-dim);
  display: flex;
  gap: 12px;
}
.story-aside li:last-child { border-bottom: none; }
.story-aside li::before { content: "—"; color: var(--brass); flex: none; }

/* ------------------------------ quote band ------------------------------ */

.quote-band {
  padding: 90px 0;
  background:
    radial-gradient(800px 400px at 50% 50%, rgba(200, 163, 90, 0.07), transparent 70%),
    var(--bg-2);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-align: center;
}
.quote-band blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem);
  line-height: 1.45;
  max-width: 820px;
  margin: 0 auto;
  color: var(--ink);
}
.quote-band cite {
  display: block;
  margin-top: 26px;
  font-family: var(--body);
  font-style: normal;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ------------------------------ timeline ------------------------------ */

.timeline { position: relative; margin-top: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--brass-dim), rgba(200,163,90,0.08));
}
.tl-item { position: relative; padding: 0 0 44px 46px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border: 1px solid var(--brass);
  transform: rotate(45deg);
  background: var(--bg);
}
.tl-year {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--brass-bright);
  letter-spacing: 0.04em;
}
.tl-item p { color: var(--ink-dim); margin-top: 6px; max-width: 640px; }

/* ------------------------------ tribute wall ------------------------------ */

.wall-empty {
  border: 1px dashed var(--brass-dim);
  padding: 70px 30px;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
}

.wall {
  columns: 2;
  column-gap: 26px;
}
.wall-card {
  break-inside: avoid;
  margin-bottom: 26px;
  border: 1px solid var(--hairline);
  background: linear-gradient(165deg, var(--panel), var(--panel-2));
  padding: 30px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.wall-card:hover { border-color: var(--brass-dim); transform: translateY(-3px); }

.wall-media { display: grid; gap: 10px; margin-bottom: 20px; }
.wall-media img, .wall-media video {
  width: 100%;
  display: block;
  border: 1px solid rgba(237, 227, 208, 0.08);
  background: #000;
  cursor: pointer;
}
.wall-media video { cursor: default; }

.wall-msg {
  color: var(--ink-dim);
  font-size: 1.02rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.wall-msg::before { content: "“"; color: var(--brass); font-family: var(--serif); font-size: 1.4em; }
.wall-msg::after { content: "”"; color: var(--brass); font-family: var(--serif); font-size: 1.4em; }
.wall-msg.no-quotes::before, .wall-msg.no-quotes::after { content: ""; }

.wall-sig { margin-top: 18px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wall-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.wall-rel { font-size: 0.86rem; color: var(--ink-faint); font-style: italic; }
.wall-date { margin-left: auto; font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.08em; }

/* ------------------------------ share form ------------------------------ */

.share {
  background: var(--bg-2);
  border-top: 1px solid var(--hairline);
}
.share-box {
  max-width: 720px;
  margin: 0 auto;
}
.field { margin-bottom: 24px; }
.field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 10px;
}
.field input[type="text"], .field textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(237, 227, 208, 0.14);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  padding: 15px 17px;
  transition: border-color 0.25s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brass);
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.65; }

.dropzone {
  border: 1px dashed var(--brass-dim);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  color: var(--ink-faint);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brass);
  background: rgba(200, 163, 90, 0.05);
  color: var(--ink-dim);
}
.dropzone .dz-icon { color: var(--brass); margin-bottom: 12px; }
.dropzone p { font-family: var(--serif); font-size: 1.15rem; font-style: italic; }
.dropzone small { display: block; margin-top: 8px; font-size: 0.8rem; letter-spacing: 0.05em; }

.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(237, 227, 208, 0.1);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--ink-dim);
}
.file-chip .fc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fc-size { color: var(--ink-faint); font-size: 0.8rem; }
.file-chip button {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
}
.file-chip button:hover { color: #d9856a; }

.progress-wrap { display: none; margin-top: 20px; }
.progress-bar {
  height: 4px;
  background: rgba(237, 227, 208, 0.1);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brass), var(--brass-bright));
  transition: width 0.2s;
}
.progress-label { margin-top: 10px; font-size: 0.82rem; color: var(--ink-faint); letter-spacing: 0.1em; }

.form-note {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--ink-faint);
  font-style: italic;
}

.form-msg { margin-top: 22px; padding: 18px 22px; display: none; font-size: 0.98rem; }
.form-msg.ok {
  display: block;
  border: 1px solid rgba(140, 180, 120, 0.4);
  color: #c4d9b4;
  background: rgba(90, 130, 70, 0.08);
}
.form-msg.err {
  display: block;
  border: 1px solid rgba(210, 120, 90, 0.4);
  color: #e8bdaa;
  background: rgba(160, 70, 40, 0.08);
}

/* ------------------------------ lightbox ------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 8, 5, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border: 1px solid var(--hairline); }

/* ------------------------------ footer ------------------------------ */

footer {
  border-top: 1px solid var(--hairline);
  padding: 60px 0 50px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.9rem;
}
footer .foot-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
footer .foot-dates { font-style: italic; margin-bottom: 22px; }
footer a { color: var(--ink-faint); }

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 860px) {
  .nav-links { display: none; }
  .story-grid { grid-template-columns: 1fr; gap: 44px; }
  .story-aside { position: static; }
  .wall { columns: 1; }
  section { padding: 80px 0; }
}
