/* ==========================================================================
   andreechapatte.com (v3) - Global Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Sorts+Mill+Goudy:ital@0;1&display=swap');

/* ==========================================================================
   Cross-Document View Transitions
   ========================================================================== */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
}

.header {
  view-transition-name: site-header;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  .work-block,
  .home-block,
  .home-scroll-inner,
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

:root {
  /* Palette */
  --color-bg:         #0d0d0d; /* Deep charcoal background */
  --color-text:       #f0f0f0; /* Off-white body text */
  --color-text-muted: #a8a8a8; /* Metadata, separators, taglines */
  --color-accent:     #6db3ff; /* Links, active nav */
  --color-hover:      #8AFF97; /* Interactive hover states & Gradient B bright point */
  --color-border:     #2a2a2a; /* Borders / layout rules */

  /* Typography */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Newsreader', Georgia, serif;
  --font-nav:     'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Type Scale */
  --text-hero:    clamp(3.5rem, 8vw, 6rem);
  --text-xl:      2rem;
  --text-lg:      1.25rem;
  --text-base:    0.875rem; /* 14px */
  --text-sm:      0.75rem;  /* 12px */

  /* Line Height */
  --leading-body:    1.8;
  --leading-display: 1.1;
  --leading-ui:      1.4;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  2rem;
  --space-lg:  4rem;
  --space-xl:  8rem;
  --space-2xl: 16rem;

  /* Japanese Gradient System */
  /* Gradient A - calm / natural. For full-section backgrounds and reading-heavy pages. */
  --gradient-a: linear-gradient(
    to bottom,
    #204229 0%,
    #1b3a26 22%,
    #16301f 48%,
    #101f16 68%,
    #0d0d0d 100%
  );

  /* Gradient B - signal / charged. For nav bars and accent strips ONLY. */
  --gradient-b: linear-gradient(
    to bottom,
    #204229 0%,
    #1b3a26 24%,
    #16301f 50%,
    #101f16 70%,
    #0d0d0d 100%
  );

  /* Gradient variations for Work, Calendar, and Contact */
  --gradient-work: linear-gradient(
    to bottom,
    #0d0d0d 0%,
    #14291c 40%,
    #1b3a26 72%,
    #204229 100%
  );

  --gradient-calendar: radial-gradient(
    120% 80% at 50% 120%,
    #204229 0%,
    #1b3a26 38%,
    #0d0d0d 78%
  );

  --gradient-contact: radial-gradient(
    95% 115% at 88% 12%,
    #204229 0%,
    #1b3a26 38%,
    #0d0d0d 72%
  );
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.body-scroll-lock {
  overflow: hidden;
}

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

video {
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 200ms ease, opacity 200ms ease;
}

a:hover {
  color: var(--color-hover);
}

/* Underline links in content areas per Job 1c */
.essay-content a,
.writing-entry a,
.calendar-entry a,
.work-block a,
.project-description a,
.contact-content a,
.home-bio-container a,
.back-link,
.footer a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

.content-reading {
  max-width: 640px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.content-wide {
  max-width: 900px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* ==========================================================================
   Japanese Gradient System & Grain Overlay
   ========================================================================== */

.gradient-container {
  position: relative;
  overflow: hidden;
}

body.gradient-container--a,
.gradient-container--a {
  background-color: #0d0d0d;
  background-image: var(--gradient-a);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.gradient-container--b,
.gradient-container--b {
  background: var(--gradient-b);
}

body.gradient-container--work,
.gradient-container--work {
  background-color: #0d0d0d;
  background-image: var(--gradient-work);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.gradient-container--calendar,
.gradient-container--calendar {
  background-color: #0d0d0d;
  background-image: var(--gradient-calendar);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

body.gradient-container--contact,
.gradient-container--contact {
  background-color: #0d0d0d;
  background-image: var(--gradient-contact);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

/* SVG Grain overlay Sitting absolutely over the container */
.grain-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.42;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

/* Content wrapper inside gradient containers to sit above grain overlay */
.gradient-content {
  position: relative;
  z-index: 3;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-md);
  z-index: 1000;
  pointer-events: none;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13,13,13,0.92) 0%, rgba(13,13,13,0) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Navigation bar can optionally take Gradient B background treatment */
.header.nav-accent {
  background: var(--gradient-b);
  pointer-events: auto;
  border-bottom: 1px solid var(--color-border);
}

.header.nav-accent .grain-overlay {
  z-index: 1;
}

.header.nav-accent .header-inner {
  position: relative;
  z-index: 3;
}

.header-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: auto;
}

/* Logo / Wordmark */
.logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.logo:hover {
  color: var(--color-hover);
}

/* Nav Links Container (Desktop) */
.nav-container {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.nav-links {
  font-family: var(--font-nav);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: var(--leading-ui);
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 200ms ease;
}

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

.nav-links a.active {
  color: var(--color-accent);
}

.nav-separator {
  color: var(--color-text-muted);
  margin: 0 0.15em;
  user-select: none;
}

/* Language Toggle: FR / EN */
.lang-toggle {
  font-family: var(--font-nav);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  user-select: none;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  transition: color 200ms ease;
  text-decoration: none;
}

.lang-btn:hover {
  color: var(--color-hover);
}

.lang-btn.active {
  color: var(--color-accent);
  font-weight: bold;
  cursor: default;
}

.lang-btn.active:hover {
  color: var(--color-accent);
}

.lang-btn.disabled-fr {
  cursor: not-allowed;
  opacity: 0.6;
}

.lang-btn.disabled-fr:hover {
  color: var(--color-text-muted);
}

/* Hamburger Button */
.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-nav);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: var(--space-xs);
  line-height: var(--leading-ui);
  z-index: 1010;
}

/* Mobile Fullscreen Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1), visibility 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
  padding: var(--space-md);
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Links */
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.mobile-menu-links a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  text-decoration: none;
  transition: color 200ms ease;
  text-align: center;
}

.mobile-menu-links a:hover {
  color: var(--color-hover);
}

.mobile-menu-links a.active {
  color: var(--color-accent);
}

.mobile-overlay .lang-toggle {
  margin-top: var(--space-md);
}

/* ==========================================================================
   Homepage Layout
   ========================================================================== */

/* Homepage Video Hero */
.hero {
  position: relative;
  height: 100vh; /* Filling the viewport */
  width: 100%;
  overflow: hidden;
}

.hero .hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Centered mint engraving scroll reveal under video */
.scroll-engraving {
  grid-area: 1 / 1 / 2 / 2;
  display: block;
  width: 100%;
  height: auto; /* natural aspect ratio */
  align-self: start;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
  z-index: 1;
}

.scroll-content-overlay {
  grid-area: 1 / 1 / 2 / 2;
  position: relative;
  align-self: start;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md);
  z-index: 5;
}

.hero-scrim {
  display: none;
}

/* Overlaid Text above Video */
.hero-content {
  position: relative;
  z-index: 5;
  padding: var(--space-md);
  max-width: 800px;
}

.hero-text-container {
  position: absolute;
  top: 35vh; /* Vertically centered on the first viewport screen */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  padding: 0 var(--space-md);
  text-align: center;
  z-index: 5;
  pointer-events: none; /* Make overlay click-through */
}

.hero-name {
  font-family: 'Sorts Mill Goudy', Georgia, serif;
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: var(--leading-display);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 400;
  color: var(--color-text);
  line-height: var(--leading-body);
  max-width: 480px;
  margin: 0 auto;
}

/* Work Page Video Hero Banner */
.work-hero {
  position: relative;
  width: 100%;
  height: 60vh; /* Premium banner height */
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.work-hero .hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: auto; /* ensure native controls are clickable on low power mode */
}

/* Scroll down target area */
.home-scroll-section {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 100vh; /* Ensure section is at least fullscreen on all devices */
  background-color: #0d0d0d;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  font-family: var(--font-display);
}

.home-scroll-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 5;
}

/* Separator rule */
.hero-rule {
  width: 40px;
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0 auto var(--space-xl) auto;
}

.home-bio-container {
  max-width: 640px;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-xl);
  font-size: 22px;
}

.home-self-desc {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: var(--leading-display);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  font-weight: 400;
}

.home-subtagline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem); /* enlarged to match home-self-desc heading */
  line-height: var(--leading-display);
  color: var(--color-text); /* White #f0f0f0 per spec */
  margin-bottom: var(--space-lg);
  font-weight: 400;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .home-subtagline {
    white-space: normal;
  }
}

