/* --------------------------------------------------------------------------
   Portfolio v2 — line-art storytelling, viewport scroll-snap (CSS only)
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --v2-ink: #141312;
  --v2-ink-soft: #3d3a36;
  --v2-paper: #f4f1eb;
  --v2-paper-warm: #ebe6dc;
  --v2-line: #1a1917;
  --v2-accent: #2d4a3e;
  --v2-focus: #1a5fb4;
  --v2-font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --v2-font-serif: "IBM Plex Serif", Georgia, serif;
  --v2-header-h: 3.5rem;
  --v2-rail-w: 2.75rem;
  --v2-foot-h: 2.25rem;
  --v2-pad: clamp(1rem, 4vw, 2rem);
  /* One “screen” inside the shell (header + footer + borders) */
  --v2-viewport: calc(100dvh - var(--v2-header-h) - var(--v2-foot-h) - 6px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html.v2-root {
  height: 100%;
  scroll-behavior: smooth;
}

body.v2-body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--v2-font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--v2-ink);
  background-color: var(--v2-paper);
  background-image:
    linear-gradient(var(--v2-paper-warm) 1px, transparent 1px),
    linear-gradient(90deg, var(--v2-paper-warm) 1px, transparent 1px);
  background-size: 24px 24px;
}

@media (prefers-reduced-motion: reduce) {
  html.v2-root {
    scroll-behavior: auto;
  }

  .v2-snap {
    scroll-snap-type: none;
  }

  .v2-panel {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }
}

.v2-body img {
  max-width: 100%;
  height: auto;
  display: block;
}

.v2-body a {
  color: var(--v2-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.v2-body a:hover {
  color: #1f342c;
}

.v2-body a:focus-visible {
  outline: 2px solid var(--v2-focus);
  outline-offset: 2px;
}

.v2-skip {
  position: absolute;
  left: var(--v2-pad);
  top: -100%;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--v2-paper);
  color: var(--v2-ink);
  font-weight: 600;
  border: 2px solid var(--v2-line);
  text-decoration: none;
}

.v2-skip:focus {
  top: 0.5rem;
}

/* Shell: one screen, inner scroll */

.v2-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
}

.v2-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--v2-header-h);
  padding: 0.5rem var(--v2-pad);
  border-bottom: 2px solid var(--v2-line);
  background: color-mix(in srgb, var(--v2-paper) 94%, transparent);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.v2-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--v2-ink);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.v2-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid var(--v2-line);
  border-radius: 50%;
  overflow: hidden;
  background: #fdfcfa;
}

.v2-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.v2-brand-text {
  font-family: var(--v2-font-serif);
}

.v2-back {
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--v2-ink-soft);
  border: 1px solid var(--v2-line);
  padding: 0.35rem 0.65rem;
  background: transparent;
}

.v2-back:hover {
  color: var(--v2-ink);
  background: var(--v2-paper-warm);
}

.v2-body-row {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

/* Chapter rail */

.v2-rail {
  flex-shrink: 0;
  width: var(--v2-rail-w);
  border-right: 2px solid var(--v2-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
  background: var(--v2-paper);
}

.v2-rail a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--v2-ink-soft);
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  line-height: 1;
}

.v2-rail a:hover {
  color: var(--v2-ink);
  background: var(--v2-paper-warm);
}

/* Scroll-snap viewport */

.v2-snap {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.v2-snap::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.v2-panel {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: var(--v2-viewport);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--v2-pad);
  padding-bottom: calc(var(--v2-pad) + 0.5rem);
  border-bottom: 1px solid color-mix(in srgb, var(--v2-line) 25%, transparent);
}

.v2-panel:last-of-type {
  border-bottom: none;
}

.v2-panel-inner {
  width: min(100%, 52rem);
  display: grid;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
}

@media (min-width: 48rem) {
  .v2-panel-inner {
    grid-template-columns: minmax(10rem, 14rem) 1fr;
  }

  .v2-panel-inner.v2-panel-wide-visual {
    grid-template-columns: minmax(12rem, 16rem) 1fr;
  }
}

/* Line-art frame around visuals */

.v2-visual {
  margin: 0;
  justify-self: center;
  max-width: 14rem;
}

@media (min-width: 48rem) {
  .v2-visual {
    justify-self: start;
  }
}

.v2-visual-frame {
  position: relative;
  padding: 0.75rem;
  border: 2px solid var(--v2-line);
  background: #fdfcfa;
  box-shadow: 4px 4px 0 0 var(--v2-line);
}

.v2-visual-frame::before,
.v2-visual-frame::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--v2-line);
  background: var(--v2-paper);
}

.v2-visual-frame::before {
  top: -6px;
  left: -6px;
  border-right: none;
  border-bottom: none;
}

.v2-visual-frame::after {
  bottom: -6px;
  right: -6px;
  border-left: none;
  border-top: none;
}

.v2-visual-frame img,
.v2-visual-frame svg {
  width: 100%;
  height: auto;
  display: block;
}

.v2-visual-caption {
  margin: 0.5rem 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--v2-ink-soft);
  text-align: center;
}

@media (min-width: 48rem) {
  .v2-visual-caption {
    text-align: left;
  }
}

/* Story copy */

.v2-chapter {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--v2-ink-soft);
}

.v2-title {
  margin: 0 0 0.75rem;
  font-family: var(--v2-font-serif);
  font-size: clamp(1.65rem, 4.2vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.v2-lede {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  color: var(--v2-ink-soft);
  max-width: 38rem;
}

.v2-prose {
  margin: 0;
  color: var(--v2-ink-soft);
  max-width: 38rem;
}

.v2-prose p {
  margin: 0 0 0.9rem;
}

.v2-prose p:last-child {
  margin-bottom: 0;
}

.v2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--v2-line);
  background: var(--v2-paper);
  color: var(--v2-ink);
}

.v2-btn:hover {
  background: var(--v2-paper-warm);
}

.v2-btn-primary {
  background: var(--v2-accent);
  color: #f4f1eb;
  border-color: var(--v2-line);
}

.v2-btn-primary:hover {
  background: #1f342c;
  color: #f4f1eb;
}

.v2-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.v2-tags li {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--v2-line);
  background: #fdfcfa;
}

.v2-list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--v2-ink-soft);
}

.v2-list li {
  margin-bottom: 0.45rem;
}

.v2-list li:last-child {
  margin-bottom: 0;
}

.v2-contact-line {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.v2-contact-line a {
  text-decoration: none;
}

.v2-contact-line a:hover {
  text-decoration: underline;
}

.v2-contact-links {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-weight: 600;
}

.v2-contact-links a {
  text-decoration: none;
}

.v2-contact-links a:hover {
  text-decoration: underline;
}

/* Footer bar */

.v2-foot {
  flex-shrink: 0;
  min-height: var(--v2-foot-h);
  padding: 0.35rem var(--v2-pad);
  border-top: 2px solid var(--v2-line);
  font-size: 0.7rem;
  color: var(--v2-ink-soft);
  text-align: center;
  background: var(--v2-paper-warm);
}

.v2-foot a {
  color: inherit;
  font-weight: 600;
}
