/* Portfolio tokens — page shell only (nav, bg, opening/closing) */
:root {
  --bg: #f5f3f0;
  --text: #1a1a1a;
  --text-secondary: #5c5753;
  --text-tertiary: #8a8480;
  --border: #ddd9d4;
  --selection-bg: #1a1a1a;
  --selection-fg: #f5f3f0;
}

[data-theme="dark"] {
  --bg: #0c0b0a;
  --text: #e8e4df;
  --text-secondary: #9a9590;
  --text-tertiary: #6b6662;
  --border: #2a2725;
  --selection-bg: #e8e4df;
  --selection-fg: #0c0b0a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.3s ease;
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

a { color: var(--text); text-decoration: none; }

/* Password gate */
.pf-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.pf-gate.hidden {
  opacity: 0;
  pointer-events: none;
}

.pf-gate-inner {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 0 20px;
}

.pf-gate-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 32px;
}

.pf-gate-subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.pf-gate-input {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.pf-gate-input:focus {
  border-color: var(--text-secondary);
}

.pf-gate-btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--selection-fg);
  background: var(--selection-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.pf-gate-btn:hover {
  opacity: 0.85;
}

.pf-gate-error {
  font-size: 0.8125rem;
  color: #c0392b;
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pf-gate-error.show {
  opacity: 1;
}

.portfolio {
  width: 100%;
  overflow-x: hidden;
}

/* Nav */
.portfolio-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: transparent;
}

.portfolio-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.portfolio-nav a:hover { color: var(--text); }

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.theme-toggle:hover { color: var(--text); }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Sections */
.pf-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 48px;
  position: relative;
  transition: background-color 0.6s ease;
}

.pf-zingage {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(12, 91, 55, 0.1) 15%,
    rgba(12, 91, 55, 0.1) 85%,
    transparent 100%
  );
}

.pf-tennr {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(144, 6, 191, 0.07) 15%,
    rgba(144, 6, 191, 0.07) 85%,
    transparent 100%
  );
}

[data-theme="dark"] .pf-zingage {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(12, 91, 55, 0.12) 15%,
    rgba(12, 91, 55, 0.12) 85%,
    transparent 100%
  );
}

[data-theme="dark"] .pf-tennr {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(144, 6, 191, 0.12) 15%,
    rgba(144, 6, 191, 0.12) 85%,
    transparent 100%
  );
}

.pf-section-inner {
  max-width: 1100px;
  width: 100%;
}

/* Fade-in for scroll reveals */
.pf-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.pf-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Opening section */
.pf-opening {
  min-height: 70vh;
  padding-top: 0;
  padding-bottom: 0;
}

.pf-opening-inner {
  text-align: left;
}

.pf-headline {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

/* Project label */
.pf-project-label {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

/* Project description */
.pf-project-desc {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 72px;
}

/* Sub-section description */
.pf-sub-desc {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   Force light mode on all compositions
   ========================================================================== */

.pf-daysi-layout,
.pf-zingage-layout,
.pf-tennr-layout {
  color-scheme: light;
}

/* ==========================================================================
   DAYSI — DM Sans, warm grey, alpha-based borders
   Surface #F7F7F7, cards #FFFFFF, text #2F2F2F
   ========================================================================== */


.pf-daysi .pf-project-label { color: rgba(47, 47, 47, 0.85); }
[data-theme="dark"] .pf-daysi .pf-project-label { color: rgba(47, 47, 47, 0.85); }

/* Desktop frame — rounded corners, no chrome */
.pf-daysi-desktop {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #2F2F2F;
  background: #FFFFFF;
  border: 1px solid rgba(47, 47, 47, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(47, 47, 47, 0.08);
}

.pf-daysi-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

/* Journal panel */
.pf-journal {
  background: #FFFFFF;
  border-right: 1px solid rgba(47, 47, 47, 0.06);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
}

.pf-journal-current {
  flex: 1;
}

.pf-journal-date {
  font-size: 13px;
  color: rgba(47, 47, 47, 0.4);
  text-align: center;
  position: relative;
  margin: 16px 0 12px;
}

.pf-journal-date::before,
.pf-journal-date::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  width: 35%;
  background: rgba(47, 47, 47, 0.06);
}

.pf-journal-date::before { left: 0; }
.pf-journal-date::after { right: 0; }

.pf-faded { opacity: 0.35; }

.pf-journal-entry {
  font-size: 14px;
  line-height: 1.7;
  color: #2F2F2F;
}

.pf-journal-entry p { margin-bottom: 4px; }

/* Highlight marks — Daysi project palette */
mark {
  background: none;
  color: inherit;
  padding: 2px 4px;
  border-radius: 4px;
}

.hl-purple { background: rgba(139, 92, 246, 0.15); }
.hl-amber { background: rgba(245, 162, 24, 0.15); }
.hl-blue { background: rgba(74, 158, 237, 0.15); }

/* Force light highlights even in dark mode */
[data-theme="dark"] .pf-daysi .hl-purple { background: rgba(139, 92, 246, 0.15); }
[data-theme="dark"] .pf-daysi .hl-amber { background: rgba(245, 162, 24, 0.15); }
[data-theme="dark"] .pf-daysi .hl-blue { background: rgba(74, 158, 237, 0.15); }

/* Blinking cursor */
.pf-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #474CD5;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Insights panel — sidebar inside the frame */
.pf-insights {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #F7F7F7;
  padding: 24px;
}

.pf-insights-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-insights-title {
  font-size: 14px;
  font-weight: 500;
  color: #2F2F2F;
}

.pf-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #474CD5;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.pf-insight-card {
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #2F2F2F;
}

.pf-insight-extracted {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.pf-insight-past {
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.15);
  opacity: 0.65;
}

.pf-insight-question {
  background: rgba(245, 162, 24, 0.08);
  border: 1px solid rgba(245, 162, 24, 0.2);
}

.pf-insight-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(139, 92, 246, 0.8);
  margin-bottom: 4px;
}

.pf-insight-question .pf-insight-label {
  color: rgba(245, 162, 24, 0.9);
}

.pf-insight-date {
  font-size: 12px;
  color: rgba(47, 47, 47, 0.4);
  margin-bottom: 4px;
}

.pf-insight-ref {
  font-size: 12px;
  color: rgba(47, 47, 47, 0.4);
  margin-top: 4px;
}

.pf-insight-connection {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 32px;
}

.pf-insight-connection::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(139, 92, 246, 0.25);
}

