/* ==============================================
   ARQUEBUS — Typography + Motion
   Unique animations: stroke draw, char reveal, marquee
   ============================================== */

:root {
  --bg: #FFFFFF;
  --bg-alt: #FFFFFF;
  --fg: #2C2824;
  --fg-muted: #5A534C;
  --fg-faint: #8A837A;
  --accent: #4A6B5C;
  --accent-light: #5A7B6C;
  --border: #C8C2B8;

  --font-serif: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
  --font-sans: 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;

  --space: clamp(1rem, 4vw, 2rem);
  --space-lg: clamp(3rem, 8vw, 6rem);
  --max-w: 1100px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
input, textarea, button { font: inherit; }

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

/* ==============================================
   HEADER
   ============================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space) calc(var(--space) * 1.5);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  display: flex;
  align-items: center;
}

.logo-icon {
  height: 32px;
  width: auto;
  transition: opacity 0.3s ease;
}

.site-logo:hover .logo-icon {
  opacity: 0.7;
}

.site-nav {
  display: flex;
  gap: calc(var(--space) * 1.5);
}

.site-nav a {
  font-size: 0.875rem;
  color: var(--fg-muted);
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ==============================================
   HERO
   ============================================== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--space-lg) + 80px) calc(var(--space) * 1.5) var(--space-lg);
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.2s forwards;
}

.hero-tag, .hero-year {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

/* Character-by-character animation */
.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: auto 0;
  padding: var(--space-lg) 0;
}

.char-wrap {
  display: block;
  overflow: hidden;
}

.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: charReveal 0.5s ease forwards;
}

/* Staggered character delays - "Igniting the" (12 chars) */
.char-wrap:nth-child(1) .char:nth-child(1) { animation-delay: 0.3s; }
.char-wrap:nth-child(1) .char:nth-child(2) { animation-delay: 0.34s; }
.char-wrap:nth-child(1) .char:nth-child(3) { animation-delay: 0.38s; }
.char-wrap:nth-child(1) .char:nth-child(4) { animation-delay: 0.42s; }
.char-wrap:nth-child(1) .char:nth-child(5) { animation-delay: 0.46s; }
.char-wrap:nth-child(1) .char:nth-child(6) { animation-delay: 0.5s; }
.char-wrap:nth-child(1) .char:nth-child(7) { animation-delay: 0.54s; }
.char-wrap:nth-child(1) .char:nth-child(8) { animation-delay: 0.58s; }
.char-wrap:nth-child(1) .char:nth-child(9) { animation-delay: 0.62s; }
.char-wrap:nth-child(1) .char:nth-child(10) { animation-delay: 0.66s; }
.char-wrap:nth-child(1) .char:nth-child(11) { animation-delay: 0.7s; }
.char-wrap:nth-child(1) .char:nth-child(12) { animation-delay: 0.74s; }

/* "spark of" (8 chars) */
.char-wrap:nth-child(2) .char:nth-child(1) { animation-delay: 0.81s; }
.char-wrap:nth-child(2) .char:nth-child(2) { animation-delay: 0.85s; }
.char-wrap:nth-child(2) .char:nth-child(3) { animation-delay: 0.89s; }
.char-wrap:nth-child(2) .char:nth-child(4) { animation-delay: 0.93s; }
.char-wrap:nth-child(2) .char:nth-child(5) { animation-delay: 0.97s; }
.char-wrap:nth-child(2) .char:nth-child(6) { animation-delay: 1.01s; }
.char-wrap:nth-child(2) .char:nth-child(7) { animation-delay: 1.05s; }
.char-wrap:nth-child(2) .char:nth-child(8) { animation-delay: 1.09s; }

/* "adoption." (9 chars) */
.char-wrap:nth-child(3) .char:nth-child(1) { animation-delay: 1.16s; }
.char-wrap:nth-child(3) .char:nth-child(2) { animation-delay: 1.2s; }
.char-wrap:nth-child(3) .char:nth-child(3) { animation-delay: 1.24s; }
.char-wrap:nth-child(3) .char:nth-child(4) { animation-delay: 1.28s; }
.char-wrap:nth-child(3) .char:nth-child(5) { animation-delay: 1.32s; }
.char-wrap:nth-child(3) .char:nth-child(6) { animation-delay: 1.36s; }
.char-wrap:nth-child(3) .char:nth-child(7) { animation-delay: 1.4s; }
.char-wrap:nth-child(3) .char:nth-child(8) { animation-delay: 1.44s; }
.char-wrap:nth-child(3) .char:nth-child(9) { animation-delay: 1.48s; }

@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Spark word styling - ember glow effect */
.char.spark {
  color: #D4582A;
  text-shadow: 0 0 20px rgba(212, 88, 42, 0.3);
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

/* Hero Logo */
.hero-logo-large {
  opacity: 0;
  animation: fadeIn 0.6s ease 1.5s forwards;
}

.hero-logo-img {
  height: 60px;
  width: auto;
  opacity: 0.4;
}

.scroll-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  opacity: 0;
  animation: fadeIn 0.6s ease 1.8s forwards;
  transition: color 0.2s;
}

.scroll-cta:hover {
  color: var(--accent);
}

