/* ===== Corsa La Corsa — Typewriter Edition ===== */

:root {
  --paper: #f5f1e6;
  --paper-alt: #ece5d2;
  --ink: #1a1712;
  --muted: #5c5648;
  --accent: #a4402f;
  --line: #1a1712;
  --white: #fffdf7;
  --font-display: 'Special Elite', 'Courier New', monospace;
  --font-body: 'Courier Prime', 'Courier New', monospace;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #f0e9d8;
  background-image:
    repeating-linear-gradient(0deg, rgba(26,23,18,0.045) 0px, rgba(26,23,18,0.045) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(26,23,18,0.045) 0px, rgba(26,23,18,0.045) 1px, transparent 1px, transparent 3px);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 0.5em;
  line-height: 1.25;
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.container-full {
  max-width: none;
  margin: 0;
  padding: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ===== Buttons ===== */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-4px);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ===== Header ===== */

header {
  border-bottom: 2px solid var(--line);
  padding: 22px 0;
  background: var(--paper);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  max-width: none;
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

.logo {
  font-family: 'Yellowtail', cursive;
  font-size: 1.9rem;
  color: var(--ink);
}

.header-boat {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  color: var(--ink);
  cursor: pointer;
}

.header-wave-path {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.boat-shape {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.header-boat:hover .header-wave-path {
  opacity: 1;
  animation: wave-flow 1.4s ease-in-out infinite;
}

.header-boat:hover .boat-shape {
  animation: sail-bob 1.4s ease-in-out infinite;
}

@keyframes sail-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-2px) rotate(4deg); }
}

@keyframes wave-flow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(1.5px); }
}

@media (max-width: 640px) {
  .logo {
    font-size: 1.15rem;
  }

  .header-boat {
    display: none;
  }
}

.header-boat svg {
  width: 100%;
  height: 100%;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 60;
}

.nav-toggle span {
  width: 32px;
  height: 3px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.main-nav {
  position: absolute;
  top: 100%;
  right: 20px;
  margin-top: 14px;
  background: var(--paper);
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 30px;
  gap: 20px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  z-index: 55;
}

.main-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.main-nav a {
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* ===== Page banner ===== */

.page-banner {
  padding: 70px 0;
  border-bottom: 2px solid var(--line);
}

.page-banner h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.page-banner p {
  max-width: 560px;
  color: var(--muted);
}

/* ===== Hero (home) ===== */

.hero {
  padding: 56px 0 60px;
  background-image: linear-gradient(180deg, rgba(20,18,14,0.5), rgba(20,18,14,0.8)), url('../images/vespa-harbor.jpg');
  background-size: cover;
  background-position: center;
}

.hero .container {
  padding-left: 20px;
  padding-right: 20px;
}

.hero .dateline {
  font-size: 0.85rem;
  color: rgba(245, 241, 230, 0.8);
  margin-bottom: 24px;
}

.typewriter-line {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.3;
  max-width: 760px;
}

h1.typewriter-line {
  font-family: var(--font-body);
  font-weight: 700;
}

.hero .typewriter-line {
  color: var(--white);
}

.hero .lead {
  max-width: 680px;
  color: rgba(245, 241, 230, 0.85);
  font-size: 1.02rem;
  margin: 26px 0 18px;
}

.hero .btn-outline,
.hero .btn-primary {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}

.hero .btn-outline:hover,
.hero .btn-primary:hover {
  background: var(--white);
  color: var(--ink);
}

.hero-motto {
  font-family: var(--font-display);
  font-style: normal;
  color: var(--accent);
  font-size: 1rem;
  margin: 0 0 30px;
}

.typewriter-line-small {
  max-width: none;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-fade-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-fade-item.is-in {
  opacity: 1;
  transform: translateY(0);
}

.hero-fade-item:nth-child(1) { transition-delay: 0.1s; }
.hero-fade-item:nth-child(2) { transition-delay: 0.25s; }
.hero-fade-item:nth-child(3) { transition-delay: 0.4s; }
.hero-fade-item:nth-child(4) { transition-delay: 0.55s; }

/* ===== Sections ===== */

.section {
  padding: 80px 0;
  border-bottom: 2px solid var(--line);
}

.section:last-of-type {
  border-bottom: none;
}

.corsa-coffee-section {
  border-bottom: none;
}

.section-alt {
  background: var(--paper-alt);
}

.section-head {
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: 1.6rem;
}

.section-head .dateline {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 14px;
}

.section-head p {
  color: var(--muted);
  max-width: 560px;
  margin: 0;
}

/* ===== Numbered list ===== */

.numbered-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.numbered-list li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.numbered-list li:last-child {
  border-bottom: 1px solid var(--line);
}

/* ===== Explore tiles (What We Do) ===== */

.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: var(--ink);
  font-size: 0;
}

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

.explore-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: none;
  opacity: 0;
  transform: translateY(14px);
}

.explore-grid .explore-tile:not(:first-child) {
  margin-left: -1px;
}

.explore-tile-media {
  position: absolute;
  inset: -2px;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
}

.explore-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,18,14,0) 45%, rgba(20,18,14,0.75));
  pointer-events: none;
}

.explore-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 18px 20px 20px;
  color: var(--white);
}

