/* ---------------------------------------------------------
   Elpreas - Boutique software architecture studio
   Shared stylesheet
   --------------------------------------------------------- */

/* ---------- Design tokens ---------- */
:root {
  /* Color palette: warm off-white background, deep ink text, forest green accent */
  --bg: #f6f4ef;            /* warm off-white, easy on the eyes */
  --bg-alt: #ecebe4;        /* slightly darker for section breaks */
  --ink: #1a1a1a;           /* near-black, primary text */
  --ink-soft: #4a4a4a;      /* secondary text */
  --ink-muted: #8a8a85;     /* tertiary / captions */
  --rule: #d8d5cc;          /* hairline borders */
  --accent: #0f4c3a;        /* deep forest green */
  --accent-hover: #0a3a2c;  /* accent on hover */
  --accent-soft: #e6ede9;   /* subtle accent tint background */

  /* Typography scale */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container: 1180px;
  --container-narrow: 880px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}

h1 {
  /* Large editorial display size, fluid */
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.1;
}

h3 {
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p { margin: 0 0 var(--space-4); color: var(--ink-soft); }

/* Italic display font has a nicer "opsz" axis - opt-in via class */
.serif-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
}

/* Small uppercase eyebrow label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow { max-width: var(--container-narrow); }

section { padding: var(--space-24) 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 244, 239, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled { border-bottom-color: var(--rule); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Logo: monogram tile + wordmark */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.logo__mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  border-radius: 4px;
  line-height: 1;
  padding-bottom: 2px;
}

.logo__name { font-weight: 500; }

/* Nav links */
.nav__links {
  display: flex;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  position: relative;
  padding: var(--space-2) 0;
  transition: color 0.2s var(--ease);
}

.nav__links a:hover { color: var(--ink); }

.nav__links a.is-active {
  color: var(--ink);
}

.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav__cta:hover { background: var(--ink); color: var(--bg); }

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--space-2);
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

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

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--ghost:hover { background: var(--ink); color: var(--bg); }

.btn__arrow {
  transition: transform 0.25s var(--ease);
}

.btn:hover .btn__arrow { transform: translateX(4px); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer__brand p {
  max-width: 380px;
  margin-top: var(--space-4);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.footer__col h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}

.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__col li { margin-bottom: var(--space-2); }

.footer__col a {
  color: var(--ink);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}

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

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

/* Subtle entrance animation, applied via JS or by default */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  section { padding: var(--space-16) 0; }

  .nav__links,
  .nav__cta { display: none; }

  .nav__toggle { display: block; }

  .nav--open .nav__links {
    display: flex;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: var(--space-6);
    gap: var(--space-4);
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
}
