/* scottrodman.com: published from public/ by Workers Builds */
:root {
  --ink: #f6f1e7;
  --ink-soft: rgba(246,241,231,0.72);
  --accent: #e8a552;
  --panel: rgba(18, 16, 12, 0.55);
  --panel-strong: rgba(14, 12, 9, 0.72);
  --border: rgba(246,241,231,0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0906;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- background scene ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  transform: scale(1) translate(0%, 0%);
  transition: transform 1.7s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

/* Fixed transform-origin (0 0) is what makes this animate as a true
   pan and zoom instead of a jump: transform-origin itself can't be
   transitioned, so it must never change. Only scale/translate do.
   The background stays static at rest (no idle motion). Every
   change to `transform` is driven by this one transition, so
   retargeting mid-zoom (clicking a new menu item before the previous
   zoom finishes) redirects smoothly instead of jumping. */

.scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.45) 100%);
  transition: opacity 0.8s ease;
}
.scene-select + .scrim { background: radial-gradient(ellipse at 68% 50%, rgba(0,0,0,0.15) 0%, rgba(5,4,3,0.72) 62%); }

/* ---------- brand / menu toggle ---------- */

.brand {
  position: fixed;
  top: 28px;
  left: 28px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand button.monogram {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
}
.brand button.monogram:hover { background: var(--panel-strong); transform: scale(1.04); }

/* The name tag stands in for the headline once the headline is hidden
   (a section is open), so the name is always on screen exactly once. */
.brand .name-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}
body.section-open .name-tag { opacity: 1; transform: translateX(0); }

/* ---------- slide-out menu ---------- */

/* visibility (not just opacity) keeps the hidden menu out of the
   keyboard tab order. It flips after the fade-out, and before the fade-in. */
.menu {
  position: fixed;
  top: 96px;
  left: 28px;
  z-index: 25;
  width: 230px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}
body.menu-open .menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

.menu ul { list-style: none; margin: 0; padding: 0; }

.menu a {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-size: 1.02rem;
  padding: 12px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}
.menu a:hover { background: rgba(255,255,255,0.06); }
.menu a[aria-current="true"] { background: rgba(232,165,82,0.12); color: var(--accent); }

.menu a .idx {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.menu a[aria-current="true"] .idx { color: var(--accent); }

/* ---------- content card ---------- */

.card {
  position: fixed;
  top: 50%;
  right: 6vw;
  transform: translateY(-50%) translateX(24px);
  width: min(420px, 86vw);
  /* 170px keeps clearance above/below so the card never grows tall
     enough to collide with the SR monogram on short/mobile screens.
     min() lets it use up to 92vh on tall desktop windows instead. */
  max-height: min(92vh, calc(100vh - 170px));
  overflow-y: auto;
  background: var(--panel-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 30px;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease 0.25s, transform 0.55s ease 0.25s, visibility 0s linear 0.8s;
}
body.section-open .card {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  transition: opacity 0.55s ease 0.25s, transform 0.55s ease 0.25s, visibility 0s;
}

.card article[hidden] { display: none; }

.card .eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.15;
}
.card h2:focus { outline: none; }

.card p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.card ul {
  margin: 0 0 14px;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.card ul li { margin-bottom: 6px; }

.card a.linkedin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b0906;
  background: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  transition: filter 0.2s ease;
}
.card a.linkedin:hover { filter: brightness(1.08); }

.card .close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .close:hover { color: var(--ink); background: rgba(255,255,255,0.08); }

/* ---------- headline ---------- */

/* Visible on first load and while the menu is open. Hidden only while a
   section card is open (the card and the name tag take over then). */
.headline {
  position: fixed;
  left: 28px;
  bottom: 40px;
  z-index: 15;
  max-width: 60vw;
  text-shadow: 0 1px 14px rgba(0,0,0,0.55);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
body.section-open .headline {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.headline h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 6px;
}
.headline p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

@media (max-width: 640px) {
  .headline { max-width: calc(100vw - 56px); }
}

/* Short landscape screens: the open menu and the headline would touch. */
@media (max-height: 480px) {
  body.menu-open .headline { opacity: 0; pointer-events: none; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .scene img { transition: none; }
  .menu, .card, .headline, .name-tag, .scrim { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
