/* ══════════════════════════════════════════════════════
   Mara Dipper — Technical Writer
   19th-century botany journal aesthetic
   ══════════════════════════════════════════════════════ */

/* ─── Self-hosted fonts ──────────────────────────────── */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/eb-garamond-latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: optional;
  src: url('/fonts/eb-garamond-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/eb-garamond-latin-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: optional;
  src: url('/fonts/eb-garamond-latin-500-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'IM Fell English';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/im-fell-english-latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IM Fell English';
  font-style: italic;
  font-weight: 400;
  font-display: optional;
  src: url('/fonts/im-fell-english-latin-400-italic.woff2') format('woff2');
}

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

:root {
  --left-bg:      #c3b090;   /* aged parchment, darker */
  --right-bg:     #f0e8d0;   /* light cream paper */
  --right-bg-alt: #ecdfc4;
  --ink:          #1a1007;   /* deep sepia black */
  --ink-mid:      #3c2b16;   /* warm brown */
  --ink-light:    #6b5038;   /* faded ink */
  --ink-muted:    #9a8060;   /* very faded */
  --green:        #253d1c;   /* dark botanical green */
  --green-mid:    #3a5a2a;
  --rule:         #b09870;   /* faded rule line */

  --font-display: 'IM Fell English', Georgia, serif;
  --font-body:    'EB Garamond', Georgia, serif;

  --grid: 1.75rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--left-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--grid);
}

/* ─── Paper noise texture overlay ───────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: multiply;
}


/* ══════════════════════════════════════════════════════
   PAGE LOAD ANIMATIONS
   ══════════════════════════════════════════════════════ */

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.left-identity {
  animation: fadeSlideUp 0.9s ease both;
  animation-delay: 0.1s;
}

.left-nav {
  animation: fadeSlideUp 0.9s ease both;
  animation-delay: 0.3s;
}

.patch {
  animation: fadeSlideUp 0.9s ease both;
  animation-delay: 0.5s;
}

.left-note {
  animation: fadeSlideUp 0.7s ease both;
  animation-delay: 0.6s;
}


/* ══════════════════════════════════════════════════════
   LAYOUT — Desktop
   ══════════════════════════════════════════════════════ */

.layout {
  display: block;
  min-height: 100vh;
}

/* ─── Left panel ─────────────────────────────────────── */
.left-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 50%;
  height: 100vh;
  background: var(--left-bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2.5rem 3rem 2rem;
  overflow: hidden;
  z-index: 10;
}

/* flower.svg — lower left, above lines, below content */
.flower-bg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 72%;
  display: block;
  margin: 0;
  opacity: 0.18;
  pointer-events: none;
  z-index: 2;
}

.left-panel > *:not(.flower-bg) {
  position: relative;
  z-index: 3;
}

.left-mid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  margin-top: 25%;
  margin-bottom: auto;
}

/* Identity block */
.left-identity {
  text-align: left;
}

.left-name {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 6vw, 8.5rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.left-title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ink-mid);
  letter-spacing: 0.12em;
  opacity: 0.8;
}

/* Navigation */
.left-nav {
  display: flex;
  flex-direction: column;
  gap: 0rem;
  margin-left: 5rem;
  width: 40%;
}

.nav-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink-light);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0 0.3rem 1rem;
  border-bottom: 1px solid rgba(60, 43, 22, 0.12);
  transition: color 0.2s;
  position: relative;
}

.nav-item:last-child {
  border-bottom: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
}

/* Active ink-dot indicator */
.nav-item.active::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.55rem;
  color: var(--green);
  line-height: 1;
}

.nav-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--green);
  opacity: 0.9;
  min-width: 20px;
}

.nav-item.active .nav-num {
  opacity: 1;
}

/* Patch */
.patch {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: #d8cba8;
  background: #4a6741;
  border: 1.5px dashed rgba(216, 203, 168, 0.5);
  padding: 1rem 2rem 1.1rem;
  display: inline-block;
  transform: rotate(-1.5deg);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.22), inset 0 0 0 3px rgba(216,203,168,0.08);
  position: relative;
  align-self: flex-start;
  margin-top: 1rem;
  margin-left: 5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.patch:hover {
  transform: rotate(-1.5deg) scale(1.04);
  box-shadow: 3px 5px 14px rgba(0,0,0,0.3), inset 0 0 0 3px rgba(216,203,168,0.08);
}

.patch::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(216, 203, 168, 0.18);
  pointer-events: none;
}

/* Left panel note */
.left-note {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-light);
  text-align: left;
  line-height: 1.5;
}


