/* Tartan Advisory Partners — tartanadvisory.com
   Identity: TAP red, charcoal ground, PT Sans, red-dot "i".
   Layout direction: Editorial (left-aligned, outlined numerals) blended with
   the woven tartan texture at low opacity — from the approved Claude Design
   exploration ("Home 1 — Editorial" + "Home 3 — Texture-led"). */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "PT Sans";
  src: url("../fonts/pt-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PT Sans";
  src: url("../fonts/pt-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "PT Sans";
  src: url("../fonts/pt-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "PT Sans Narrow";
  src: url("../fonts/pt-sans-narrow-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --red: #C6281E;
  --red-bright: #E2493E;
  --ink: #1B1B1B;
  --ink-2: #232323;
  --ink-3: #2C2C2C;
  --line: rgba(255, 255, 255, 0.14);
  --text: #F2F1EF;
  --muted: #B4B2AE;
  --stroke: #8A8885;          /* outlined numerals */
  --sans: "PT Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --narrow: "PT Sans Narrow", "Arial Narrow", var(--sans);
  --measure: 62ch;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); margin: 0 0 1rem; text-wrap: pretty; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
p { margin: 0 0 1.1rem; max-width: var(--measure); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-bright); }
strong { color: #fff; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.red { color: var(--red); }

/* Red-dot i: dotless ı with a red tittle */
.idot { position: relative; display: inline-block; line-height: 1; }
.idot::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  top: 0.155em; width: 0.14em; height: 0.14em;
  background: var(--red); border-radius: 50%;
}

/* Label style: uppercase, letterspaced */
.label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}

/* Woven tartan texture (from Design exploration) — whisper opacity */
.texture { position: relative; }
.texture > * { position: relative; }
.texture::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../img/tartan.svg");
  background-size: 240px 240px;
  opacity: 0.07;
  -webkit-mask-image: linear-gradient(#000 65%, transparent);
  mask-image: linear-gradient(#000 65%, transparent);
}
.texture-up::before {
  -webkit-mask-image: linear-gradient(transparent, #000 40%);
  mask-image: linear-gradient(transparent, #000 40%);
}

/* ---------- Header (Editorial: wordmark left, nav right) ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.4rem var(--pad);
  max-width: 1240px; margin: 0 auto;
}
.site-header a { text-decoration: none; }
.brand-word {
  font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--text);
  white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.5vw, 2.4rem); }
.nav-link {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); padding: 0.4rem 0; white-space: nowrap;
}
.nav-link:hover { color: var(--text); }
.nav-link[aria-current="page"] { color: var(--red-bright); }
.nav-cta { color: var(--text); }
.nav-cta::after { content: " \2192"; color: var(--red-bright); }

/* Ghost / solid buttons */
.btn {
  display: inline-block; border: 1px solid var(--text); color: var(--text);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.85em 1.7em; text-decoration: none; background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-solid:hover { background: #A82119; border-color: #A82119; }

/* Underlined arrow CTA (Editorial hero style) */
.link-cta {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text); text-decoration: none;
  padding-bottom: 0.5em; border-bottom: 2px solid var(--red);
}
.link-cta::after { content: " \2192"; }
.link-cta:hover { color: var(--red-bright); }

@media (max-width: 700px) {
  /* Let the nav drop to its own full-width row instead of clipping "Contact"
     off the right edge or wrapping links to two ragged lines. */
  .site-header .bar { padding: 0.9rem var(--pad); flex-wrap: wrap; row-gap: 0.35rem; }
  .brand-word { font-size: 1.05rem; }
  .site-nav { flex: 1 0 100%; justify-content: flex-start; gap: 1.15rem; }
  .nav-link { font-size: 0.72rem; letter-spacing: 0.12em; }
}

/* ---------- Hero (Editorial split, over texture) ---------- */
.hero { padding: clamp(4rem, 11vh, 7.5rem) 0 clamp(3.5rem, 10vh, 6.5rem); }
.hero .eyebrow { display: block; margin-bottom: 1.75rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 3rem; align-items: end; }
.hero h1 { margin: 0; max-width: 18ch; }
.hero .lede { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--muted); margin: 0; }
.hero .cta-row { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; align-items: start; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vh, 5.5rem) 0; }
.section.alt { background: var(--ink-2); }
.section-title { margin-top: 0; }
.eyebrow { display: block; margin-bottom: 1rem; }
.rule-after { display: flex; align-items: baseline; gap: 1.5rem; }
.rule-after::after { content: ""; flex: 1; border-top: 1px solid var(--line); position: relative; top: -0.2em; }

/* Outlined numerals (Editorial) */
.num {
  font-size: clamp(2.6rem, 4.5vw, 3.6rem); font-weight: 700; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--stroke); letter-spacing: 0.02em;
}
@supports not (-webkit-text-stroke: 1px black) {
  .num { color: var(--stroke); }
}

/* Principle cards (home) — Texture-led style */
.p-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin: 2.5rem 0 0; padding: 0; list-style: none;
}
.p-cards a {
  display: flex; flex-direction: column; gap: 2.6rem; height: 100%;
  background: var(--ink-2); padding: 2.4rem 2.2rem 2.9rem;
  text-decoration: none; transition: background 0.15s ease;
}
.p-cards a:hover { background: var(--ink-3); }
.p-cards .p-tag { display: flex; align-items: center; gap: 0.85rem; }
.p-cards .p-tag::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none;
}
.p-cards .p-tag span {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; color: var(--muted);
}
.p-cards .p-name {
  font-size: 1.35rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; max-width: 15ch;
}
@media (max-width: 900px) { .p-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .p-cards { grid-template-columns: 1fr; } }