.pf-connection-label {
  font-size: 12px;
  color: rgba(139, 92, 246, 0.6);
  background: #F7F7F7;
  padding: 0 8px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   ZINGAGE (Customer Facing Portal) — screenshot stack
   Background #fefdfb
   ========================================================================== */


.pf-zingage .pf-project-label { color: rgba(0, 0, 0, 0.85); }
[data-theme="dark"] .pf-zingage .pf-project-label { color: rgba(255, 255, 255, 0.85); }

.pf-zingage-sub-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 4px;
}

.pf-zingage-sub-label:not(:first-child) {
  margin-top: 72px;
}

[data-theme="dark"] .pf-zingage-sub-label {
  color: rgba(255, 255, 255, 0.75);
}

.pf-zingage-screenshots {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.pf-zingage-screenshots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.pf-zingage-screenshots img + img {
  margin-top: 48px;
}

/* ==========================================================================
   TENNR — Screenshot carousel
   Background #F8F9FA, accent #7c3aed
   ========================================================================== */


.pf-tennr .pf-project-label { color: rgba(0, 0, 0, 0.85); }
[data-theme="dark"] .pf-tennr .pf-project-label { color: rgba(255, 255, 255, 0.85); }

.pf-tennr-sub-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 4px;
}

.pf-tennr-sub-label:not(:first-child) {
  margin-top: 72px;
}

[data-theme="dark"] .pf-tennr-sub-label {
  color: rgba(255, 255, 255, 0.75);
}

.pf-tennr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pf-tennr-grid img:only-child {
  grid-column: 1 / -1;
}

.pf-tennr-parallel .pf-tennr-sub-label {
  margin-top: 0;
}

.pf-tennr-parallel .pf-sub-desc {
  margin-top: 0;
}

.pf-tennr-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .pf-tennr-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.pf-zingage-screenshots img,
.pf-tennr-grid img {
  cursor: default;
  transition: box-shadow 0.2s;
}

.pf-zingage-screenshots img:hover,
.pf-tennr-grid img:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.pf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 32px;
}

.pf-lightbox.open {
  display: flex;
}

.pf-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Responsive: tablet and below
   ========================================================================== */

@media (max-width: 768px) {
  .pf-section { padding: 60px 20px; }

  .pf-project-label {
    font-size: 1.5rem;
  }

  .pf-daysi-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .pf-journal {
    border-right: none;
    border-bottom: 1px solid rgba(47, 47, 47, 0.06);
  }
}

/* Responsive: small phones */
@media (max-width: 480px) {
  .pf-opening {
    min-height: 60vh;
  }

  .pf-headline {
    font-size: 2.5rem;
  }

  .pf-project-label {
    font-size: 1.25rem;
  }

  .portfolio-nav {
    padding: 12px 16px;
  }
}