.arrow-down {
  font-size: 1.25rem;
  animation: bounce 2s ease infinite;
  animation-delay: 2.5s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ==============================================
   MARQUEE
   ============================================== */

.marquee {
  background: var(--fg);
  color: var(--bg);
  padding: 1rem 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marqueeScroll 20s linear infinite;
}

.marquee-track span {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ==============================================
   SECTIONS
   ============================================== */

.section {
  padding: var(--space-lg) calc(var(--space) * 1.5);
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.section-label {
  display: flex;
  align-items: center;
  gap: var(--space);
  margin-bottom: calc(var(--space) * 2);
}

.label-num {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-faint);
}

.label-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s ease;
}

.section.visible .label-line {
  transform: scaleX(1);
}

.label-text {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}

/* ==============================================
   SLIDE-IN ANIMATIONS
   ============================================== */

.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}

.section.visible .slide-in-left,
.section.visible .slide-in-right {
  opacity: 1;
  transform: translateX(0);
}

/* Clip-path reveal */
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s ease;
}

.section.visible .clip-reveal {
  clip-path: inset(0 0% 0 0);
}

/* ==============================================
   PROJECT
   ============================================== */

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--space) * 3);
  align-items: start;
}

.project-header {
  margin-bottom: var(--space);
}

.project-meta {
  display: flex;
  gap: var(--space);
  font-size: 0.8125rem;
  color: var(--fg-faint);
  margin-bottom: var(--space);
}

.project-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.project-type {
  font-size: 1rem;
  color: var(--accent);
  font-style: italic;
}

.project-desc {
  color: var(--fg-muted);
  margin-bottom: var(--space);
  max-width: 42ch;
}

.project-list {
  margin-bottom: calc(var(--space) * 1.5);
}

.project-list li {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.project-list li:last-child { border-bottom: none; }

.project-actions {
  display: flex;
  align-items: center;
  gap: var(--space);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: var(--fg);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.text-link {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  transition: color 0.2s;
}

.text-link:hover { color: var(--accent); }

/* Project Image */
.project-image {
  margin: 0;
}

.image-frame {
  background: var(--bg-alt);
  padding: var(--space);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.mock-window {
  background: var(--fg);
  border-radius: 6px;
  overflow: hidden;
}

.mock-bar {
  display: flex;
  gap: 5px;
  padding: 0.6rem 0.75rem;
  background: #2A2A2A;
}

.mock-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4A4A4A;
}

.mock-bar i:nth-child(1) { background: #FF605C; }
.mock-bar i:nth-child(2) { background: #FFBD44; }
.mock-bar i:nth-child(3) { background: #00CA4E; }

.mock-content {
  display: grid;
  grid-template-columns: 40px 1fr;
  min-height: 180px;
}

.mock-sidebar {
  background: #2A2A2A;
  border-right: 1px solid #3A3A3A;
}

.mock-main {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mock-stat {
  height: 1.5rem;
  width: 60%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 3px;
  opacity: 0.7;
}

.mock-chart {
  height: 40px;
  background: linear-gradient(90deg, #3A3A3A 0%, #2A2A2A 100%);
  border-radius: 3px;
}

.mock-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mock-rows span {
  height: 8px;
  background: #3A3A3A;
  border-radius: 2px;
}

.mock-rows span:nth-child(1) { width: 100%; }
.mock-rows span:nth-child(2) { width: 75%; }
.mock-rows span:nth-child(3) { width: 50%; }

/* ==============================================
   ABOUT
   ============================================== */

.section-about {
  background: var(--bg-alt);
  max-width: none;
  border-top: none;
}

.section-about .section-label,
.about-content {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.about-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--fg);
  max-width: 36ch;
  margin-bottom: calc(var(--space) * 2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--space) * 3);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.about-text p {
  color: var(--fg-muted);
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: var(--space);
  border-left: 2px solid var(--accent);
}

.about-facts li {
  font-size: 0.9375rem;
  color: var(--fg-muted);
}

.about-facts strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--fg);
}

/* ==============================================
   CONTACT
   ============================================== */

.contact-content {
  max-width: 600px;
}

.contact-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.contact-sub {
  color: var(--fg-muted);
  margin-bottom: calc(var(--space) * 2);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space);
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form label span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.contact-form input,
.contact-form textarea {
  padding: 0.875rem 1rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 107, 92, 0.15);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  align-self: flex-start;
  margin-top: 0.5rem;
}

.btn-submit.success {
  background: var(--accent);
}

/* ==============================================
   FOOTER
   ============================================== */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space) calc(var(--space) * 1.5);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo-img {
  height: 24px;
  width: auto;
  opacity: 0.5;
}

/* ==============================================
   ANIMATIONS
   ============================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 900px) {
  .project {
    grid-template-columns: 1fr;
  }

  .project-image {
    order: -1;
    margin-bottom: var(--space);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-facts {
    flex-direction: row;
    gap: var(--space);
    padding-left: 0;
    padding-top: var(--space);
    border-left: none;
    border-top: 2px solid var(--accent);
  }

  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space);
  }

  .hero-logo-large {
    order: 1;
  }
}

@media (max-width: 600px) {
  html { font-size: 16px; }

  .site-header {
    flex-direction: column;
    gap: var(--space);
    text-align: center;
  }

  .hero-top {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .about-facts {
    flex-direction: column;
  }

  .marquee-track {
    animation-duration: 12s;
  }
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
