/* =========================================================
   Marteno — AI Research & Advisory
   Aesthetic: precision instrument × editorial publication.
   One font (Georgia), treated with typographic discipline.
   ========================================================= */

:root {
  --bg:           #fafaf7;        /* brand cream, matches logo */
  --text:         #18181b;        /* brand charcoal */
  --text-muted:   #52525b;        /* brand muted */
  --text-subtle:  #8a8685;
  --border:       #e6e3dc;
  --border-strong:#cfcbc1;
  --surface:      #ffffff;
  --accent:       #dc2626;        /* brand red */

  --serif: Georgia, 'Times New Roman', Times, serif;

  --max:          1200px;
  --content:      760px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Paper-grain overlay ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.07 0 0 0 0 0.07 0 0 0 0 0.07 0 0 0 0.11 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

/* ---------- Masthead (red rule + signal wave) ---------- */

.signal-band {
  color: var(--accent);
  background: var(--bg);
}

.signal-rule {
  height: 3px;
  background: var(--accent);
}


/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.018em;
}

h1 {
  font-size: clamp(2.625rem, 6.8vw, 5.25rem);
  line-height: 0.98;
  margin: 0 0 32px;
  letter-spacing: -0.028em;
}

h1 em {
  font-style: italic;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.875rem, 3.6vw, 2.875rem);
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.022em;
}

h3 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 12px;
}

p { margin: 0 0 16px; }

em, i { font-style: italic; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

/* Small caps labels: Georgia italic, all small caps, wide tracking */
.eyebrow,
.masthead,
.nav-link,
.footer-links,
.btn-link {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  font-variant: all-small-caps;
  -webkit-font-feature-settings: 'c2sc', 'smcp';
          font-feature-settings: 'c2sc', 'smcp';
}

/* Navigation gets a slightly larger, more readable treatment */
.nav-link {
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}

.footer-links a { font-size: 0.9375rem; letter-spacing: 0.08em; }

.eyebrow {
  color: var(--accent);
  margin: 0 0 28px;
}

/* ---------- Layout ---------- */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 48px;
}

main > section {
  padding: 112px 0;
  border-bottom: 1px solid var(--border);
}

main > section:last-child { border-bottom: none; }

/* ---------- Header ---------- */

header {
  position: sticky;
  top: 0;
  background: rgba(250, 250, 247, 0.88);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  padding-bottom: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.logo img {
  height: 42px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease;
}

.logo:hover img { opacity: 0.82; }

.nav-right {
  display: flex;
  gap: 36px;
  align-items: center;
}

.nav-link { color: var(--text-muted); }
.nav-link:hover { color: var(--accent); }
.nav-cta { color: var(--text); }
.nav-cta:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  padding-top: 108px;
  padding-bottom: 140px;
  position: relative;
  overflow: hidden;
}

.hero h1 { max-width: 14ch; position: relative; z-index: 2; }
.hero .masthead,
.hero .lede,
.hero .cta-group { position: relative; z-index: 2; }

.hero-watermark {
  position: absolute;
  top: 58%;
  right: -22%;
  transform: translateY(-50%);
  width: 105%;
  max-width: 1400px;
  height: auto;
  opacity: 0.065;
  pointer-events: none;
  z-index: 1;
  display: block;
  user-select: none;
}

.masthead {
  display: inline-flex;
  gap: 14px;
  align-items: baseline;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin: 0 0 40px;
}

.masthead-edition { color: var(--accent); }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 2vw, 1.4375rem);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 54ch;
  margin-bottom: 44px;
}

.cta-group {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.08em;
  font-variant: all-small-caps;
  line-height: 1;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  padding: 16px 26px;
  border: 1px solid var(--text);
}

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

.btn-outline {
  color: var(--text);
  border: 1px solid var(--text);
  padding: 16px 26px;
  background: transparent;
}

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
}

.btn-link {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding: 4px 0;
  font-size: 0.9375rem;
}

.btn-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- Credibility ---------- */

.credibility {
  padding-top: 88px;
  padding-bottom: 88px;
}

.credibility-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 52px;
  font-size: 1.125rem;
  color: var(--text);
}

.credibility-list li {
  position: relative;
  padding-left: 24px;
}

.credibility-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 14px;
  height: 1px;
  background: var(--accent);
}

/* ---------- Services ---------- */

.section-header {
  margin-bottom: 72px;
  max-width: 42ch;
}

.section-intro {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.5;
  margin: 20px 0 0;
}

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

.service {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 56px;
  padding: 44px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
  transition: padding 0.25s ease;
}

.service:last-child {
  border-bottom: 1px solid var(--border);
}

.service-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 4rem;
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.04em;
  display: block;
}

.service h3 {
  margin-bottom: 14px;
  font-size: 1.625rem;
}

.service p {
  color: var(--text-muted);
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 58ch;
}

/* ---------- Thinking ---------- */

.essay-list {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  max-width: var(--content);
}

.essay {
  border-top: 1px solid var(--border);
}

.essay:last-child { border-bottom: 1px solid var(--border); }

.essay a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta  arrow"
    "title arrow"
    "sub   arrow";
  column-gap: 32px;
  row-gap: 8px;
  padding: 30px 0;
  color: inherit;
  align-items: center;
}