.explore-tile-label h3 {
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.explore-tile-label span {
  font-family: var(--font-body);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.explore-tile-1 { background-image: linear-gradient(155deg, #8a9a8c, #3a4a3a); }
.explore-tile-2 { background-image: linear-gradient(155deg, #a4402f, #5c2016); }
.explore-tile-3 { background-image: linear-gradient(155deg, #d8c58a, #8a7440); }
.explore-tile-4 { background-image: linear-gradient(155deg, #8a7458, #3a2e1c); }
.explore-tile-5 { background-image: linear-gradient(155deg, #4a6b7a, #1c2e36); }
.explore-tile-6 { background-image: linear-gradient(155deg, #6b5a7a, #2a2036); }

.numbered-list li.is-in {
  opacity: 1;
  transform: translateY(0);
}

.numbered-list .num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.95rem;
}

.numbered-list h3 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.numbered-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== Card grid ===== */

.grid {
  display: grid;
  gap: 24px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.box {
  border: 2px solid var(--line);
  padding: 28px 24px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.box.is-in {
  opacity: 1;
  transform: translateY(0);
}

.box h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ===== Packages ===== */

.package {
  border: 2px solid var(--line);
  padding: 34px 28px;
}

.package.featured {
  border-width: 3px;
  border-color: var(--accent);
}

.package .tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}

.package h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.package ul {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
}

.package li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.package li:last-child {
  border-bottom: 1px solid var(--line);
}

/* ===== Gallery ===== */

.gallery-item {
  aspect-ratio: 1 / 1;
  border: 2px solid var(--line);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.gallery-item:hover img {
  filter: grayscale(0);
  transform: scale(1.03);
}

.gallery-item.plain {
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--muted);
  background: var(--paper-alt);
}

.gallery-item span {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.gallery-note {
  margin-top: 30px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== Book / FlashQuotes embed section ===== */

.book-section {
  border-bottom: 2px solid var(--line);
  padding: 80px 0;
}

.book-frame {
  border: 2px solid var(--line);
  padding: 30px;
  background: var(--white);
}

/* ===== CTA band ===== */

.cta-band {
  padding: 80px 0;
  text-align: center;
  border-bottom: 2px solid var(--line);
}

.cta-band h2 {
  font-size: 1.7rem;
  margin-bottom: 16px;
}

.cta-band p {
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

/* ===== Contact ===== */

.contact-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-success {
  display: none;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 18px 20px;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.form-success.is-visible {
  display: block;
}

.contact-info {
  border: 2px solid var(--line);
  padding: 34px 28px;
}

.contact-info h3 {
  font-size: 1.2rem;
}

.contact-info-item {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.contact-info-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.contact-info-item .label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ===== About ===== */

.story-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

@media (max-width: 860px) {
  .story-block { grid-template-columns: 1fr; }
}

.story-visual {
  border: 2px solid var(--line);
  aspect-ratio: 4/5;
  overflow: hidden;
}

.story-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.3);
}

.corsa-coffee-section .story-block {
  grid-template-columns: 1.15fr 0.85fr;
}

.coffee-video-visual {
  position: relative;
  aspect-ratio: 3/4;
}

.coffee-video-visual video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.coffee-book-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

@media (max-width: 860px) {
  .corsa-coffee-section .story-block {
    grid-template-columns: 1fr;
  }

  .coffee-video-visual {
    aspect-ratio: 4/5;
  }
}

.coffee-bold-line {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--ink);
  margin: 4px 0 20px;
}

.coffee-cursive-heading {
  margin: 0 0 6px;
  line-height: 0;
}

.coffee-cursive-heading svg {
  display: block;
  width: clamp(240px, 32vw, 460px);
  height: auto;
  overflow: visible;
}

.coffee-sig-letter {
  fill: var(--ink);
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coffee-reveal-item {
  opacity: 0;
  transform: translateY(28px);
}

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

footer {
  padding: 40px 0;
  border-top: 2px solid var(--line);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand p {
  max-width: 320px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--ink);
  font-size: 0.88rem;
}

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

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== Ambient sound toggle ===== */

#sound-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#sound-toggle:hover {
  transform: translateY(-2px);
}

#sound-toggle svg {
  width: 22px;
  height: 22px;
}

#sound-toggle .wave1,
#sound-toggle .wave2 {
  opacity: 0.25;
  transition: opacity 0.2s ease;
}

#sound-toggle.is-on {
  background: var(--ink);
  color: var(--paper);
}

#sound-toggle.is-on .wave1,
#sound-toggle.is-on .wave2 {
  opacity: 1;
  animation: soundPulse 1.6s ease-in-out infinite;
}

#sound-toggle.is-on .wave2 {
  animation-delay: 0.2s;
}

@keyframes soundPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#sound-toggle .mute-line {
  display: none;
}

#sound-toggle.is-muted .mute-line {
  display: block;
}

/* ===== Market / shop ===== */

.product-card {
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.product-card.is-in {
  opacity: 1;
  transform: translateY(0);
}

.product-media {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--line);
}

.product-icon {
  font-size: 2.6rem;
  filter: grayscale(1) brightness(2.2);
  opacity: 0.85;
}

.product-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-body h3 {
  font-size: 1rem;
  margin: 0;
}

.product-price {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1rem;
}

.product-sizes {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.add-to-cart {
  width: 100%;
  text-align: center;
}

.add-to-cart.is-added {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ===== Accessibility: visible keyboard focus ===== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
