/* =========================================================
   Michaela Malá Schönbaum — atelier site
   Presentation only. All copy comes from content.js.
   ========================================================= */

:root {
  /* palette */
  --ivory: #f4efe9;
  --warm-white: #faf7f2;
  --ink: #1a1f36;
  --ink-soft: #3a3f52;
  --taupe: #b7a99a;
  --gold: #a98d6b;
  --hairline: rgba(26, 31, 54, 0.14);

  /* type */
  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, sans-serif;

  /* layout */
  --maxw: 1200px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --header-h: 104px;
}

/* Hebrew typefaces when RTL */
html[lang="he"] {
  --font-head: "Frank Ruhl Libre", "Cormorant Garamond", serif;
  --font-body: "Heebo", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a { color: inherit; }

/* ---------------- Header ---------------- */
/* Transparent so the hero image can bleed up behind it */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
}
.site-header.is-scrolled {
  background: rgba(244, 239, 233, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  /* full-bleed so the logos can sit near the screen edges */
  max-width: none;
  margin: 0;
  padding: 0 var(--pad);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 84px; width: auto; display: block; }

.site-nav {
  display: flex;
  gap: clamp(1rem, 2.2vw, 2.2rem);
  flex: 1;
  /* sit close to the name logo instead of centering in the row */
  justify-content: flex-start;
  margin-inline-start: clamp(1rem, 2.5vw, 2.5rem);
  flex-wrap: nowrap;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding: 0.4rem 0;
  transition: color 0.25s;
  white-space: nowrap;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { width: 100%; }

.header-right { display: flex; align-items: center; gap: 1.25rem; }
/* right emblem sits last; pull it toward the right edge, leaving only a small
   gap from the screen (offsets most of the header's outer --pad). */
.header-emblem {
  height: 96px;
  width: auto;
  opacity: 0.9;
  /* pull toward the screen edge, leaving a small gap (offsets most of --pad) */
  margin-inline-end: calc(var(--pad) * -1 + 0.5rem);
}

.lang-switch { display: flex; gap: 0.15rem; }
.lang-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active { color: var(--gold); font-weight: 600; }

/* hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------------- Section shell ---------------- */
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3.5rem, 8vw, 7rem) var(--pad); }

/* ---------------- Hero ---------------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  /* tighter gap between header and first content */
  padding-top: clamp(1.75rem, 4vw, 3rem);
}
/* Keep hero text above the full-bleed image on desktop */
.hero-text { position: relative; z-index: 1; }
.hero-headline {
  font-size: clamp(2.4rem, 3.2vw, 4rem);
  margin-bottom: 1.5rem;
}
.hero-rule {
  display: block;
  width: 140px;
  height: 1px;
  background: var(--gold);
  margin: 1.5rem 0;
}
.hero-sub {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 40ch;
  margin: 0 0 1.75rem;
  /* honor \n in the content string: single = line break, \n\n = paragraph gap */
  white-space: pre-line;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0;
  margin: 0 0 1.75rem;
  list-style: none;
}
.hero-tags li {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  border: none;
  padding: 0;
}
.hero-tags li:not(:last-child)::after {
  content: "·";
  margin: 0 0.7rem;
  color: var(--gold);
}
.hero-media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
}

/* Desktop: full-bleed "curtain" hero image, bleeding to the top and
   right viewport edges (behind the transparent header) and fading into
   the ivory background on its left side. */
@media (min-width: 861px) {
  .hero {
    position: relative;
    /* leave room so text never sits under the image's opaque part */
    min-height: 78vh;
  }
  .hero-media {
    position: absolute;
    top: calc(var(--header-h) * -1);           /* bleed up behind header */
    right: calc(50% - 50vw);                    /* bleed to viewport right */
    bottom: calc(clamp(3.5rem, 8vw, 7rem) * -1);/* absorb section padding */
    width: 56vw;
    z-index: 0;
    pointer-events: none;
  }
  .hero-media img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    object-fit: cover;
    /* shifted so more of the right side of the photo is revealed */
    object-position: 82% top;
    /* left edge dissolves into the ivory page background */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 20%, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 20%, #000 100%);
  }
}

/* buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.95rem 2.1rem;
  border-radius: 2px;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}
.btn-primary {
  background: var(--ink);
  color: var(--warm-white);
}
.btn-primary:hover { background: var(--gold); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--gold); }
.btn-outline:hover { background: var(--ink); color: var(--warm-white); border-color: var(--ink); transform: translateY(-2px); }

/* ---------------- Story ---------------- */
.story {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  /* breathing room above (separates the notebook from the hero image) and a
     tighter gap below so the service icons sit close under the story text */
  padding-top: clamp(4.5rem, 10vw, 9rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* pull the services row up close to the end of the story text */
.services { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.story-media {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.story-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
}

/* The story image is a contained landscape rectangle on the right, aligned
   to the top of the text column (per mockup) — no bleed, no fade. It is
   broad and tightly cropped so the notebook reads large and its bottom tip
   runs past the frame. */
.story { align-items: start; }
.story-media img {
  width: 100%;
  aspect-ratio: 16 / 9;          /* broader landscape frame */
  object-fit: cover;
  object-position: center 30%;   /* crop tighter, clipping the notebook's tip */
  border-radius: 2px;
}
.story-eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
}
.story-rule {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin: 0.9rem 0;
}
/* second rule (below the headline) is wider, matching the mockup */
.story-headline + .story-rule { width: 120px; margin: 1.5rem 0; }
.story-headline {
  font-size: clamp(1.9rem, 2.4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
}
.story-body { margin-top: 1.6rem; }
.story-body p {
  color: var(--ink-soft);
  max-width: 46ch;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.5;
  margin: 0 0 1.4rem;
}
.story-body p:last-child { margin-bottom: 0; }

/* ---------------- Services ---------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.service-card {
  display: flex;
  gap: clamp(1rem, 1.8vw, 1.75rem);
  align-items: stretch;
  text-align: start;
  padding-inline: clamp(1rem, 2.5vw, 2.25rem);
}
.service-card + .service-card { border-inline-start: 1px solid var(--hairline); }
.service-icon { flex: 0 0 auto; width: 44px; height: 44px; margin: 0; color: var(--ink); }
.service-icon svg { width: 44px; height: 44px; }
/* body fills the card's height so the "learn more" links share one baseline */
.service-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.service-card h3 {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.service-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
}
.service-more {
  display: inline-block;
  /* pushed to the bottom of the card so all links align on one baseline */
  margin-top: auto;
  padding-top: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.service-more:hover { color: var(--ink); }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: clamp(1.5rem, 4vw, 3rem); }

/* light contact strip */
.footer-contact {
  background: var(--warm-white);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.footer-contact-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.15rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-contact-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
/* vertical hairline dividers between items */
.footer-contact-item + .footer-contact-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  width: 1px;
  background: var(--hairline);
}
.footer-contact-icon { display: inline-flex; color: var(--ink); }
.footer-contact-icon svg { width: 22px; height: 22px; }
.footer-contact-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.footer-contact-item[href]:hover .footer-contact-label { color: var(--ink); }

/* dark signature bar */
.footer-bar { background: var(--ink); color: var(--warm-white); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-logo { height: 46px; width: auto; opacity: 0.95; }
/* Emblem art is dark ink; invert it to read light on the dark footer. */
.footer-emblem { height: 88px; width: auto; opacity: 0.9; filter: invert(1) brightness(1.6); }
#footer-copy {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(250, 247, 242, 0.7);
}

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- RTL ---------------- */
[dir="rtl"] .hero-sub,
[dir="rtl"] .story-text p { margin-left: auto; }
[dir="rtl"] .site-nav a { letter-spacing: 0; }
[dir="rtl"] .hero-tags li,
[dir="rtl"] .lang-btn { letter-spacing: 0; }
[dir="rtl"] .story-eyebrow,
[dir="rtl"] .service-card h3,
[dir="rtl"] .service-more { letter-spacing: 0; }

/* RTL is the default language: mirror the full-bleed hero/story images to
   the LEFT viewport edge with the fade flipped to the right, so the image's
   opaque side never sits under the right-hand text column. */
@media (min-width: 861px) {
  [dir="rtl"] .hero-media {
    right: auto;
    left: calc(50% - 50vw);
  }
  [dir="rtl"] .hero-media img {
    -webkit-mask-image: linear-gradient(to left, transparent 0%, #000 20%, #000 100%);
    mask-image: linear-gradient(to left, transparent 0%, #000 20%, #000 100%);
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .nav-toggle { display: flex; order: 3; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--warm-white);
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--hairline);
    transform: translateY(-120%);
    transition: transform 0.35s ease;
  }
  body.nav-open .site-nav { transform: translateY(0); }
  .site-nav a { padding: 0.9rem 0; font-size: 0.9rem; }
  .header-emblem { display: none; }

  .hero { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 4 / 3; }
  .hero-sub { max-width: none; }

  .story { grid-template-columns: 1fr; }
  .story-media { order: -1; }

  /* footer thin bar: keep centered, allow wrap on narrow screens */
  .footer-inner { flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.25rem; }
  #footer-copy { flex-basis: 100%; order: 3; }

  /* footer contact strip stacks into a 2-col grid on mobile */
  .footer-contact-inner { flex-wrap: wrap; gap: 1rem 0.5rem; }
  .footer-contact-item { flex: 0 0 calc(50% - 0.25rem); justify-content: flex-start; }
  .footer-contact-item + .footer-contact-item::before { display: none; }

  .services-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .service-card { padding-inline: 0; }
  .service-card + .service-card { border-inline-start: none; }
}

@media (max-width: 480px) {
  .brand-logo { height: 44px; }
  .header-inner { gap: 0.75rem; }
}
