/* ============================================================
   Elena Pini — static rebuild (Illustration · Cartoon · Grafik)
   Hand-written, no framework. Served from /opt/elenapini/website.
   ============================================================ */

@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/assets/fonts/opensans-latin.woff2") format("woff2-variations"),
       url("/assets/fonts/opensans-latin.woff2") format("woff2");
}

:root {
  --ink:      #211d1a;
  --body:     #4d463f;
  --muted:    #8a8178;
  --line:     #e9e2d8;
  --bg:       #fbf8f3;
  --bg-soft:  #f3ede3;
  --card:     #ffffff;
  --accent:   #c6452f;   /* ink-red */
  --accent-d: #a5341f;

  --container: 1180px;
  --gutter: clamp(20px, 4vw, 44px);
  --section-pad: clamp(48px, 7vw, 96px);

  --shadow-sm: 0 2px 10px rgba(33, 29, 26, 0.06);
  --shadow-md: 0 12px 34px rgba(33, 29, 26, 0.12);
  --shadow-lg: 0 30px 70px rgba(33, 29, 26, 0.30);

  --t-fast: 170ms cubic-bezier(.2,.7,.2,1);
  --t-med:  300ms cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-d); }

h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }

.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .8rem;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 248, 243, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav { display: flex; align-items: center; gap: 1rem; padding-block: .85rem; }
.brand {
  display: flex; align-items: baseline; gap: .5rem; color: var(--ink);
  font-weight: 800; font-size: 1.25rem; letter-spacing: .01em; margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand small { font-weight: 400; font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); }

.nav-list {
  display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .35rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-list a {
  display: block; color: var(--body); font-size: .93rem; font-weight: 600;
  padding: .35rem .6rem; border-radius: 7px; transition: background var(--t-fast), color var(--t-fast);
}
.nav-list a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-list a[aria-current="page"] { color: var(--accent); }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; padding: 8px;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-list {
    flex-direction: column; align-items: stretch; gap: 2px;
    width: 100%; flex-basis: 100%; order: 3;
    margin-top: .6rem; padding-bottom: .4rem;
  }
  .nav-list a { padding: .7rem .6rem; border-radius: 9px; }
  /* With JS: collapse behind the toggle. Without JS: stays open & usable. */
  .js .nav-list {
    display: none;
  }
  .js .nav[data-open="true"] .nav-list { display: flex; }
}

/* ---------- Hero (home) ---------- */
.hero {
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px);
  background:
    radial-gradient(1100px 480px at 78% -8%, rgba(198,69,47,.10), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero__inner { max-width: 760px; }
.hero h1 { margin-bottom: .35em; }
.hero h1 span { color: var(--accent); }
.hero p.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--body); margin: 0 0 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: 999px; font-weight: 700; font-size: .98rem;
  border: 1.5px solid var(--accent); background: var(--accent); color: #fff;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--accent-d); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: #fff; }

/* ---------- Generic page head ---------- */
.page-head { padding: clamp(40px, 6vw, 80px) 0 clamp(20px, 3vw, 36px); }
.page-head .intro { max-width: 720px; font-size: 1.06rem; }

.section { padding: var(--section-pad) 0; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Category overview cards (home) ---------- */
.cats {
  display: grid; gap: clamp(14px, 2vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.cat-card {
  position: relative; display: block; overflow: hidden; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-sm); aspect-ratio: 4 / 3;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med); }
.cat-card:hover img { transform: scale(1.05); }
.cat-card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem 1rem .8rem;
  color: #fff; font-weight: 700; font-size: 1.05rem; z-index: 2;
  background: linear-gradient(to top, rgba(20,16,14,.82), rgba(20,16,14,0));
}

/* ---------- Masonry gallery ---------- */
.gallery {
  column-gap: clamp(12px, 1.6vw, 18px);
  columns: 4 260px;
}
.gallery .tile {
  break-inside: avoid; margin-bottom: clamp(12px, 1.6vw, 18px);
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform var(--t-med), box-shadow var(--t-med);
}
.gallery .tile:hover,
.gallery .tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-md); outline: none; }
.gallery .tile:focus-visible { box-shadow: 0 0 0 3px rgba(198,69,47,.45), var(--shadow-md); }
.gallery .tile img { width: 100%; height: auto; display: block; background: var(--bg-soft); }

.gallery-note { margin-top: 1.6rem; color: var(--muted); font-size: .95rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: 1.4fr 1fr; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.contact-list li { margin-bottom: .9rem; }
.contact-list a {
  display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; color: var(--ink);
}
.contact-list a:hover { color: var(--accent); }
.contact-list svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9d2c8; padding: clamp(36px, 5vw, 60px) 0; margin-top: var(--section-pad); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer a { color: #e8e1d6; }
.site-footer a:hover { color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.copyright { font-size: .9rem; color: #b3aa9d; }

/* ---------- Lightbox ---------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; color: #fff; }
.lightbox::backdrop { background: rgba(15, 11, 9, 0.9); backdrop-filter: blur(3px); }
.lightbox__img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; margin: 0 auto; border-radius: 8px; box-shadow: var(--shadow-lg); }
.lightbox__caption { text-align: center; margin-top: .7rem; font-size: .9rem; color: #d9d2c8; min-height: 1.2em; }
.lightbox__close, .lightbox__btn {
  position: fixed; top: 50%; width: 48px; height: 48px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer; border-radius: 999px;
  transition: background var(--t-fast);
}
.lightbox__btn:hover, .lightbox__close:hover { background: rgba(255,255,255,.28); }
.lightbox__btn svg, .lightbox__close svg { width: 24px; height: 24px; }
.lightbox__btn--prev { left: 16px; }
.lightbox__btn--next { right: 16px; }
.lightbox__close { top: 18px; right: 18px; transform: none; width: 44px; height: 44px; }

/* ---------- Scroll-in animation (scoped to .js so no-JS shows everything) ---------- */
.js [data-animate] { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js [data-animate].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .js [data-animate] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cat-card, .cat-card img, .gallery .tile, .btn { transition: none !important; }
}