.home-bio-text {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-xl);
}

/* Homepage Quicklinks */
.home-quicklinks {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0;
}
.home-quicklinks li {
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}
.home-quicklinks a {
  font-size: 22px;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}
.home-quicklinks a:hover {
  color: var(--color-hover);
}
.quicklink-note {
  font-size: 18px;
  color: var(--color-text-muted);
}

/* Calendar Section Headings */
.calendar-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: normal;
  color: var(--color-text-muted);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border);
}

/* Homepage Alternating Content Blocks */
.home-blocks {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.home-block {
  margin-bottom: var(--space-xl);
  width: 100%;
}

.home-block--image {
  padding: 0 var(--space-md);
}

.home-block--image img {
  width: 100%;
  border: 1px solid var(--color-border);
}

.home-block--text {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--space-md);
  text-align: center;
}

.home-block--text p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: var(--leading-body);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  width: 100%;
  margin-top: auto;
  padding: var(--space-xl) var(--space-md) var(--space-lg) var(--space-md);
  text-align: center;
  border-top: 1px solid var(--color-border);
  background-color: transparent;
}

.footer p,
.footer a {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-ui);
}

.footer a:hover {
  color: var(--color-hover);
}

.footer-separator {
  margin: 0 var(--space-xs);
  user-select: none;
}

