/* ============================================
   Fish and Trail Oy — style.css
   Color palette: Earth & Water
   Typography: Libre Baskerville + Lato
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Colors */
  --color-primary: #4A6B7A;
  --color-primary-dark: #3A555F;
  --color-accent: #A0855B;
  --color-accent-light: #C4A97D;
  --color-bg-light: #F5F0EB;
  --color-bg-white: #FDFBF8;
  --color-dark-band: #2C3E44;
  --color-text: #2C2C2C;
  --color-text-secondary: #5A5550;
  --color-text-on-dark: #F0EDE8;

  /* Typography */
  --font-heading: 'Libre Baskerville', 'Georgia', serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing */
  --section-padding: 5rem 0;
  --container-max: 1100px;

  /* Transitions */
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul {
  list-style: none;
}

/* --- Utility Classes --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center {
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.3;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(74, 107, 122, 0.85);
  backdrop-filter: blur(8px);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav--scrolled {
  background: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
  z-index: 1001;
}

.nav__logo img {
  height: 8rem;
  width: auto;
}

.nav__links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav__links a {
  color: var(--color-text-on-dark);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}

.nav__links a:hover {
  color: var(--color-accent-light);
}

.nav__links a[target="_blank"],
.nav__overlay a[target="_blank"] {
  color: var(--color-accent-light);
}

.nav__links a[target="_blank"]:hover,
.nav__overlay a[target="_blank"]:hover {
  color: #fff;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-on-dark);
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__hamburger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger--open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-dark-band) 100%);
  overflow: hidden;
}

.hero--small {
  min-height: 50vh;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44, 62, 68, 0.55) 0%, rgba(44, 62, 68, 0.7) 100%);
  z-index: 1;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 60%;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem 1.5rem;
}

.hero__title {
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero__subtitle {
  color: var(--color-text-on-dark);
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero__cta {
  display: inline-block;
  color: var(--color-accent-light);
  font-weight: 600;
  font-size: 1.0625rem;
  border-bottom: 2px solid var(--color-accent-light);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}

.hero__cta:hover {
  color: #fff;
  border-color: #fff;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
}

.hero__scroll-indicator span {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-text-on-dark);
  border-bottom: 2px solid var(--color-text-on-dark);
  transform: rotate(45deg);
  opacity: 0.5;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(10px); }
  60% { transform: translateX(-50%) translateY(5px); }
}

/* --- Sections --- */
.section {
  padding: var(--section-padding);
}

.section--light {
  background-color: var(--color-bg-light);
}

.section--white {
  background-color: var(--color-bg-white);
}

.section--dark {
  background-color: var(--color-dark-band);
  color: var(--color-text-on-dark);
}

.section--dark h2,
.section--dark h3 {
  color: var(--color-text-on-dark);
}

.section__heading {
  text-align: center;
  margin-bottom: 3rem;
}

/* --- Ydinlupaus (Core Promise) --- */
.core-promise {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 6rem 1.5rem;
}

.core-promise h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.core-promise p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
}

/* --- Service Cards --- */
.services__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.services__card {
  background: var(--color-bg-white);
  border-left: 4px solid var(--color-accent);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: box-shadow var(--transition), transform var(--transition);
}

.services__card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.services__card h3 {
  color: var(--color-primary);
}

.services__card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

.services__link {
  display: inline-block;
  font-weight: 600;
  color: var(--color-accent);
  transition: color var(--transition);
}

.services__link:hover {
  color: var(--color-accent-light);
}

/* --- Differentiator --- */
.differentiator {
  padding: 5rem 1.5rem;
  text-align: center;
}

.differentiator__quote {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.differentiator__text {
  max-width: 650px;
  margin: 0 auto;
  color: var(--color-text-on-dark);
  opacity: 0.85;
}

/* --- Reference Cards --- */
.references__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.reference-card {
  background: var(--color-bg-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: box-shadow var(--transition), transform var(--transition);
}

.reference-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.reference-card__image {
  width: 100%;
  height: 200px;
  background: var(--color-bg-light);
  border: 2px dashed var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.reference-card__body {
  padding: 1.5rem;
}

.reference-card__body h3 {
  margin-bottom: 0.5rem;
}

.reference-card__body p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.reference-card__link {
  font-weight: 600;
  color: var(--color-accent);
  transition: color var(--transition);
}

.reference-card__link:hover {
  color: var(--color-accent-light);
}

/* --- Rahoitus --- */
.rahoitus__content {
  max-width: 750px;
}

.rahoitus__content ul {
  margin: 1rem 0 1.5rem 0;
}

.rahoitus__content li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-secondary);
}

.rahoitus__content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
}