/* Principles index (writing) */
.principles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 4rem;
  margin: 2.5rem 0 0; padding: 0; list-style: none;
}
.principles a {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.6rem;
  padding: 2.2rem 0.5rem; text-decoration: none; border-bottom: 1px solid transparent;
}
.principles a:hover { background: var(--ink-2); }
.principles li { border-top: 1px solid var(--line); }
.principles .p-name { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.principles a:hover .num { -webkit-text-stroke-color: var(--red-bright); }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }

/* Principle sections (how-i-think) */
.principle { border-top: 1px solid var(--line); padding: 2.5rem 0 1.25rem; scroll-margin-top: 4.5rem; }
.principle .p-head { display: flex; align-items: center; gap: 1.4rem; margin-bottom: 0.75rem; }
.principle .num { font-size: 2.4rem; -webkit-text-stroke-width: 1.25px; }
.principle h2 { margin: 0; }
/* Deep-link affordance: light up the conviction the visitor arrived at */
.principle:target .num { -webkit-text-stroke-color: var(--red-bright); }
.principle:target { border-top-color: var(--red); }

/* Closing statement */
.closing { text-align: left; }
.closing .dash { width: 44px; height: 3px; background: var(--red); margin-bottom: 1.75rem; }
.closing h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); max-width: 24ch; margin: 0; }

/* Ways to work together */
.ways { list-style: none; padding: 0; margin: 1.5rem 0 0; max-width: var(--measure); }
.ways li { border-left: 3px solid var(--red); padding: 0.15rem 0 0.15rem 1.25rem; margin-bottom: 1.5rem; }
.ways .w-name { font-weight: 700; }

/* ---------- Forms ---------- */
form { max-width: 40rem; margin-top: 2rem; }
.field { margin-bottom: 1.4rem; }
label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem; }
input, textarea {
  width: 100%; background: var(--ink-2); border: 1px solid var(--line);
  color: var(--text); font: inherit; padding: 0.8rem 0.9rem; border-radius: 0;
}
input:focus, textarea:focus { outline: 2px solid var(--red-bright); outline-offset: 0; border-color: transparent; }
textarea { min-height: 9rem; resize: vertical; }
.form-note { color: var(--muted); font-size: 0.92rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(3rem, 8vh, 5rem); border-top: 1px solid var(--line); }
.site-footer .inner { padding: 2.25rem var(--pad) 2.75rem; max-width: 1240px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; align-items: center; justify-content: space-between; }
.wordmark { font-family: var(--narrow); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.01em;
  color: var(--text); text-decoration: none; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--red-bright); }
.footer-mark img { width: 34px; height: 34px; display: block; }
.colophon { width: 100%; color: var(--muted); font-size: 0.85rem; margin: 0; }
