/* ─── Custom properties ────────────────────────────────────────────────────── */

:root {
  --color-bg:      #f0eef8;
  --color-text:    #1a1530;
  --color-accent:  #3b2d8a;
  --color-surface: #faf9fd;
  --color-border:  #c5bce8;
  --color-muted:   #7a6fa8;
  --color-key-white: #ffffff;
  --color-key-black: #1a1530;
  --color-header-bg: #1e1460;
  --color-header-text: #ede8ff;
  --color-header-overlay: rgba(15, 8, 50, 0.55);

  --font-body: Tahoma, 'Segoe UI', Arial, sans-serif;
  --font-ui:   Tahoma, 'Segoe UI', Arial, sans-serif;

  --content-w: 720px;
  --site-max-w: 960px;
  --gap:       1.5rem;

  --header-hero-min-h: 140px;
  --header-bg-image: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:      #0f0d1e;
    --color-text:    #ede8ff;
    --color-accent:  #b8a8f0;
    --color-surface: #1a1633;
    --color-border:  #2e2860;
    --color-muted:   #9a8fc4;
    --color-header-bg: #0a0820;
    --color-header-text: #ede8ff;
    --color-header-overlay: rgba(5, 3, 20, 0.65);
  }
}

/* ─── Reset / base ─────────────────────────────────────────────────────────── */

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
}

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

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

/* ─── Page wrapper ─────────────────────────────────────────────────────────── */

.site-wrapper {
  max-width: var(--site-max-w);
  margin: 0 auto;
  background: var(--color-bg);
}

/* ─── Site header ──────────────────────────────────────────────────────────── */

.site-header {
  background-color: var(--color-header-bg);
  background-image:
    linear-gradient(var(--color-header-overlay), var(--color-header-overlay)),
    var(--header-bg-image);
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  border-bottom: 4px solid var(--color-key-black);
  box-shadow: 0 2px 12px rgba(0,0,0,0.45);
  min-height: var(--header-hero-min-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-header > div,
.site-header-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.site-header-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: .6rem var(--gap) .4rem;
  gap: .4rem;
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
  text-align: left;
}

.site-logo {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--color-header-text);
  text-decoration: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.9);
  display: inline-block;
}

.site-logo::before {
  content: '';
}

/* Hamburger toggle — mobile only */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 36px;
  height: 36px;
  align-items: center;
  flex-shrink: 0;
  order: 2;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-header-text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0 }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* Mobile: nav hidden by default, shows below header bar when open */
.site-nav {
  display: none;
  flex-direction: column;
  gap: .25rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: .5rem var(--gap) .6rem;
  border-top: 1px solid rgba(255,255,255,0.25);
  max-width: var(--content-w);
  margin: 0 auto;
  width: 100%;
  align-items: center;
}
.site-nav.open { display: flex }
.site-nav a {
  color: var(--color-header-text);
  text-decoration: none;
  padding: .5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  opacity: 0.95;
  text-shadow: 0 2px 6px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.9);
  width: 100%;
  text-align: center;
}
.site-nav a:last-child { border-bottom: none }
.site-nav a:hover, .site-nav a.active {
  color: var(--color-key-white);
  opacity: 1;
}

/* Tablet+ : horizontal nav, no hamburger */
@media (min-width: 640px) {
  :root {
    --header-hero-min-h: 160px;
  }

  .site-header-bar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .75rem var(--gap) .4rem;
    max-width: var(--content-w);
    margin: 0 auto;
    text-align: center;
    gap: .5rem;
  }

  .site-logo {
    font-size: 1.75rem;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9), 0 1px 4px rgba(0,0,0,0.95);
  }

  .nav-toggle { display: none }

  .site-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-size: .9rem;
    padding: 0 0 .75rem;
    border-top: none;
    max-width: var(--content-w);
    margin: 0 auto;
    width: 100%;
  }

  .site-nav a {
    color: rgba(237,232,255,0.92);
    padding: .5rem 1rem;
    border-bottom: none;
    border-right: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: color .15s, background .15s;
    border-radius: 4px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.9);
    text-align: center;
    width: auto;
  }

  .site-nav a:hover,
  .site-nav a.active {
    color: var(--color-key-white);
    background: rgba(0,0,0,0.25);
    opacity: 1;
  }
}

