/* =========================================================
   Mio Senzaki — portfolio styles
   Change the colors and fonts in :root to restyle the site.
   ========================================================= */

:root {
  /* Palette: Desert sand */
  --bg: #F5EFE8;        /* page background */
  --text: #2B2320;      /* main text */
  --accent: #9A6B52;    /* sand: links, small labels */
  --muted: #6E5B5E;     /* mauve: secondary text */
  --line: #E3D9CE;      /* thin dividers */
  --panel: #EAE1D6;     /* light label panels on Locations cards */

  --font: 'Jost', system-ui, sans-serif;

  --max-width: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-height: 72px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

/* Sections land below the fixed header when jumped to */
section { scroll-margin-top: var(--header-height); }

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--header-height);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  transition: background .4s, color .4s, box-shadow .4s;
}

/* Added by JS once you scroll past the hero */
.site-header.scrolled {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
}

.logo {
  position: relative;
  z-index: 2;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.site-nav { display: flex; gap: 32px; }

.site-nav a {
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: 1;
  transition: opacity .2s;
  position: relative;
  padding: 6px 0;
}

/* Thin underline under the current tab (and on hover) */
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: .2em; /* skip the letter-spacing after the last letter */
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform .3s ease;
}

.site-nav a:hover { opacity: 1; }

.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }

.site-nav a.active { opacity: 1; }

.menu-toggle { display: none; }

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

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  color: #fff;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Soft dark wash so white text is readable on any photo */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 16, .22);
}

.hero-text {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--gutter);
}

.hero h1 {
  font-weight: 300;
  font-size: clamp(32px, 7vw, 76px);
  letter-spacing: .25em;
  /* letter-spacing adds space after the last letter too; this re-centres it */
  margin-right: -.25em;
  text-transform: uppercase;
  line-height: 1.1;
}

.hero-text p {
  margin-top: 16px;
  font-size: clamp(15px, 1.8vw, 19px);
  letter-spacing: .3em;
  text-transform: uppercase;
}

.scroll-hint {
  position: absolute;
  z-index: 1;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  opacity: .8;
}

.scroll-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 36px;
  margin: 10px auto 0;
  background: currentColor;
}

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

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px var(--gutter);
}

.section-title {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 48px;
}

.lead {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 300;
  line-height: 1.4;
  margin-bottom: 24px;
}

/* ============ SHOWREELS ============ */

.showreels {
  display: grid;
  gap: 80px;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--line);
}

.video iframe,
.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Shown until a Vimeo ID is filled in */
.video:empty::before {
  content: 'Video goes here';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
}

.showreel h3 {
  margin-top: 20px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.meta {
  font-size: 17px;
  color: var(--muted);
}

/* ============ PHOTOS ============ */

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

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.gallery figure { cursor: zoom-in; }

.gallery img {
  width: 100%;
  height: auto;
}

/* Compact photo grid: three across, all the same shape (used where
   clips are the main feature, e.g. South Africa) */
.gallery-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-grid img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Pairs get matching heights so they line up neatly */
.pair img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

figcaption {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  letter-spacing: .05em;
}

/* ============ LOCATIONS (location cards) ============ */

.location-list {
  display: grid;
  gap: 24px;
}

/* Each card: photo (60%) + label panel (40%) side by side */
.location-card {
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 360px;
  overflow: hidden;
}

.location-card-image { overflow: hidden; }

.location-card-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 1.2s ease;
}

.location-card:hover .location-card-image img { transform: scale(1.03); }

.location-card-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  background: var(--panel);
  transition: background .4s;
}

.location-card-label h3 {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.location-card-label p {
  margin-top: 6px;
  font-size: 17px;
  letter-spacing: .15em;
  color: var(--muted);
}

/* Every second card flips: label on the left, dark panel */
.location-card:nth-child(even) { grid-template-columns: 2fr 3fr; }
.location-card:nth-child(even) .location-card-label {
  order: -1;
  background: var(--text);
  color: var(--bg);
}
.location-card:nth-child(even) .location-card-label p { color: #B8A89C; }

/* ============ LOCATION PAGES (locations/*.html) ============ */

.location-page { padding-top: calc(var(--header-height) + 64px); }

.back-link {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 14px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
}

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

.location-name {
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.15;
}

.location-year {
  margin-top: 8px;
  font-size: 17px;
  letter-spacing: .2em;
  color: var(--accent);
}

.location-note {
  margin: 24px 0 32px;
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}

/* Ocean / Desert jump links under the location intro */
.subnav {
  display: flex;
  gap: 32px;
  margin-bottom: 64px;
}

.subnav a {
  padding-bottom: 4px;
  font-size: 15px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}

.subnav a:hover { color: var(--text); border-color: var(--text); }

/* Stacked full-width clips; the first few show, "See more" reveals the
   rest. Each plays on hover; click opens it large. */
.clips-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
}

.clips-header .section-title { margin-bottom: 0; }

.clips-count {
  font-size: 16px;
  letter-spacing: .1em;
  color: var(--muted);
}

.clip-list {
  display: grid;
  gap: 40px;
}

.clip[hidden] { display: none; }

/* Outlined button, e.g. "See all 5 clips" */
.more-button {
  display: block;
  margin: 40px auto 0;
  padding: 14px 32px;
  font: inherit;
  font-size: 14px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: 1px solid var(--text);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.more-button:hover { color: var(--bg); background: var(--text); }

.clip {
  display: block;
  padding: 0;
  border: 0;
  overflow: hidden;
  font: inherit;
  background: var(--line);
  cursor: zoom-in;
}

.clip video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 1.2s ease;
}

.clip:hover video { transform: scale(1.03); }

/* Animal name under each clip, e.g. "Leopard · 4 shots" */
.clip-label {
  display: block;
  padding-top: 14px;
  font-size: 18px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text);
  background: var(--bg);
}

