/* Professional Mode Overrides */
:root[data-mode="professional"] {
  --p-bg:       #f1f5f9;
  --p-bg-2:     #e2e8f0;
  --p-bg-3:     #cbd5e1;
  --p-paper:    #ffffff;
  --p-line:     #94a3b8;
  --p-text:     #0f172a;
  --p-text-dim: #475569;
  --p-terra:    #2563eb; /* Corporate Blue */
  --p-sage:     #0d9488; /* Deep Teal */
  --p-rose:     #64748b; /* Slate */
  --p-ochre:    #4f46e5; /* Indigo */
}

/* Toggle Switch Styling */
.mode-switch-wrap {
  position: absolute;
  left: 36px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-p-hand);
  font-size: 18px;
  color: var(--p-text-dim);
  z-index: 100;
}
.mode-toggle {
  appearance: none;
  width: 42px;
  height: 22px;
  background: var(--p-line);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  outline: none;
}
.mode-toggle::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  background: var(--p-paper);
  transition: transform 0.3s;
}
.mode-toggle:checked {
  background: var(--p-terra);
}
.mode-toggle:checked::before {
  transform: translateX(20px);
}

/* ===========================
   DESIGN TOKENS
=========================== */
:root {
  --p-bg:       #f5eedc;
  --p-bg-2:     #efe5cc;
  --p-bg-3:     #e9dcc0;
  --p-paper:    #faf4e3;
  --p-line:     #d6c6a4;
  --p-text:     #3a322a;
  --p-text-dim: #6e6253;
  --p-terra:    #c7522a;
  --p-sage:     #7c9070;
  --p-rose:     #c98079;
  --p-ochre:    #d4a574;

  --f-p-display: "Instrument Serif", "Times New Roman", serif;
  --f-p-body:    "Fraunces", Georgia, serif;
  --f-p-hand:    "Caveat", cursive;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--f-p-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

section,
#hero,
:target {
  scroll-margin-top: 120px;
}

/* ===========================
   TEXTURE OVERLAY
=========================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='matrix' values='0.23 0 0 0 0 0 0.20 0 0 0 0 0 0.16 0 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===========================
   LAYOUT
=========================== */
.p-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 36px;
}

.p-section {
  padding: 110px 0 60px;
}

/* ===========================
   TOP NAV
=========================== */
.p-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 244, 227, 0.88);
  backdrop-filter: blur(8px);
}
.p-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 36px 14px 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  justify-content: flex-end;
  align-items: center;
}
.p-nav a {
  font-family: var(--f-p-body);
  font-style: italic;
  font-size: 16px;
  color: var(--p-text-dim);
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 4px 2px;
  position: relative;
  transition: color 200ms;
}
.p-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='4'%3E%3Cpath d='M0 2 Q7.5 0 15 2 Q22.5 4 30 2 Q37.5 0 45 2 Q52.5 4 60 2' fill='none' stroke='%23c7522a' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 60px 4px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 200ms, transform 200ms;
}
.p-nav a:hover, .p-nav a.active {
  color: var(--p-terra);
}
.p-nav a:hover::after, .p-nav a.active::after {
  opacity: 1;
  transform: translateY(0);
}
.p-nav a:focus { outline: none; outline-offset: 0; }

/* ===========================
   HERO
=========================== */
#hero {
  min-height: 100vh;
  padding: 100px 0 60px;
  display: flex;
  align-items: center;
}
#hero .p-container { width: 100%; }
.p-hero-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 64px;
  align-items: center;
}

.p-photo {
  width: 320px;
  height: 384px;
  background: var(--p-paper);
  border: 1px solid var(--p-line);
  border-radius: 8px;
  box-shadow:
    0 4px 0 var(--p-bg-3),
    0 16px 32px rgba(58,50,42,0.15),
    inset 0 0 0 8px var(--p-paper),
    inset 0 0 0 9px var(--p-line);
  transform: rotate(-2.5deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-p-hand);
  font-size: 18px;
  color: var(--p-text-dim);
  position: relative;
  text-align: center;
}
.p-photo::after {
  content: "✿";
  font-size: 32px;
  color: var(--p-terra);
  position: absolute;
  top: -14px;
  right: -10px;
  transform: rotate(15deg);
}