/* ─── Right panel ────────────────────────────────────── */
.right-panel {
  margin-left: 47%;
  min-height: 100vh;
  background-color: var(--right-bg);

  /* Subtle paper fiber texture */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.55' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23p)' opacity='0.045'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 18% 25%, rgba(155,125,80,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 68%, rgba(130,105,65,0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 55% 88%, rgba(175,145,90,0.06) 0%, transparent 35%);

  position: relative;
  padding: calc(var(--grid) * 3) 4.5rem calc(var(--grid) * 6) 6rem;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
}


/* ══════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════ */

.content-section {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-bottom: calc(var(--grid) * 4);

  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.content-section.revealed {
  opacity: 1;
  transform: none;
}

.content-section--last {
  margin-bottom: 0;
}


/* ══════════════════════════════════════════════════════
   CONTENT SECTIONS
   ══════════════════════════════════════════════════════ */

/* Section header */
.section-header {
  margin-bottom: 0;
  position: relative;
}

.section-num {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.78rem;
  color: var(--green);
  letter-spacing: 0.14em;
  line-height: var(--grid);
  margin-left: 0.5rem;
  margin-bottom: 0;
  opacity: 0.8;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: calc(var(--grid) * 2);
  margin-bottom: 0;
}

.section-rule {
  height: var(--grid);
  position: relative;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    var(--rule) 50%,
    var(--rule) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  -webkit-mask-image: linear-gradient(to right, black 55%, transparent);
  mask-image: linear-gradient(to right, black 55%, transparent);
}

.section-rule::before {
  content: '❧';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--rule);
  opacity: 0.6;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Section body */
.section-body p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: var(--grid);
  margin-bottom: var(--grid);
}

.section-body p:last-child {
  margin-bottom: 0;
}

.section-body em {
  font-style: italic;
  color: var(--ink);
}

/* Drop cap */
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: calc(var(--grid) * 2);
  float: left;
  line-height: 1;
  margin: 0 0.2rem 0 0;
  color: var(--ink);
}

/* Aside annotation note */
.aside-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: calc(var(--grid) * 2);
  padding: calc(var(--grid) / 2) 1.2rem;
  border-left: 2px solid rgba(37, 61, 28, 0.35);
  background: rgba(37, 61, 28, 0.05);
}

.aside-note svg {
  flex-shrink: 0;
  margin-top: 0.3rem;
}

.aside-note p {
  font-family: var(--font-body);
  font-size: 0.92rem !important;
  font-style: italic;
  line-height: var(--grid) !important;
  color: var(--green) !important;
  margin: 0 !important;
}

.aside-note--closing {
  margin-top: calc(var(--grid) * 2);
}


/* ─── Services ──────────────────────────────────────── */
.services-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-entry {
  padding: var(--grid) 0;
  border-bottom: 1px solid rgba(176, 152, 112, 0.4);
}

.service-entry:first-child {
  border-top: 1px solid rgba(176, 152, 112, 0.4);
}

.service-entry dt {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.03em;
  line-height: var(--grid);
  margin-bottom: var(--grid);
}

.service-entry dd {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-light);
  line-height: var(--grid);
  margin-left: 0;
}


/* ─── Process ───────────────────────────────────────── */
.process-steps {
  list-style: none;
  margin-top: var(--grid);
  display: flex;
  flex-direction: column;
}

.process-step {
  display: flex;
  gap: 1.5rem;
  padding: var(--grid) 0;
  border-bottom: 1px solid rgba(176, 152, 112, 0.35);
  align-items: flex-start;
}

.process-step:first-child {
  border-top: 1px solid rgba(176, 152, 112, 0.35);
}

.step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--green);
  opacity: 0.65;
  flex-shrink: 0;
  min-width: 2rem;
  line-height: var(--grid);
}

.step-body h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.03em;
  line-height: var(--grid);
  margin-bottom: var(--grid);
}

.step-body p {
  margin-bottom: 0 !important;
}


/* ─── Portfolio ─────────────────────────────────────── */
.portfolio-list {
  list-style: none;
  margin-top: var(--grid);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portfolio-item {
  padding: var(--grid) 0;
  border-bottom: 1px solid rgba(176, 152, 112, 0.35);
  position: relative;
  transition: background 0.25s;
}

.portfolio-item:first-child {
  border-top: 1px solid rgba(176, 152, 112, 0.35);
}

/* Hover ink-wash overlay */
.portfolio-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(37, 61, 28, 0.03);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.portfolio-item:hover::after {
  opacity: 1;
}

.portfolio-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  line-height: var(--grid);
  margin-bottom: 0;
}

.portfolio-type {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0.8;
}

.portfolio-year {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Portfolio accordion */
.portfolio-title {
  margin-bottom: 0;
}

.portfolio-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: var(--grid);
  padding: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  gap: 0.75rem;
  transition: color 0.2s;
}

.portfolio-toggle:hover {
  color: var(--green);
}

.toggle-icon {
  font-size: 1.1rem;
  color: var(--ink-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
  font-family: var(--font-display);
}

.toggle-icon::before {
  content: '+';
}

.portfolio-toggle[aria-expanded="true"] .toggle-icon {
  transform: rotate(45deg);
}

.portfolio-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease;
}

