/* ============================================
   drdavide.com — "The Bottega"
   ============================================ */

/* --- Font faces --- */

@font-face {
  font-family: 'CrimsonPro';
  src: url('../assets/fonts/crimson-pro-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'CrimsonPro';
  src: url('../assets/fonts/crimson-pro-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InstrumentSans';
  src: url('../assets/fonts/instrument-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'InstrumentSans';
  src: url('../assets/fonts/instrument-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBMPlexMono';
  src: url('../assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Custom properties --- */

:root {
  --void: #0E0E0E;
  --forge-orange: #E07020;
  --warm-white: #F0ECE6;
  --charcoal: #1a1a1a;
  --ash: #666666;
  --ember: rgba(224, 112, 32, 0.08);

  --font-display: 'CrimsonPro', Georgia, 'Times New Roman', serif;
  --font-body: 'InstrumentSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBMPlexMono', 'Courier New', Courier, monospace;

  --section-pad: clamp(5rem, 12vw, 9rem);
  --content-max: 1100px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset --- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--void);
  color: var(--warm-white);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.65;
  overflow-x: hidden;
}

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

a {
  color: var(--warm-white);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* --- Shared section styles --- */

.section__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--section-pad) 1.5rem;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--forge-orange);
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

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

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero__waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3rem, 6vw, 6rem);
  max-width: var(--content-max);
  width: 100%;
  padding: 2rem 1.5rem;
}

.hero__text {
  flex: 1;
  min-width: 0;
}

.hero__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--warm-white);
  opacity: 0;
  transform: translateY(30px);
}

.hero__tagline {
  margin-top: 1.25rem;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--ash);
  font-style: italic;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
}

.hero__portrait {
  flex-shrink: 0;
  width: clamp(220px, 25vw, 340px);
  opacity: 0;
  transform: scale(0.95);
}

.hero__portrait img {
  border-radius: 6px;
  filter: grayscale(20%) sepia(12%) brightness(0.92) contrast(1.05);
  transition: filter 0.6s ease;
}

.hero__portrait img:hover {
  filter: grayscale(0%) sepia(0%) brightness(1) contrast(1);
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  z-index: 1;
}

.hero__scroll-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ash);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: var(--forge-orange);
  transform-origin: top;
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 0.7; }
}

/* ============================================
   THE ARC
   ============================================ */

.arc {
  background: var(--void);
}

.arc__timeline {
  position: relative;
  padding-left: 3rem;
}

.arc__line {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--charcoal);
}

.arc__milestone {
  position: relative;
  padding-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(30px);
}

.arc__milestone:last-child {
  padding-bottom: 0;
}

.arc__dot {
  position: absolute;
  left: -3rem;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--void);
  border: 2px solid var(--forge-orange);
  transform: translateX(-0.5px);
}

.arc__milestone:last-child .arc__dot {
  background: var(--forge-orange);
}

.arc__year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--forge-orange);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5rem;
}

.arc__content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  color: var(--warm-white);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.arc__content p {
  color: var(--ash);
  max-width: 520px;
  line-height: 1.6;
}

/* ============================================
   MUSIC
   ============================================ */

.music {
  background: var(--charcoal);
}

.music__text {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ash);
  margin-bottom: 3rem;
  line-height: 1.7;
}

.harmonic-field {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 180px;
  padding: 0 1rem;
  margin-bottom: 3rem;
}

.harmonic-field__key {
  width: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--ash);
  opacity: 0.2;
  height: var(--key-height, 50%);
  animation: breathe 4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.harmonic-field__key--played {
  background: var(--forge-orange);
  opacity: 0.6;
}

@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

.music__note {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ash);
  font-style: italic;
}

/* ============================================
   WRITING
   ============================================ */

.writing {
  background: var(--void);
}

.writing__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.writing__card {
  display: block;
  background: var(--charcoal);
  border: 1px solid rgba(240, 236, 230, 0.06);
  border-radius: 6px;
  padding: 1.75rem;
  transition: transform 0.35s var(--ease-out), border-color 0.35s ease;
  opacity: 0;
  transform: translateY(20px);
}

.writing__card:hover {
  transform: translateY(-3px);
  border-color: rgba(224, 112, 32, 0.3);
  color: var(--warm-white);
}

.writing__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ash);
  letter-spacing: 0.04em;
}

.writing__card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--warm-white);
  margin: 0.5rem 0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.writing__card:hover .writing__card-title {
  color: var(--forge-orange);
}

.writing__excerpt {
  font-size: 0.95rem;
  color: var(--ash);
  line-height: 1.55;
}

.writing__more {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--forge-orange);
  letter-spacing: 0.02em;
  display: inline-block;
  position: relative;
}

.writing__more::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--forge-orange);
  transition: width 0.35s var(--ease-out);
}

.writing__more:hover {
  color: var(--forge-orange);
}

.writing__more:hover::after {
  width: 100%;
}

/* ============================================
   THE FORGE
   ============================================ */

.forge {
  background:
    radial-gradient(ellipse at 50% 80%, var(--ember), transparent 60%),
    var(--charcoal);
}

.forge .section__inner {
  text-align: center;
  max-width: 700px;
}

.forge__logo {
  margin: 0 auto 2rem;
  opacity: 0.9;
}

.forge__text {
  font-size: clamp(1.05rem, 1.5vw, 1.15rem);
  color: var(--warm-white);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.forge__stats {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--forge-orange);
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
}

.forge__cta {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--warm-white);
  border: 1px solid var(--forge-orange);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  display: inline-block;
  transition: background 0.3s ease, color 0.3s ease;
}

.forge__cta:hover {
  background: var(--forge-orange);
  color: var(--void);
}

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

.contact {
  background: var(--void);
  border-top: 1px solid rgba(240, 236, 230, 0.06);
}

.contact .section__inner {
  text-align: center;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-bottom: 2rem;
}

.contact__links a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ash);
  transition: color 0.3s ease;
}

.contact__links a:hover {
  color: var(--forge-orange);
}

.contact__location {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ash);
  margin-bottom: 3rem;
  letter-spacing: 0.04em;
}

.contact__motto {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--forge-orange);
  margin-bottom: 0.5rem;
}

.contact__translation {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ash);
}

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

/* Tablet+ */
@media (min-width: 768px) {
  .writing__grid {
    grid-template-columns: 1fr 1fr;
  }

  .section__inner {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .arc__timeline {
    padding-left: 4rem;
  }

  .harmonic-field {
    height: 220px;
    gap: 4px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .hero__inner {
    padding: 0 2.5rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
    padding-top: 8rem;
  }

  .hero__portrait {
    width: 200px;
    order: -1;
  }

  .hero__scroll {
    bottom: 1.5rem;
  }

  .hero__scroll-line {
    height: 28px;
  }

  .contact__links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ============================================
   UTILITY: Revealed state (set by JS)
   ============================================ */

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__waves {
    display: none;
  }

  .hero__name,
  .hero__tagline,
  .hero__portrait,
  .hero__scroll,
  .arc__milestone,
  .writing__card {
    opacity: 1;
    transform: none;
  }
}

/* High contrast */
@media (forced-colors: active) {
  .arc__dot {
    border-color: CanvasText;
  }

  .writing__card {
    border-color: CanvasText;
  }
}