.essay-meta {
  grid-area: meta;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  font-variant: all-small-caps;
  color: var(--text-muted);
  align-self: end;
  transition: color 0.2s ease;
}

.essay-title {
  grid-area: title;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  margin: 0;
  font-weight: normal;
  letter-spacing: -0.012em;
  transition: color 0.2s ease;
}

.essay-sub {
  grid-area: sub;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
  align-self: start;
  max-width: 56ch;
}

.essay-arrow {
  grid-area: arrow;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--text-subtle);
  transition: transform 0.25s ease, color 0.25s ease;
}

.essay a:hover .essay-meta,
.essay a:hover .essay-title,
.essay a:hover .essay-arrow {
  color: var(--accent);
}

.essay a:hover .essay-arrow {
  transform: translateX(6px);
}

.essays-more {
  margin: 0 0 88px;
  max-width: var(--content);
}

.thinking-card {
  max-width: var(--content);
  padding: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  margin-bottom: 56px;
}

.thinking-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 56px;
  width: 48px;
  height: 2px;
  background: var(--accent);
}

.thinking-card h2,
.thinking-card-title {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--text);
  margin: 0 0 24px;
  letter-spacing: -0.022em;
  font-size: clamp(1.875rem, 3.6vw, 2.875rem);
  line-height: 1.08;
}

.thinking-body {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.55;
  margin-bottom: 36px;
  max-width: 52ch;
}

.thinking-note {
  margin-top: 24px;
  color: var(--text-subtle);
  font-style: italic;
  font-size: 0.875rem;
}

/* ---------- Pull quote ---------- */

.pullquote {
  padding-top: 120px;
  padding-bottom: 120px;
}

.pullquote blockquote {
  margin: 0;
  max-width: 24ch;
}

.pullquote blockquote::before {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 32px;
}

.pullquote p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}

/* ---------- Who ---------- */

.who { max-width: var(--content); }

.who-body {
  color: var(--text-muted);
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 56ch;
  margin: 0 0 32px;
}

.who-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

/* ---------- Contact ---------- */

.contact { max-width: var(--content); }

.contact-body {
  color: var(--text-muted);
  font-size: 1.1875rem;
  line-height: 1.55;
  margin-bottom: 40px;
  max-width: 52ch;
}

.contact-cta {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.contact-email {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-email span {
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
}

.contact-email:hover { color: var(--accent); }
.contact-email:hover span { border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 64px;
  background: var(--bg);
  position: relative;
}

.footer-signoff {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.footer-logo {
  display: block;
  height: 36px;
  width: auto;
  margin-bottom: 14px;
}

.footer-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  max-width: 48ch;
  font-style: italic;
}

.footer-colophon {
  margin: 14px 0 0;
  color: var(--text-subtle);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-variant: all-small-caps;
  -webkit-font-feature-settings: 'c2sc', 'smcp';
          font-feature-settings: 'c2sc', 'smcp';
}

.footer-links {
  display: flex;
  gap: 30px;
  color: var(--text-muted);
  padding-top: 8px;
}

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

/* ---------- Entrance animation ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero .masthead  { animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s both; }
.hero h1         { animation: fadeUp 0.9s cubic-bezier(0.22,1,0.36,1) 0.4s  both; }
.hero .lede      { animation: fadeUp 0.9s cubic-bezier(0.22,1,0.36,1) 0.7s  both; }
.hero .cta-group { animation: fadeUp 0.9s cubic-bezier(0.22,1,0.36,1) 0.95s both; }

/* ---------- Scroll reveal (IntersectionObserver) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

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

/* Stagger service items so they cascade in */
.service-list .service:nth-child(1).reveal { transition-delay: 0.05s; }
.service-list .service:nth-child(2).reveal { transition-delay: 0.18s; }
.service-list .service:nth-child(3).reveal { transition-delay: 0.31s; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .container { padding: 0 28px; }
  main > section { padding: 80px 0; }
  .hero { padding: 88px 0 96px; }

  .hero-watermark { display: none; }

  .pullquote { padding: 88px 0; }

  .service { grid-template-columns: 68px 1fr; gap: 24px; padding: 36px 0; }
  .service-num { font-size: 2.5rem; }
  .service h3 { font-size: 1.375rem; }

  .thinking-card { padding: 40px 28px; }
  .thinking-card::before { left: 28px; width: 40px; }

  .essay a { column-gap: 20px; padding: 26px 0; }
  .essay-arrow { font-size: 1.25rem; }
  .essays-more { margin-bottom: 64px; }

  .footer-inner { flex-direction: column; gap: 28px; align-items: flex-start; }

  .nav-right { gap: 20px; }
  .nav-link { font-size: 0.8125rem; letter-spacing: 0.06em; }

  .credibility-list { flex-direction: column; gap: 10px; }
  .masthead { flex-wrap: wrap; gap: 8px 12px; }
}

@media (max-width: 600px) {
  .cta-group,
  .contact-cta { gap: 22px; align-items: stretch; flex-direction: column; }
  .btn-primary, .btn-outline { width: 100%; text-align: center; }
  .cta-group .btn-link {
    align-self: center;
    font-size: 1rem;
    letter-spacing: 0.06em;
    padding: 4px 0;
  }
  .contact-cta .contact-email { align-self: center; text-align: center; }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .nav-right { gap: 14px; }
  .nav-link { font-size: 0.75rem; letter-spacing: 0.05em; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
