/* =============================================================
   CAPITAL IBIZA — Corporate Finance / M&A Boutique
   1. Tokens
   ============================================================= */
:root {
  --white:        #ffffff;
  --paper:        #faf9f7;
  --grey-100:     #f0efec;
  --grey-200:     #dedad3;
  --grey-400:     #a29c92;
  --graphite:     #33322f;
  --ink:          #17160f;
  --black:        #0d0c09;
  --gold:         #86703f;
  --gold-soft:    rgba(134,112,63,.14);
  --petrol:       #0f3d3e;
  --petrol-soft:  rgba(15,61,62,.10);
  --line:         rgba(23,22,15,.13);
  --line-dark:    rgba(250,249,247,.16);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
ul, ol { list-style: none; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--black);
}

::selection { background: var(--gold-soft); color: var(--black); }

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 3px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .7rem 1.2rem; background: var(--black); color: var(--paper);
  z-index: 9999; font-size: .85rem;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.eyebrow--petrol { color: var(--petrol); }

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
}
.rule--gold {
  width: 64px;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 1.5rem 0;
}

.section {
  padding-block: clamp(4rem, 9vw, 8rem);
  position: relative;
}
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.section--dark {
  background: var(--ink);
  color: var(--grey-100);
}
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--paper); }
.section--paper-alt { background: var(--grey-100); }

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.section-head--center { margin-inline: auto; text-align: center; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* reveal-on-scroll: very restrained, content-first */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* =============================================================
   4. Typography scale
   ============================================================= */
h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; letter-spacing: -0.005em; }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--graphite);
  max-width: 42rem;
}

.body-text { max-width: 62ch; color: var(--graphite); }
.body-text p + p { margin-top: 1.1rem; }
.body-text h3 { margin-top: 2.4rem; margin-bottom: .8rem; }
.body-text ul, .body-text ol { margin: 1.1rem 0 1.1rem 0; }
.body-text li { position: relative; padding-left: 1.4rem; margin-bottom: .55rem; color: var(--graphite); }
.body-text li::before {
  content: "";
  position: absolute; left: 0; top: .6em;
  width: 6px; height: 1px; background: var(--gold);
}
.body-text strong { color: var(--black); font-weight: 600; }
.body-text blockquote {
  font-family: var(--serif); font-size: 1.35rem; font-style: italic;
  color: var(--black); border-left: 2px solid var(--gold);
  padding-left: 1.4rem; margin: 2rem 0;
}

/* =============================================================
   5. Components
   ============================================================= */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.9rem;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid transparent;
  transition: background .35s var(--ease-out), color .35s var(--ease-out), border-color .35s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--black); color: var(--paper); border-color: var(--black); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: var(--black); }
.btn-outline { background: transparent; color: var(--black); border-color: var(--line); }
.btn-outline:hover { border-color: var(--black); }
.btn-outline--light { color: var(--paper); border-color: var(--line-dark); }
.btn-outline--light:hover { border-color: var(--paper); }
.btn-text {
  padding: 0; border: 0; text-transform: none; letter-spacing: 0;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 500;
  border-bottom: 1px solid var(--gold); padding-bottom: 2px;
}
.btn-text:hover { color: var(--gold); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(250,249,247,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
}
.logo { display: flex; align-items: center; }
.logo svg { height: 30px; width: auto; }

.main-nav { display: none; }
.main-nav ul { display: flex; align-items: center; gap: 2.1rem; }
.main-nav a {
  font-size: .82rem; font-weight: 500; letter-spacing: .04em;
  color: var(--graphite); position: relative; padding: .3rem 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 1px; background: var(--gold);
  transition: width .3s var(--ease-out);
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { width: 100%; }
.main-nav a[aria-current="page"] { color: var(--black); }

.has-submenu { position: relative; }
.submenu {
  position: absolute; top: 100%; left: -1rem; padding-top: .9rem;
  min-width: 240px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), visibility .25s;
}
.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu { opacity: 1; visibility: visible; transform: none; }
.submenu ul {
  flex-direction: column; align-items: flex-start; gap: 0;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(20,20,15,.09);
}
.submenu a { display: block; padding: .85rem 1.4rem; width: 100%; font-size: .8rem; }
.submenu a::after { display: none; }
.submenu a:hover { background: var(--grey-100); color: var(--black); }

.nav-cta { display: none; }
@media (min-width: 960px) {
  .main-nav { display: block; }
  .nav-cta { display: inline-flex; }
}

.nav-toggle {
  width: 34px; height: 22px; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
}
@media (min-width: 960px) { .nav-toggle { display: none; } }
.nav-toggle span { display: block; height: 1px; width: 100%; background: var(--black); transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: 84px 0 0 0; z-index: 400;
  background: var(--paper);
  padding: 2rem var(--gutter) 3rem;
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out), visibility .3s;
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-nav ul { display: flex; flex-direction: column; }
.mobile-nav > .container > ul > li { border-bottom: 1px solid var(--line); }
.mobile-nav a { display: block; padding: 1.05rem 0; font-family: var(--serif); font-size: 1.3rem; }
.mobile-nav .submenu-mobile { display: flex; flex-direction: column; padding-bottom: 1rem; }
.mobile-nav .submenu-mobile a { font-size: 1rem; font-family: var(--sans); padding: .6rem 0 .6rem 1rem; color: var(--grey-400); }
.mobile-nav .btn { margin-top: 2rem; width: 100%; justify-content: center; }
@media (min-width: 960px) { .mobile-nav { display: none; } }

/* Logo lockup */
.logo-mark { fill: var(--black); }
.logo-line { stroke: var(--gold); }
.logo-sub { fill: var(--grey-400); }
.site-footer .logo-mark { fill: var(--paper); }
.site-footer .logo-sub { fill: var(--grey-400); }

/* Cards */
.card-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .card-grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } .card-grid--5 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.card {
  background: var(--white); padding: clamp(1.8rem, 3vw, 2.6rem);
  display: flex; flex-direction: column; gap: .9rem;
}
.card .num { font-family: var(--serif); font-size: 1rem; color: var(--gold); }
.card h3 { font-size: 1.35rem; }
.card p { color: var(--graphite); font-size: .95rem; }
.card a.card-link { margin-top: auto; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--black); border-bottom: 1px solid var(--gold); align-self: flex-start; padding-bottom: 2px; }