/* .p-hero-text {} */
.p-hero-eyebrow {
  font-family: var(--f-p-hand);
  font-size: 25px;
  font-style: italic;
  color: var(--p-terra);
  transform: rotate(-1.3deg);
  display: inline-block;
  margin-bottom: 8px;
}
.p-hero-name {
  font-family: var(--f-p-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(56px, 9vw, 120px);
  color: var(--p-text);
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.p-hero-name .amp { color: var(--p-terra); }
.p-hero-tagline {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--p-text-dim);
  line-height: 1.3;
  margin-bottom: 24px;
}
.p-hero-tagline .t-sage    { color: var(--p-sage); }
.p-hero-tagline .t-rose    { color: var(--p-rose); }
.p-hero-tagline .t-ochre   { color: var(--p-ochre); }

.p-hero-bio {
  font-size: 18px;
  color: var(--p-text-dim);
  line-height: 1.7;
  max-width: 540px;
}
.p-hero-bio::first-letter {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 3.2em;
  color: var(--p-terra);
  float: left;
  line-height: 0.85;
  margin: 6px 8px -4px 0;
}

/* ===========================
   SECTION CHROME
=========================== */
.p-section-eyebrow {
  font-family: var(--f-p-hand);
  font-size: 26px;
  color: var(--p-terra);
  transform: rotate(-2deg);
  display: inline-block;
  margin-bottom: 4px;
}
.p-section-title {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  color: var(--p-text);
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 16px;
}
.p-section-subtitle {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 22px;
  color: var(--p-text-dim);
  margin-top: -8px;
}
.p-section-rule {
  width: 100%;
  height: 12px;
  margin: 28px 0 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='12'%3E%3Cpath d='M0 6 Q12.5 2 25 6 Q37.5 10 50 6 Q62.5 2 75 6 Q87.5 10 100 6' fill='none' stroke='%23c7522a' stroke-width='1.5' opacity='0.7'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 100px 12px;
}

/* ===========================
   DAY IN MY LIFE
=========================== */
.p-day-list {
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 100px;
}
.p-day-list::before {
  content: "";
  position: absolute;
  left: 100px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='30'%3E%3Cpath d='M1 0 Q2 7.5 1 15 Q0 22.5 1 30' fill='none' stroke='%23c7522a' stroke-width='2' opacity='0.6'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 2px 30px;
}
.p-day-item {
  display: grid;
  grid-template-columns: 90px 50px 1fr;
  gap: 18px;
  padding: 14px 0;
  align-items: center;
}
.p-day-time {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 22px;
  color: var(--p-terra);
  text-align: right;
  margin-left: -90px;
}
.p-day-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--p-paper);
  border: 1.5px solid var(--p-terra);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-left: 7px;
  flex-shrink: 0;
}
.p-day-text {
  font-family: var(--f-p-body);
  font-size: 17px;
  color: var(--p-text);
  line-height: 1.5;
}
.p-day-text em { color: var(--p-text-dim); }

/* ===========================
   TRAVEL
=========================== */
/* Travel styles removed and moved to travel-section.html */

