/* ==========================================================================
   Linari Harmonica Studio — shared styles
   Tokens · Base · Layout · Header · Footer · Buttons · Forms · Modal ·
   Page hero · Photo frame · Typography helpers
   Page-specific styles live in css/pages/, optional components in css/components/.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #14181c;
  --bg-translucent: rgba(20, 24, 28, 0.9);
  --surface: #1b2127;
  --text: #ede9e2;
  --text-muted: #9aa2aa;
  --brass: #c9a227;
  --brass-soft: #e8c766;
  --on-brass: #1a1607;
  --wine-rgb: 74, 20, 32;
  --wine-soft: #6e2233;
  --line: #2c333a;
  --error: #e08a8a;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Fraunces', serif;

  --max-width: 1120px;
  --gutter: 32px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

/* Set by lang-init.js while a non-default language is being applied. */
html.i18n-pending body {
  visibility: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

p {
  max-width: 60ch;
  color: var(--text-muted);
}

a {
  color: inherit;
}

p a {
  color: var(--brass);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

p a:hover {
  color: var(--brass-soft);
}

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

/* :where() keeps specificity at zero so component classes can set their own margins */
:where(ul[class]) {
  margin: 0;
  padding: 0;
  list-style: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--brass);
  color: var(--on-brass);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Custom elements (js/components/) render in the light DOM and are inline by default */
site-header,
site-footer,
site-form {
  display: block;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap--narrow {
  max-width: 560px;
}

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

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}

.section:first-child {
  border-top: none;
}

.section-tight {
  padding: 16px 0 48px;
}

.section-tight--flush-top {
  padding-top: 0;
}

@media (max-width: 860px) {
  .section {
    padding: 64px 0;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 20px;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-translucent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand img {
  width: auto;
  height: 34px;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 32px;
  padding: 8px 10px;
  margin: -8px -10px;
  border: none;
  background: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

.site-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  flex-direction: column;
  padding: 8px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-menu.open {
  display: flex;
}

.site-menu a {
  display: block;
  padding: 14px 32px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-menu a:hover {
  color: var(--text);
}

.site-menu a.current {
  color: var(--brass);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-icons a,
.social-icons button {
  display: flex;
  padding: 6px;
  margin: -6px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.social-icons a:hover,
.social-icons button:hover {
  color: var(--brass-soft);
}

.social-icons svg {
  width: 17px;
  height: 17px;
}

.lang-toggle {
  display: flex;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-toggle .active {
  color: var(--brass);
  font-weight: 600;
}

@media (max-width: 560px) {
  .site-header__bar {
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .brand img {
    height: 24px;
  }

  .header-actions {
    gap: 10px;
  }

  .social-icons {
    gap: 9px;
  }

  .social-icons svg {
    width: 15px;
    height: 15px;
  }

  .lang-toggle {
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.site-footer__copy {
  max-width: none;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.12;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-primary {
  background: var(--brass);
  color: var(--on-brass);
}

.btn-primary:hover {
  background: var(--brass-soft);
  transform: translateY(-1px);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

/* Call-to-action rows use the taller button */
.cta-row .btn {
  line-height: 1.55;
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 18px;
}

.form--inline-submit .btn {
  justify-self: start;
}

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

.field label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.field input,
.field textarea {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brass);
}

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

.form-note {
  margin: -4px 0 0;
  color: var(--brass-soft);
  font-size: 0.85rem;
}

.form-status {
  margin: 14px 0 1em;
  font-size: 0.9rem;
}

.form-status.is-success {
  color: var(--brass-soft);
}

.form-status.is-error {
  color: var(--error);
}

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(10, 12, 14, 0.72);
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 40px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--brass);
}

.modal-title {
  margin-bottom: 24px;
  font-size: 1.4rem;
}

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  padding: 72px 0 56px;
  background: radial-gradient(ellipse 900px 420px at 85% -10%, rgba(var(--wine-rgb), 0.45), transparent 65%);
}

.page-hero--tight {
  padding: 28px 0 12px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.1;
}

.page-hero .eyebrow {
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.page-hero .lede {
  margin-top: 18px;
}

.page-hero .cta-row {
  margin-top: 32px;
}

/* ---------- Photo frame ---------- */
.photo-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 40px 80px -30px rgba(var(--wine-rgb), 0.6);
}

.photo-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, var(--brass), var(--wine-soft));
}

.photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(var(--wine-rgb), 0.05) 0%, transparent 30%, transparent 70%, var(--bg) 100%);
  pointer-events: none;
}

.photo-frame img {
  width: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.03);
}

.photo-frame--flat {
  border: none;
  background: transparent;
  box-shadow: none;
}

.photo-frame--flat::before,
.photo-frame--flat::after {
  display: none;
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--brass);
  font-size: 0.85rem;
  font-weight: 600;
}

.lede {
  max-width: 62ch;
  color: var(--text);
  font-size: 1.15rem;
}

.content-heading {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.1;
}

.subhead {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- Contact page ---------- */
.contact-heading {
  margin-bottom: 28px;
}