/* Process steps */
.steps { counter-reset: step; display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 1fr; gap: 1rem; padding-block: 2.4rem; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step-index { font-family: var(--serif); font-size: 2.4rem; color: var(--gold); line-height: 1; }
.step-body h3 { margin-bottom: .6rem; }
.step-body p { color: var(--graphite); max-width: 56ch; }
@media (min-width: 720px) {
  .step { grid-template-columns: 120px 1fr; align-items: start; }
}

/* Stats */
.stat-row { display: grid; gap: 2rem; }
@media (min-width: 720px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
.stat { border-top: 1px solid var(--line-dark); padding-top: 1.4rem; }
.stat .value { font-family: var(--serif); font-size: clamp(2.2rem, 3.6vw, 3.2rem); color: var(--paper); }
.stat .label { font-size: .82rem; color: var(--grey-400); margin-top: .4rem; }

/* Testimonial / quote block */
.quote-block { max-width: 48rem; }
.quote-block p { font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-style: italic; line-height: 1.4; }
.quote-block cite { display: block; margin-top: 1.4rem; font-style: normal; font-size: .85rem; color: var(--grey-400); }

/* Forms */
.form-grid { display: grid; gap: 1.3rem; }
@media (min-width: 720px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--graphite); }
.field input, .field select, .field textarea {
  padding: .85rem 1rem; border: 1px solid var(--line); background: var(--white);
  font-size: .95rem; transition: border-color .25s var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: none; }
.field textarea { resize: vertical; min-height: 120px; }
.field-note { font-size: .78rem; color: var(--grey-400); }
.form-confidential {
  display: flex; gap: .8rem; align-items: flex-start;
  font-size: .82rem; color: var(--grey-400); margin-top: .6rem;
}

/* Valuation tool */
.calc {
  background: var(--white); border: 1px solid var(--line);
  padding: clamp(1.8rem, 4vw, 3rem);
}
.calc-grid { display: grid; gap: 1.3rem; margin-bottom: 1.8rem; }
@media (min-width: 720px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-result {
  border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1.8rem;
  display: none;
}
.calc-result.is-visible { display: block; }
.calc-range {
  font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 2.6rem); color: var(--black);
}
.calc-disclaimer { font-size: .78rem; color: var(--grey-400); max-width: 50ch; margin-top: 1rem; }
.calc-gate {
  display: none; border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1.6rem;
}
.calc-gate.is-visible { display: block; }

/* Case studies */
.case-card { padding: clamp(1.8rem, 3vw, 2.6rem); background: var(--white); }
.case-tag { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--petrol); }
.case-card h3 { margin-top: .7rem; margin-bottom: .9rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1.3rem; padding-top: 1.3rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--grey-400); }
.case-meta strong { color: var(--graphite); font-weight: 600; }