.portfolio-item.open .portfolio-details {
  max-height: 400px;
  opacity: 1;
}

.portfolio-details p {
  padding-top: var(--grid);
}


/* ─── Testimonials ──────────────────────────────────── */
.testimonial-list {
  list-style: none;
  margin-top: var(--grid);
  display: flex;
  flex-direction: column;
}

.testimonial-item {
  padding: calc(var(--grid) * 1.5) 0;
  border-bottom: 1px solid rgba(176, 152, 112, 0.35);
}

.testimonial-item:first-child {
  border-top: 1px solid rgba(176, 152, 112, 0.35);
}

.testimonial-quote {
  position: relative;
  padding-left: 2rem;
  margin-bottom: calc(var(--grid) * 0.75);
}

.testimonial-quote::before {
  content: '\201C';
  position: absolute;
  left: -0.1rem;
  top: -0.5rem;
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--green);
  opacity: 0.22;
  line-height: 1;
}

.testimonial-quote p {
  font-style: italic;
  color: var(--ink-mid) !important;
}

.testimonial-attribution {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-left: 2rem;
}

.testimonial-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  display: block;
}

.testimonial-company {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
  display: block;
}


/* ─── Contact ───────────────────────────────────────── */
.contact-block {
  margin-top: calc(var(--grid) * 2);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-line {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0;
  height: calc(var(--grid) * 2);
  border-bottom: 1px solid rgba(176, 152, 112, 0.3);
  margin: 0 !important;
}

.contact-line:first-child {
  border-top: 1px solid rgba(176, 152, 112, 0.3);
}

.contact-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  min-width: 72px;
  flex-shrink: 0;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink-mid);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

a.contact-value:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* ══════════════════════════════════════════════════════
   MOBILE SECTION INDICATOR
   ══════════════════════════════════════════════════════ */
.mobile-section-indicator {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  background: rgba(37, 61, 28, 0.88);
  color: #d8cba8;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border-radius: 0 0 0 4px;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.mobile-section-indicator.visible {
  opacity: 1;
}


/* ══════════════════════════════════════════════════════
   MOBILE HEADER (hidden on desktop)
   ══════════════════════════════════════════════════════ */
.mobile-header {
  display: none;
}


/* ══════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ══════════════════════════════════════════════════════ */
@media (max-width: 780px) {

  /* Show mobile indicator */
  .mobile-section-indicator {
    display: block;
  }

  /* Hide desktop left panel */
  .left-panel {
    display: none;
  }

  /* Show mobile header */
  .mobile-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--left-bg);
    padding: 1.5rem 1.5rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);

    background-image:
      repeating-linear-gradient(
        0deg,
        transparent,
        transparent 28px,
        rgba(60, 43, 22, 0.06) 28px,
        rgba(60, 43, 22, 0.06) 29px
      ),
      linear-gradient(var(--left-bg), var(--left-bg));
  }

  .mobile-header-inner {
    text-align: center;
  }

  .mobile-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ink-mid);
    opacity: 0.7;
    margin-bottom: 0.25rem;
  }

  .mobile-name {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 400;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 1rem;
  }

  .mobile-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 0 0.75rem;
    border-top: 1px solid rgba(60, 43, 22, 0.12);
    flex-wrap: wrap;
  }

  /* Ornamental separator below header */
  .mobile-header::after {
    content: '— ❧ —';
    display: block;
    text-align: center;
    font-family: var(--font-display);
    font-style: italic;
    color: var(--ink-muted);
    font-size: 0.85rem;
    padding: 0.4rem 0 0.6rem;
    letter-spacing: 0.2em;
    opacity: 0.5;
  }

  .mobile-nav a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--ink-mid);
    text-decoration: none;
    letter-spacing: 0.06em;
    transition: color 0.15s;
  }

  .mobile-nav a:hover {
    color: var(--ink);
  }

  /* Right panel: full width, no torn edge on mobile */
  .layout {
    display: block;
  }

  .right-panel {
    margin-left: 0;
    margin-top: 0;
    padding: 2.8rem 1.5rem 4rem;
    clip-path: none;
    background-image: none;
  }

  .right-panel::before {
    display: none;
  }

  .content-section {
    max-width: 100%;
    margin-bottom: 3.5rem;
  }

  .drop-cap::first-letter {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .mobile-name {
    font-size: 1.9rem;
  }

  .mobile-nav {
    gap: 1rem;
  }

  .right-panel {
    padding: 2.5rem 1.2rem 3.5rem;
  }

  .contact-line {
    flex-direction: column;
    gap: 0.15rem;
    height: auto;
    padding: 0.4rem 0;
  }

  .contact-label {
    min-width: auto;
  }
}