.clip-label span {
  letter-spacing: .05em;
  text-transform: none;
  color: var(--muted);
}

.photos-title {
  margin-top: 96px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

/* One group of photos (e.g. Ocean) on a location page */
.photo-group { scroll-margin-top: calc(var(--header-height) + 24px); }
.photo-group + .photo-group { margin-top: 96px; }

/* ============ INSTAGRAM ============ */

.instagram-title {
  margin-bottom: 48px;
  text-align: center;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 300;
  letter-spacing: .08em;
}

.instagram-title a {
  border-bottom: 1px solid currentColor;
  transition: color .2s;
}

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

.insta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.insta-post {
  position: relative;
  display: block;
  overflow: hidden;
}

/* Tall 9:16 tiles, the same shape as reels, so nothing gets cut off */
.insta-post img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  transition: transform .8s ease, filter .4s;
}

.insta-post:hover img {
  transform: scale(1.04);
  filter: brightness(.85);
}

/* Play triangle on reels, drawn with CSS borders */
.insta-post.reel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent rgba(255, 255, 255, .92);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .35));
  pointer-events: none;
}

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

.about-body p + p {
  margin-top: 20px;
  font-size: clamp(18px, 2vw, 21px);
  font-weight: 300;
  color: var(--muted);
}

.contact { border-top: 1px solid var(--line); }

/* Form on the left, email / Instagram on the right */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 80px;
}

.contact-form {
  display: grid;
  gap: 28px;
}

.contact-form fieldset {
  border: 0;
  min-width: 0;
}

.contact-form legend {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 400;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .03em;
}

.required { color: var(--muted); font-weight: 300; }

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid #CDBFB1;
  border-radius: 0;
  transition: border-color .2s, background .2s;
}

.field textarea { resize: vertical; min-height: 140px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
  background: rgba(255, 255, 255, .35);
}

/* Error message: hidden until JS marks the field as invalid */
.field-error {
  display: none;
  font-size: 14px;
  color: #A4473A;
}

.field.invalid input,
.field.invalid textarea { border-color: #A4473A; }

.field.invalid .field-error { display: block; }

.hidden-field { display: none; }

.button {
  justify-self: start;
  padding: 16px 48px;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  border: 0;
  cursor: pointer;
  transition: background .2s;
}

.button:hover { background: var(--accent); }

a.button { display: inline-block; white-space: nowrap; }

/* Short contact strip at the bottom of location pages */
.contact-band-layout {
  display: grid;
  gap: 24px;
  justify-items: start;
}

.contact-band .lead { max-width: 640px; margin-bottom: 0; }

.contact-band-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  color: var(--muted);
}

.contact-band-links a { transition: color .2s; }
.contact-band-links a:hover { color: var(--text); }

.button:disabled { opacity: .6; cursor: wait; }

.form-status { font-size: 16px; color: var(--muted); }
.form-status:empty { display: none; }

.contact-details {
  display: grid;
  align-content: start;
  gap: 32px;
}

.contact-label {
  margin-bottom: 4px;
  font-size: 14px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-details a {
  font-size: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}

.contact-details a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============ LIGHTBOX ============ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 15, 12, .94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img,
.lightbox video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox video { width: 100%; }

/* Only one of photo / clip shows at a time */
.lightbox img:not([src]),
.lightbox img[src=""],
.lightbox video:not([src]) { display: none; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
}

/* ============ GENTLE FADE-IN ON SCROLL ============ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease, transform .9s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============ PHONES & SMALL TABLETS ============ */

@media (max-width: 760px) {
  .section { padding: 48px var(--gutter); }

  .showreels { gap: 56px; }

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

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  a.button { padding: 16px 32px; }

  /* An odd photo out at the end spans the full width instead of
     leaving a gap beside it */
  .gallery-grid figure:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .clip-list { gap: 32px; }

  .location-card,
  .location-card:nth-child(even) { grid-template-columns: 1fr; min-height: 0; }

  .location-card:nth-child(even) .location-card-label { order: 0; }

  .location-card-label { padding: 24px; }

  .insta-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .contact-layout { grid-template-columns: 1fr; gap: 56px; }

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

  .button { justify-self: stretch; }

  .insta-post.reel::after { border-width: 13px 0 13px 22px; }
}

/* ============ MENU BUTTON (below 900px the links move into a ☰ menu) ============ */

@media (max-width: 900px) {
  .menu-toggle {
    display: block;
    position: relative;
    z-index: 2;
    width: 28px;
    height: 20px;
    background: none;
    border: 0;
    cursor: pointer;
    color: inherit;
  }

  .menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform .3s, top .3s;
  }

  .menu-toggle span:first-child { top: 6px; }
  .menu-toggle span:last-child { top: 14px; }

  .menu-open .menu-toggle span:first-child { top: 10px; transform: rotate(45deg); }
  .menu-open .menu-toggle span:last-child { top: 10px; transform: rotate(-45deg); }

  .site-nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: var(--bg);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }

  .site-nav a { font-size: 20px; }

  .menu-open .site-nav { opacity: 1; pointer-events: auto; }
  .menu-open { color: var(--text); }
}

/* Very small screens: keep the name clear of the menu button */
@media (max-width: 340px) {
  .logo { font-size: 20px; letter-spacing: .16em; }
}
