/* ============================================================
   niggle.work — brand: bold, witty, precise
   ============================================================ */

:root {
  /* palette */
  --cream:      #EEE9DF;  /* Palladian — canvas */
  --oatmeal:    #C9C1B1;  /* Oatmeal — muted / borders */
  --ink:        #1B2632;  /* Abyssal — primary ink / dark */
  --slate:      #2C3B4D;  /* Blue Fantastic — secondary dark */
  --amber:      #FFB162;  /* Burning Flame — primary accent */
  --terracotta: #A35139;  /* Truffle Trouble — sparing accent */

  --ink-soft: rgba(27, 38, 50, 0.72);
  --cream-soft: rgba(238, 233, 223, 0.72);

  --maxw: 1120px;
  --radius: 22px;
  --radius-sm: 14px;

  --ff-head: 'Space Grotesk', system-ui, sans-serif;
  --ff-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
}

h1, h2, h3 { font-family: var(--ff-head); font-weight: 700; line-height: 1.05; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.accent { color: var(--amber); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-head);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--dark  { background: var(--ink); color: var(--cream); }
.btn--dark:hover { background: var(--slate); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }
.btn--amber { background: var(--amber); color: var(--ink); font-size: 1.05rem; padding: 16px 30px; }
.btn--amber:hover { background: #ffbf7d; }

/* ---------- wordmark (orange dot on the i) ---------- */
.wordmark {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  position: relative;
  display: inline-block;
}
.wm-i { position: relative; }
.wm-i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.02em;
  width: 0.2em;
  height: 0.2em;
  background: var(--amber);
  border-radius: 50%;
  transform: translateX(-50%);
}
.wm-tld { color: var(--oatmeal); }
.wordmark--sm { font-size: 1.25rem; }

/* ===================== NAV ===================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 233, 223, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(27,38,50,0.07);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav__links a:not(.btn) {
  font-family: var(--ff-head);
  font-weight: 500;
  font-size: 0.97rem;
  color: var(--ink);
}
.nav__links a:not(.btn):hover { color: var(--terracotta); }
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 24px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

/* ===================== HERO ===================== */
.hero { padding: 80px 0 90px; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero__title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.03em;
}
.hero__lead {
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: 1.35rem;
  margin-top: 26px;
}
.hero__sub {
  color: var(--ink-soft);
  max-width: 30ch;
  margin-top: 14px;
  font-size: 1.05rem;
}
.hero__cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* before / after squiggle */
.squiggle {
  margin: 0;
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: 0 24px 60px -30px rgba(27,38,50,0.4);
}
.squiggle__row { display: flex; flex-direction: column; gap: 8px; }
.squiggle__row + .squiggle__row { margin-top: 26px; }
.squiggle__label {
  font-family: var(--ff-head);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.squiggle svg { width: 100%; height: auto; overflow: visible; }
.squiggle .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  /* pathLength normalised in JS */
}
.squiggle.in .draw { animation: draw 1.4s ease forwards; }
.squiggle.in .squiggle__row:last-child .draw { animation-delay: .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ===================== FEATURE BAND ===================== */
.band { background: var(--ink); color: var(--cream); }
.band__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 54px 28px;
}
.band__item h3 { font-size: 1.2rem; margin-top: 12px; }
.band__item p { color: var(--cream-soft); margin-top: 8px; font-size: 0.98rem; }
.band__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

/* ===================== SECTIONS ===================== */
.section { padding: 92px 0; }
.section--alt { background: #E6E0D4; }
.eyebrow {
  font-family: var(--ff-head);
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--terracotta);
  margin-bottom: 14px;
}
.section__title { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
.section__intro {
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: 18px;
  font-size: 1.08rem;
}

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 44px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px 28px;
  border: 1px solid rgba(27,38,50,0.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -30px rgba(27,38,50,0.45); }
.card__num {
  font-family: var(--ff-head);
  font-weight: 700;
  color: var(--amber);
  font-size: 1.1rem;
}
.card h3 { font-size: 1.3rem; margin-top: 10px; }
.card p { color: var(--ink-soft); margin-top: 10px; }

/* ---------- steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.step {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  border-top: 3px solid var(--amber);
}
.step__num {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--oatmeal);
}
.step h3 { font-size: 1.12rem; margin-top: 6px; }
.step p { color: var(--ink-soft); margin-top: 8px; font-size: 0.95rem; }

/* ---------- honesty (great at / won't do) ---------- */
.honesty {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 760px;
}
.honesty__head {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(27,38,50,0.12);
  margin-bottom: 18px;
}
.honesty__head span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; font-size: 0.9rem;
}
.honesty__head--yes span { background: var(--amber); color: var(--ink); }
.honesty__head--no span { background: var(--terracotta); color: var(--cream); }
.honesty ul { list-style: none; padding: 0; margin: 0; }
.honesty li {
  padding: 9px 0;
  font-family: var(--ff-head);
  font-weight: 500;
  font-size: 1.05rem;
}
.honesty__col:last-child li { color: var(--ink-soft); }

/* ===================== QUOTE ===================== */
.quote { background: var(--slate); color: var(--cream); padding: 80px 0; }
.quote blockquote { margin: 0; }
.quote p {
  font-family: var(--ff-head);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.quote__last { color: var(--amber); }

/* ===================== ABOUT ===================== */
.about {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 48px;
  align-items: center;
}
.about__copy p { margin-top: 16px; color: var(--ink-soft); }
.about__copy p:first-of-type { margin-top: 0; }
.about__copy strong { color: var(--ink); font-weight: 600; }
.about__side { display: grid; gap: 18px; }
.about__portrait {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 24px 60px -30px rgba(27,38,50,0.5);
}
.about__card {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 38px 34px;
}
.about__tag {
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
}
.about__meta { color: var(--amber); margin-top: 20px; font-size: 0.92rem; }
.about__url { color: var(--cream-soft); margin-top: 26px; font-family: var(--ff-head); }

/* ===================== CONTACT ===================== */
.contact { background: var(--amber); padding: 96px 0; }
.contact__inner { text-align: center; max-width: 620px; }
.contact h2 { font-size: clamp(2rem, 5vw, 3rem); color: var(--ink); }
.contact p { color: rgba(27,38,50,0.78); margin-top: 16px; font-size: 1.1rem; }
.contact .btn { margin-top: 30px; }
.contact__small { font-size: 0.95rem; margin-top: 18px; }
.contact__small a { text-decoration: underline; }

/* ===================== FOOTER ===================== */
.footer { background: var(--ink); color: var(--cream); padding: 30px 0; }
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer .wordmark { color: var(--cream); }
.footer .wm-tld { color: var(--oatmeal); }
.footer__tag, .footer__copy { color: var(--cream-soft); font-size: 0.9rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .band__grid { grid-template-columns: 1fr; gap: 28px; text-align: left; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--cream);
    padding: 16px 28px 24px;
    border-bottom: 1px solid rgba(27,38,50,0.1);
    box-shadow: 0 20px 30px -24px rgba(27,38,50,0.5);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 10px 0; width: 100%; }
  .nav__links .btn { margin-top: 8px; }
  .hero { padding: 50px 0 64px; }
  .section { padding: 64px 0; }
  .steps { grid-template-columns: 1fr; }
  .honesty { grid-template-columns: 1fr; gap: 36px; }
}

/* ============================================================
   ENHANCEMENTS — texture, motion, micro-interactions
   ============================================================ */

/* --- warm grain texture over the whole page (very subtle) --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.nav, .hero, .band, .section, .quote, .contact, .footer, .marquee { position: relative; z-index: 2; }

/* --- hero: warm amber glow bleeding up from the bottom-right --- */
.hero { overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  right: -8%; bottom: -45%;
  width: 80%; height: 90%;
  background: radial-gradient(closest-side, rgba(255,177,98,0.40), rgba(255,177,98,0) 72%);
  pointer-events: none;
  z-index: 0;
}
.hero__grid { position: relative; z-index: 1; }

/* --- animated orange dot on the wordmark --- */
.wm-i::after { animation: dot-drop .6s cubic-bezier(.34,1.56,.64,1) .15s both; }
.wordmark:hover .wm-i::after { animation: dot-bounce .5s ease; }
@keyframes dot-drop  { from { transform: translate(-50%, -180%); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes dot-bounce { 0%,100% { transform: translateX(-50%); } 40% { transform: translate(-50%, -55%); } }

/* --- scroll reveal (only active when JS adds .js to <html>) --- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
/* stagger children */
.js .reveal[data-stagger] > * { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.js .reveal[data-stagger].is-visible > * { opacity: 1; transform: none; }
.js .reveal[data-stagger].is-visible > *:nth-child(2) { transition-delay: .08s; }
.js .reveal[data-stagger].is-visible > *:nth-child(3) { transition-delay: .16s; }
.js .reveal[data-stagger].is-visible > *:nth-child(4) { transition-delay: .24s; }
.js .reveal[data-stagger].is-visible > *:nth-child(5) { transition-delay: .32s; }

/* --- niggles marquee --- */
.marquee {
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
  padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 38s linear infinite;
}
.marquee__track span:not(.marquee__dot) {
  font-family: var(--ff-head);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--cream-soft);
}
.marquee__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --- richer button: sliding arrow on the ghost/dark CTAs --- */
.btn--dark, .btn--ghost { position: relative; }

/* --- card number gets an amber underline that grows on hover --- */
.card { position: relative; overflow: hidden; }
.card::after {
  content: "";
  position: absolute;
  left: 28px; bottom: 0;
  height: 3px; width: 0;
  background: var(--amber);
  transition: width .35s cubic-bezier(.2,.7,.2,1);
}
.card:hover::after { width: 48px; }

/* --- steps: number turns amber on hover --- */
.step { transition: transform .2s ease, box-shadow .2s ease; }
.step:hover { transform: translateY(-4px); box-shadow: 0 20px 44px -28px rgba(27,38,50,0.45); }
.step:hover .step__num { color: var(--amber); }

/* --- nav links: animated underline --- */
.nav__links a:not(.btn) { position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: var(--terracotta);
  transform: scaleX(0); transform-origin: right;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.nav__links a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }

/* --- honesty rows: slide + colour on hover --- */
.honesty li { transition: transform .2s ease, color .2s ease; }
.honesty__col:first-child li:hover { transform: translateX(6px); color: var(--terracotta); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .squiggle .draw { animation: none !important; stroke-dashoffset: 0 !important; }
  .btn:hover, .card:hover, .step:hover { transform: none; }
  .marquee__track { animation: none; }
  .wm-i::after { animation: none; }
  .js .reveal, .js .reveal[data-stagger] > * { opacity: 1 !important; transform: none !important; }
}