.rahoitus__highlight {
  font-weight: 600;
  color: var(--color-primary);
  font-style: italic;
}

/* --- Contact --- */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact__info h3 {
  margin-bottom: 1rem;
}

.contact__info p {
  margin-bottom: 0.5rem;
}

.contact__info a {
  color: var(--color-accent);
  font-weight: 500;
}

.contact__info a:hover {
  color: var(--color-accent-light);
}

/* --- Footer --- */
.footer {
  background: var(--color-primary-dark);
  color: var(--color-text-on-dark);
  padding: 2.5rem 0 1.5rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Logo + contact side by side */
.footer__left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer__brand {
  flex-shrink: 0;
}

.footer__brand img {
  height: 5.5rem;
  width: auto;
}

.footer__contact p {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.footer__links a {
  color: var(--color-text-on-dark);
  font-size: 0.875rem;
  opacity: 0.8;
  transition: opacity var(--transition);
}

.footer__links a:hover {
  opacity: 1;
  color: var(--color-accent-light);
}

.footer__links a[target="_blank"] {
  color: var(--color-accent-light);
  opacity: 1;
}

.footer__bottom {
  border-top: 1px solid rgba(240, 237, 232, 0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.6;
}

/* --- Yrittaja Page --- */
.bio {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
}

.bio__image {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.bio__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.bio__text h2 {
  margin-bottom: 1rem;
}

.bio__text p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

/* --- Blockquote --- */
.blockquote {
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  background: var(--color-bg-white);
  border-radius: 0 6px 6px 0;
}

.blockquote p {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 0;
}

/* --- Referenssit Page --- */
.project {
  margin-bottom: 4rem;
}

.project:last-child {
  margin-bottom: 0;
}

.project h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

.project p {
  max-width: 800px;
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

/* Gallery: hero image + 2 smaller below */
.project__gallery {
  margin-top: 2rem;
}

.project__hero-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  margin-bottom: 1rem;
}

.project__gallery-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.project__gallery-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: box-shadow var(--transition), transform var(--transition);
}

.project__gallery-img:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.project__hero-image:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  transition: box-shadow var(--transition);
}

/* For map images — contain instead of cover */
.project__gallery-img--contain {
  object-fit: contain;
  background: var(--color-bg-white);
  padding: 0.5rem;
}

/* Subsection within a project */
.project__subsection {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(160, 133, 91, 0.2);
}

.project__subsection h3 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.project__subsection p {
  margin-bottom: 1.5rem;
}

/* Rotated images (wrong EXIF orientation) */
.project__gallery-img--rotate90 {
  object-position: center center;
  transform: rotate(90deg);
  /* Scale up to fill the container after rotation */
  scale: 1.6;
}

/* Video thumbnail link */
.project__video-link {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: box-shadow var(--transition), transform var(--transition);
}

.project__video-link:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
}

.project__video-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.project__video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  transition: opacity var(--transition), transform var(--transition);
}

.project__video-link:hover .project__video-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.project__image-placeholder {
  height: 260px;
  background: var(--color-bg-light);
  border: 2px dashed var(--color-accent-light);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-top: 2rem;
  transition: color var(--transition);
}

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

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile Menu Overlay --- */
.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 68, 0.95);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.nav__overlay--open {
  display: flex;
}

.nav__overlay a {
  color: var(--color-text-on-dark);
  font-size: 1.25rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav__overlay a:hover {
  color: var(--color-accent-light);
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 2000;
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablet */
@media (max-width: 1023px) {
  h1 {
    font-size: 2.5rem;
  }

  .hero__title {
    font-size: 2.5rem;
  }

  .bio {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }

  .contact__grid {
    gap: 2rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --section-padding: 3rem 0;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.625rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .core-promise {
    padding: 3.5rem 1.5rem;
  }

  .core-promise h2 {
    font-size: 1.625rem;
  }

  .differentiator__quote {
    font-size: 1.625rem;
  }

  /* Nav */
  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: block;
  }

  /* Grids */
  .services__grid,
  .references__grid,
  .project__gallery-row {
    grid-template-columns: 1fr;
  }

  .project__hero-image {
    height: 220px;
  }

  .project__gallery-img {
    height: 200px;
  }

  /* Contact */
  .contact__grid {
    grid-template-columns: 1fr;
  }

  /* Bio */
  .bio {
    grid-template-columns: 1fr;
  }

  .bio__image {
    max-width: 280px;
    margin: 0 auto;
  }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__left {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}