/* ==========================================================================
   Subpage Elements: Page Title & General Layout
   ========================================================================== */

.subpage-container {
  padding-top: 120px; /* Offset fixed header */
  padding-bottom: var(--space-2xl);
}


.page-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-display);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Responsive Breakpoints & Adjustments
   ========================================================================== */

@media (max-width: 800px) {
  /* Hide Desktop Nav */
  .nav-container {
    display: none;
  }

  /* Show Burger */
  .nav-burger {
    display: block;
  }

  .header {
    height: 60px;
    padding: 0 var(--space-sm);
  }

  .logo {
    font-size: var(--text-base);
  }

  .subpage-container {
    padding-top: 90px;
  }

  .hero {
    height: 100vh;
  }

  .hero-text-container {
    top: 20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 90%;
    padding: 0 var(--space-sm);
  }

  .work-hero {
    height: 45vh;
  }

  .hero-name {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
  }



  .hero-rule {
    margin-bottom: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .hero {
    height: 100vh;
  }


  .hero-text-container {
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 95%;
    padding: 0 var(--space-xs);
  }

  .content-reading,
  .content-wide {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .home-block--image,
  .home-block--text {
    padding: 0 var(--space-sm);
  }

  .header {
    padding: 0 var(--space-xs);
  }
}

/* Scoped Reading-Text Font Size Adjustments */
.work-block {
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.work-block > *:not(img):not(picture):not(figure):not(.gallery-strip) {
  max-width: 680px;
}

.work-block-title {
  font-size: 26px !important;
  line-height: 1.25;
}

.work-block-meta {
  font-family: var(--font-body);
  font-size: 14px !important;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-sm);
  line-height: var(--leading-ui);
}

.work-block-description {
  font-family: var(--font-body);
  font-size: 22px !important;
  line-height: 1.7 !important;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.full-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.full-bleed img {
  width: 100%;
  height: 60vh;
  object-fit: cover;
  display: block;
}

.work-block a.work-link,
.work-block .work-link,
.work-link {
  font-family: var(--font-body);
  font-size: 16px !important;
  line-height: 1.5;
}

.about-content p {
  font-size: 22px !important;
  line-height: 1.8 !important;
}

.contact-content p {
  font-size: 22px !important;
  line-height: 1.8 !important;
}

/* Page Headings (h1 and h2 size increases) */
.page-title, .project-title, .essay-title {
  font-size: 36px !important;
}

.about-content h2, .calendar-entry h2 {
  font-size: 24px !important;
  line-height: 1.2 !important;
}

/* Writing-page list entries */
.writing-entry {
  line-height: 1.6;
}

.writing-entry a {
  font-size: 26px !important;
  line-height: 1.25;
}

.writing-entry .writing-date {
  font-size: 14px !important;
  color: var(--color-text-muted);
}

.writing-entry .writing-description {
  font-size: 18px !important;
  color: var(--color-text);
}

/* Secondary links */
.back-link {
  font-size: 18px !important;
}

/* Calendar Styles */
.calendar-date {
  font-size: 18px !important;
  line-height: 1.6 !important;
}

.calendar-title {
  font-size: 26px !important;
  line-height: 1.2 !important;
}

.calendar-venue {
  font-size: 20px !important;
  line-height: 1.6 !important;
}

.calendar-desc {
  font-size: 22px !important;
  line-height: 1.6 !important;
}

.calendar-link {
  font-size: 18px !important;
  line-height: 1.6 !important;
}

/* Newsletter Signup Capture Block */
.signup-block {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.signup-heading {
  font-family: var(--font-nav);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.signup-text {
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  line-height: var(--leading-body);
}

.signup-form {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  align-items: flex-end;
}

.signup-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid #555555;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 22px;
  padding: var(--space-xs) 0;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.signup-input:focus {
  border-bottom-color: var(--color-hover);
  outline: none;
}

.signup-button {
  background: transparent;
  border: 1px solid #555555;
  font-family: var(--font-nav);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--color-text);
  cursor: pointer;
  padding: 10px 20px;
  transition: color 200ms ease, border-color 200ms ease;
  white-space: nowrap;
}

.signup-button:hover {
  color: var(--color-hover);
  border-color: var(--color-hover);
}

.hidden-field {
  display: none;
}

@media (max-width: 480px) {
  .signup-form {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
  }
  
  .signup-button {
    width: 100%;
    text-align: center;
  }
}

.signup-rss {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  line-height: var(--leading-ui);
}

.signup-rss a {
  color: var(--color-accent);
  text-decoration: underline;
}

.signup-rss a:hover {
  color: var(--color-hover);
}
