/* Adam Battenfield — Portfolio shared tokens */

:root {
  /* Palette: Obsidian (default) */
  --bg:        #0d0d0d;
  --surface:   #141414;
  --surface-2: #1c1c1c;
  --fg:        #ededed;
  --muted:     #8a8a8a;
  --dim:       #3a3a3a;
  --border:    #262626;
  --accent:    #d4a657;
  --accent-2:  #e7c07a;

  --font-sans: 'Schibsted Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

[data-palette="graphite"] {
  --bg: #0f1012; --surface: #16181c; --surface-2: #1d2026;
  --fg: #e8ebee; --muted: #8a8f96; --dim: #34383f; --border: #262a30;
  --accent: #9ec5ff; --accent-2: #b8d4ff;
}
[data-palette="forest"] {
  --bg: #0b1410; --surface: #11201a; --surface-2: #172a22;
  --fg: #e8ede9; --muted: #7e8d83; --dim: #2a3a32; --border: #1f2f27;
  --accent: #b8d27a; --accent-2: #cee497;
}
[data-palette="ember"] {
  --bg: #100b0a; --surface: #1a1310; --surface-2: #211915;
  --fg: #f0e9e5; --muted: #918379; --dim: #3d2d25; --border: #2c211c;
  --accent: #e07a4f; --accent-2: #ec9772;
}

/* Light palettes */
[data-palette="paper"] {
  --bg: #f5f1e8; --surface: #ffffff; --surface-2: #ece6d8;
  --fg: #1a1a1a; --muted: #6a675e; --dim: #c8c2b3; --border: #d9d3c2;
  --accent: #b1561f; --accent-2: #8c3f15;
}
[data-palette="snow"] {
  --bg: #ffffff; --surface: #fafafa; --surface-2: #f1f1f1;
  --fg: #0a0a0a; --muted: #6b6b6b; --dim: #cfcfcf; --border: #e3e3e3;
  --accent: #1857d6; --accent-2: #0e3fa4;
}
[data-palette="ivory"] {
  --bg: #efece4; --surface: #f8f6ef; --surface-2: #e6e1d3;
  --fg: #1f2418; --muted: #6a6e5f; --dim: #c4c1b1; --border: #d6d2c2;
  --accent: #56682b; --accent-2: #404f1f;
  --accent-3: #56682b;
}

/* Marina — deep teal background with gold + sage accents */
[data-palette="marina"] {
  --bg: #0d3d3a;          /* deep teal page */
  --surface: #114744;
  --surface-2: #195955;
  --fg: #f1ebd9;          /* warm cream text */
  --muted: #8ba8a4;
  --dim: #2a5e59;
  --border: #1e504c;
  --accent:   #d4a23a;    /* gold — primary, most prominent */
  --accent-2: #5ec2a8;    /* sage / sea-green */
  --accent-3: #e7d8a5;    /* pale gold */
}

/* Artboard base */
.pf-artboard {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  font-size: 16px;
  line-height: 1.5;
  display: grid;
  grid-template-columns: 1fr min(720px, calc(100% - 320px)) 1fr;
  position: relative;
  overflow: hidden;
}

/* Side pattern gutters */
.pf-gutter {
  position: relative;
  background: var(--bg);
  border-inline: 1px solid var(--border);
  overflow: hidden;
}
.pf-gutter::before, .pf-gutter::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 12%, transparent 88%, var(--bg) 100%);
  pointer-events: none;
  z-index: 2;
}

.pf-content {
  padding: 56px 40px 80px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}

/* Type */
.pf-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-rule {
  height: 1px;
  background: var(--border);
  width: 100%;
}
.pf-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  transition: color 0.2s, border-color 0.2s;
}
.pf-link:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* Animated monogram — nested spinning squares, each smaller than the last */
.pf-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  position: relative;
  background: transparent;
  flex-shrink: 0;
}
.pf-logo .sq {
  position: absolute;
  border: 1px solid var(--accent);
  animation: pf-spin var(--spin, 14s) linear infinite;
  animation-direction: var(--dir, normal);
  transform-origin: center;
}
.pf-logo .sq-1 { inset: 0;   --spin: 16s; --dir: normal; }
.pf-logo .sq-2 { inset: 7px; --spin: 11s; --dir: reverse; opacity: 0.85; }
.pf-logo .sq-3 { inset: 13px; --spin: 8s;  --dir: normal;  opacity: 0.7; }
.pf-logo .sq-4 { inset: 18px; --spin: 5s;  --dir: reverse; opacity: 0.55; background: var(--accent); }
@keyframes pf-spin { to { transform: rotate(360deg); } }

.pf-content ::selection { background: var(--accent); color: var(--bg); }

/* ─── Layout classes (referenced from app.jsx) ──────────────────── */
/* These hold layout properties that need to respond to viewport width.
   Inline-style versions stayed in app.jsx for non-responsive bits. */

.pf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: -32px;
}

.pf-project-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 200px;
  column-gap: 24px;
  align-items: baseline;
  padding: 26px 12px;
  cursor: pointer;
  transition: color 0.2s;
}

.pf-image-strip {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.pf-image-strip img,
.pf-image-strip video {
  width: 160px;
  height: 110px;
  object-fit: cover;
  cursor: pointer;
  background: var(--surface-2);
  transition: transform 180ms ease, opacity 180ms ease;
}
.pf-image-strip img:hover,
.pf-image-strip video:hover {
  transform: scale(1.03);
  opacity: 0.92;
}

.pf-stack-col {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.pf-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 32px;
}

/* ─── Lightbox ──────────────────────────────────────────────────────────── */
.pf-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  animation: pf-lightbox-fade 160ms ease-out;
}
@keyframes pf-lightbox-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.pf-lightbox-image {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.pf-lightbox-button {
  position: absolute;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 22px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms, opacity 200ms;
}
.pf-lightbox-button:hover:not(:disabled) {
  background: color-mix(in oklch, var(--accent) 18%, transparent);
}
.pf-lightbox-button:disabled {
  opacity: 0.18;
  cursor: default;
}
.pf-lightbox-close { top: 24px; right: 24px; }
.pf-lightbox-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.pf-lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }
.pf-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  pointer-events: none;
}

/* ─── Mobile / narrow viewport ──────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Narrow the gutters from 1fr to 12px each — keep the dot pattern as an
     edge accent but give content the full readable width. */
  .pf-artboard {
    grid-template-columns: 12px 1fr 12px;
  }
  .pf-content {
    padding: 28px 16px 48px;
    gap: 56px;
  }

  /* Single-column project rows: title stack first, chips below. */
  .pf-project-row {
    grid-template-columns: 1fr;
    row-gap: 14px;
    padding: 22px 4px;
  }
  .pf-stack-col {
    justify-content: flex-start;
  }
  .pf-image-strip {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pf-image-strip img,
  .pf-image-strip video {
    width: 140px;
    height: 96px;
  }

  /* Header wraps when name + nav don't both fit in one line. */
  .pf-header {
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: -16px;
  }

  /* Footer stacks vertically. */
  .pf-footer {
    flex-direction: column;
    gap: 24px;
  }

  /* Lightbox: pull controls in tight on small screens. */
  .pf-lightbox-image { max-width: 96vw; max-height: 80vh; }
  .pf-lightbox-close { top: 10px; right: 10px; }
  .pf-lightbox-prev  { left: 8px; }
  .pf-lightbox-next  { right: 8px; }
}