/* ─── Piano key decorative border ─────────────────────────────────────────── */

body::before {
  content: '';
  display: none;
  height: 6px;
  background: repeating-linear-gradient(
    to right,
    var(--color-key-white) 0px,
    var(--color-key-white) 18px,
    var(--color-key-black) 18px,
    var(--color-key-black) 22px
  );
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ─── Main content ─────────────────────────────────────────────────────────── */

.site-content {
  max-width: var(--content-w);
  margin: 2rem auto;
  padding: 0 var(--gap);
}

/* ─── Typography ───────────────────────────────────────────────────────────── */

article, section { display: flow-root }

h1, h2, h3 {
  font-family: var(--font-ui);
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: .75rem;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-top: 0 }
h2 { font-size: 1.5rem }
h3 { font-size: 1.2rem }

p { margin-bottom: 1.1rem }
p:last-child { margin-bottom: 0 }

dl { margin-bottom: 1.1rem }
dt { font-weight: 600; font-family: var(--font-ui) }
dd { margin-left: 0; color: var(--color-muted); margin-bottom: .5rem }

hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0 }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.1rem }
li { margin-bottom: .35rem }

/* ─── Images ───────────────────────────────────────────────────────────────── */

figure { margin: 1.5rem 0; display: flow-root }
figcaption { font-size: .875rem; color: var(--color-muted); margin-top: .5rem; font-family: var(--font-ui) }
.image-credit { display: block; font-size: .75rem; opacity: .7; margin-top: .25rem }
.image-credit a { color: inherit }

.flow-full { width: 100% }
.flow-center { max-width: 480px; margin-left: auto; margin-right: auto }
.flow-left, .flow-right { width: 100% }

@media (min-width: 640px) {
  .flow-left {
    float: left;
    width: 45%;
    margin-right: 1.5rem;
    margin-bottom: .75rem;
  }
  .flow-right {
    float: right;
    width: 45%;
    margin-left: 1.5rem;
    margin-bottom: .75rem;
  }
}

/* ─── Gallery ──────────────────────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), 1fr);
  gap: .75rem;
  margin: 1.5rem 0;
}
.gallery-grid[data-cols-mobile="2"] { --cols: 2 }

@media (min-width: 640px) {
  .gallery-grid { --cols: attr(data-cols-tablet, 2) }
  .gallery-grid[data-cols-tablet="1"] { --cols: 1 }
  .gallery-grid[data-cols-tablet="2"] { --cols: 2 }
  .gallery-grid[data-cols-tablet="3"] { --cols: 3 }
}

@media (min-width: 1024px) {
  .gallery-grid[data-cols-desktop="1"] { --cols: 1 }
  .gallery-grid[data-cols-desktop="2"] { --cols: 2 }
  .gallery-grid[data-cols-desktop="3"] { --cols: 3 }
  .gallery-grid[data-cols-desktop="4"] { --cols: 4 }
}

.gallery-grid figure { margin: 0 }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px }

.gallery-strip {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  margin: 1.5rem 0;
  padding-bottom: .5rem;
}
.gallery-strip figure { flex: 0 0 280px; scroll-snap-align: start; margin: 0 }
.gallery-strip img { width: 280px; height: 200px; object-fit: cover; border-radius: 4px }

/* ─── Downloads ────────────────────────────────────────────────────────────── */

.download-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0 }

.download-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-accent);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: .9rem;
  transition: border-color .15s;
}
.download-item:hover { border-color: var(--color-accent) }
.download-item::before { content: '↓'; font-weight: 700 }
.download-filename { color: var(--color-muted); font-size: .8rem; margin-left: auto }

/* ─── Contact form ─────────────────────────────────────────────────────────── */

.contact-form { max-width: 520px; margin: 1.5rem 0 }

.form-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-bottom: 1.1rem;
}

.form-field label {
  font-family: var(--font-ui);
  font-size: .875rem;
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .5rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

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

.form-submit {
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: .6rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-key-white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity .15s;
}
.form-submit:hover { opacity: 0.85 }

/* ─── Site footer ──────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem var(--gap);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-ui);
  font-size: .85rem;
  color: var(--color-muted);
  text-align: center;
}

.site-footer a { color: var(--color-muted) }