/* Blog cards */
.post-card { padding: clamp(1.6rem, 3vw, 2.2rem); background: var(--white); display: flex; flex-direction: column; gap: .8rem; }
.post-cat { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.post-card h3 { font-size: 1.25rem; }
.post-card p { color: var(--graphite); font-size: .92rem; }
.post-card .card-link { margin-top: .4rem; }

/* Article */
.article-head { max-width: 48rem; margin: 0 auto clamp(2.5rem, 6vw, 4rem); text-align: left; }
.article-meta { display: flex; gap: 1.2rem; font-size: .8rem; color: var(--grey-400); margin-top: 1.2rem; }
.article-body { max-width: 42rem; margin-inline: auto; }
.article-body h2 { margin-top: 2.6rem; margin-bottom: 1rem; font-size: 1.7rem; }
.article-body h3 { margin-top: 2rem; margin-bottom: .8rem; }
.article-body p { color: var(--graphite); }
.article-body p + p, .article-body ul + p, .article-body p + ul { margin-top: 1.1rem; }
.article-cta {
  margin-top: 3rem; padding: 2rem; background: var(--grey-100); border-left: 2px solid var(--gold);
}
.article-cta p { margin-bottom: 1rem; }
.related-posts { max-width: 42rem; margin: 3rem auto 0; padding-top: 2rem; border-top: 1px solid var(--line); }

/* Founder photo */
.founder-figure { position: relative; }
.founder-figure img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover;
  object-position: 78% center;
  background: var(--grey-100);
}
.founder-figure figcaption {
  margin-top: 1rem; font-size: .82rem; color: var(--grey-400);
}

/* Downloads / lead magnet */
.download-block {
  display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
@media (min-width: 960px) { .download-block { grid-template-columns: 1fr 1fr; } }
.download-cover {
  aspect-ratio: 3/4; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-dark);
}
.download-cover .cover-inner {
  border: 1px solid var(--line-dark); margin: 1.6rem; padding: 2rem; height: calc(100% - 3.2rem); width: calc(100% - 3.2rem);
  display: flex; flex-direction: column; justify-content: space-between;
}
.download-cover .cover-num { font-family: var(--serif); font-size: 3.4rem; color: var(--gold); }
.download-cover .cover-title { font-family: var(--serif); font-size: 1.5rem; color: var(--paper); line-height: 1.25; }
.download-cover .cover-brand { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--grey-400); }

/* Footer */
.site-footer { background: var(--ink); color: var(--grey-400); padding-block: clamp(3rem, 7vw, 5rem) 2.5rem; }
.footer-grid { display: grid; gap: 2.6rem; margin-bottom: 3rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h4 { color: var(--paper); font-family: var(--sans); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-grid ul { display: flex; flex-direction: column; gap: .65rem; }
.footer-grid a:hover { color: var(--paper); }
.footer-tagline { max-width: 26rem; font-family: var(--serif); font-size: 1.15rem; color: var(--grey-100); margin-top: 1.2rem; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; padding-top: 2rem; border-top: 1px solid var(--line-dark); font-size: .78rem; }
.footer-bottom ul { flex-direction: row; gap: 1.4rem; }

/* Hero (home + inner pages) */
.hero {
  padding-top: clamp(4rem, 10vw, 7.5rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}
.hero-abstract {
  position: absolute; inset: 0; z-index: -1;
  opacity: .9;
}
.hero-content { max-width: 44rem; }
.hero-content .hero-sub { margin-top: 1.6rem; }
.hero-content .btn-row { margin-top: 2.4rem; }

.page-hero {
  padding-top: clamp(3.4rem, 8vw, 5.5rem);
  padding-bottom: clamp(2.6rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.page-hero .lede { margin-top: 1.2rem; }
.breadcrumb { font-size: .78rem; color: var(--grey-400); margin-bottom: 1.4rem; }
.breadcrumb a:hover { color: var(--black); }

/* Manifesto */
.manifesto {
  max-width: 50rem; margin-inline: auto; text-align: center;
}
.manifesto p { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.4; color: var(--black); }

/* Two column */
.split { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
@media (min-width: 960px) { .split--12 { grid-template-columns: 1fr 2fr; } .split--21 { grid-template-columns: 2fr 1fr; } .split--11 { grid-template-columns: 1fr 1fr; } }

/* Table (used for methodology / EBITDA multiples) */
.data-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0 2rem; }
.data-table th, .data-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.data-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-400); font-weight: 600; }

/* =============================================================
   6. Responsive helpers
   ============================================================= */
@media (min-width: 720px)  { .container { padding-inline: 2.5rem; } }
@media (min-width: 1280px) { .container { padding-inline: var(--gutter); } }