/* ===========================
   FIELD NOTES
=========================== */
.p-notes-list { display: grid; gap: 24px; }
.p-note {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px dashed var(--p-line);
}
.p-note:last-child { border-bottom: none; }
.p-note-num {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 48px;
  color: var(--p-terra);
  opacity: 0.7;
  line-height: 1;
}
.p-note-title {
  font-family: var(--f-p-display);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  color: var(--p-text);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.p-note-meta {
  font-family: var(--f-p-hand);
  font-size: 18px;
  color: var(--p-text-dim);
  margin-bottom: 8px;
}
.p-note-meta span { color: var(--p-sage); }
.p-note-teaser {
  font-size: 16px;
  color: var(--p-text-dim);
  line-height: 1.5;
}
.p-note-read {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 18px;
  color: var(--p-terra);
  text-decoration: none;
  align-self: center;
  white-space: nowrap;
}
.p-note-read:hover { text-decoration: underline; }

/* ===========================
   QUOTES BAND
=========================== */
.p-quotes { padding: 60px 0; }
.p-quote {
  padding: 60px 36px;
  position: relative;
}
.p-quote:nth-child(odd)  { background: rgba(124,144,112,0.1); }
.p-quote:nth-child(even) { background: rgba(199,82,42,0.06); }
.p-quote::before {
  content: "\201C";
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 180px;
  color: var(--p-terra);
  opacity: 0.18;
  line-height: 0.6;
  position: absolute;
  top: 30px;
  left: 36px;
}
.p-quote-text {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--p-text);
  line-height: 1.35;
  letter-spacing: -0.005em;
  max-width: 780px;
  margin: 0 auto 18px;
  position: relative;
  z-index: 1;
  text-align: center;
}
.p-quote-attr {
  font-family: var(--f-p-hand);
  font-size: 22px;
  color: var(--p-terra);
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ===========================
   READING LOG
=========================== */
.p-shelf-wrap {
  background: linear-gradient(180deg, var(--p-bg-2), var(--p-bg-3));
  padding: 36px 28px 18px;
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px var(--p-line),
    0 6px 0 var(--p-line);
}
.p-shelf {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 220px;
  border-bottom: 6px solid #8a6f4c;
  box-shadow: 0 4px 0 rgba(58,50,42,0.18);
  overflow-x: auto;
  padding-bottom: 0;
}
.p-book {
  width: 56px;
  flex-shrink: 0;
  border-radius: 2px 2px 0 0;
  box-shadow:
    inset -3px 0 6px rgba(0,0,0,0.2),
    inset 3px 0 0 rgba(255,255,255,0.08),
    0 -2px 0 rgba(0,0,0,0.15);
  padding: 16px 6px;
  cursor: pointer;
  transition: transform 240ms ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.p-book:hover, .p-book.active { transform: translateY(-12px); }
.p-book span {
  font-family: var(--f-p-display);
  font-style: italic;
  font-size: 13px;
  color: rgba(255,255,255,0.95);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  letter-spacing: 0.02em;
  user-select: none;
}

.p-book:nth-child(1) { background: linear-gradient(180deg, #c7522a, #a8431f); height: 92%; }
.p-book:nth-child(2) { background: linear-gradient(180deg, #7c9070, #607057); height: 100%; }
.p-book:nth-child(3) { background: linear-gradient(180deg, #d4a574, #b58a5a); height: 88%; }
.p-book:nth-child(4) { background: linear-gradient(180deg, #6e6253, #564c40); height: 96%; }
.p-book:nth-child(5) { background: linear-gradient(180deg, #c98079, #a5635c); height: 90%; }
.p-book:nth-child(6) { background: linear-gradient(180deg, #3a322a, #2a241e); height: 100%; }
.p-book:nth-child(7) { background: linear-gradient(180deg, #8b4513, #654321); height: 85%; }
.p-book:nth-child(8) { background: linear-gradient(180deg, #4f2762, #2f1739); height: 92%; }
.p-book:nth-child(9) { background: linear-gradient(180deg, #916530, #6c4a1f); height: 94%; }
.p-book:nth-child(10) { background: linear-gradient(180deg, #944b24, #6c371e); height: 98%; }
.p-book:nth-child(11) { background: linear-gradient(180deg, #596a85, #3d4f68); height: 90%; }

.p-book-card {
  display: none;
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--p-paper);
  border: 1px solid var(--p-line);
  border-radius: 4px;
}
.p-book-card.active { display: block; }
.p-book-card h4 {
  font-family: var(--f-p-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--p-text);
  margin-bottom: 2px;
}
.p-book-card .p-book-author {
  font-family: var(--f-p-hand);
  font-size: 20px;
  color: var(--p-terra);
  margin-bottom: 8px;
}
.p-book-card p {
  font-family: var(--f-p-body);
  font-style: italic;
  font-size: 16px;
  color: var(--p-text-dim);
  line-height: 1.5;
}

/* ===========================
   MIND MAP
=========================== */
.p-mindmap-wrap {
  height: 600px;
  background: var(--p-paper);
  border: 1px solid var(--p-line);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(58,50,42,0.1);
  overflow: hidden;
  position: relative;
}
.p-mindmap-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(245,238,220,0.7);
  padding: 8px 14px;
  border-radius: 4px;
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--f-p-hand);
  font-size: 15px;
  color: var(--p-text-dim);
  z-index: 10;
}
.p-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.p-mindmap-tooltip {
  position: absolute;
  background: var(--p-text);
  color: var(--p-paper);
  padding: 10px 14px;
  border-radius: 4px;
  font-family: var(--f-p-body);
  font-size: 13px;
  line-height: 1.4;
  max-width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
  z-index: 20;
}

@media (max-width: 720px) {
  .p-mindmap-tooltip {
    font-size: 15px;
    max-width: 240px;
    padding: 12px 16px;
  }
}

/* ===========================
   FOOTER
=========================== */
.p-footer {
  padding: 60px 32px 40px;
  text-align: center;
  border-top: 1px dashed var(--p-line);
  font-family: var(--f-p-hand);
  font-size: 20px;
  color: var(--p-terra);
}

/* ===========================
   FADE-IN ON SCROLL
=========================== */
.p-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.p-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   REDUCED MOTION
=========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ===========================
   RESPONSIVE — ≤820px
=========================== */
@media (max-width: 820px) {
  .p-container { padding: 0 22px; }

  .p-hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .p-photo {
    margin: 0 auto;
    transform: rotate(-2.5deg);
  }
  .p-hero-bio { margin: 0 auto; }
  .p-hero-bio::first-letter { float: none; margin: 0; }

  /* Travel rules removed (moved to travel-section.html) */

  .p-note { grid-template-columns: 1fr; gap: 8px; }
  .p-note-num { font-size: 36px; }

  .p-day-list { padding-left: 80px; }
  .p-day-list::before { left: 80px; }
  .p-day-item { grid-template-columns: 70px 40px 1fr; gap: 10px; }
  .p-day-time { font-size: 16px; margin-left: -70px; }

  .p-mindmap-wrap { height: 420px; }
}

/* ===========================
   RESPONSIVE — ≤720px
=========================== */
@media (max-width: 720px) {
  .mode-switch-wrap {
    position: static;
    justify-content: center;
    width: 100%;
    padding: 12px 18px 0;
    flex-wrap: wrap;
    font-size: 16px;
  }

  .p-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .p-nav-inner {
    padding: 8px 18px 12px;
    gap: 4px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .p-nav a { font-size: 14px; }
}
