/* ==========================================================================
   KYND Advisory — components: logo, header, menu, buttons, forms, footer
   ========================================================================== */

/* ---------- logo (SVG used as a mask so it takes any colour) ---------- */
.logo {
  display: block;
  width: clamp(104px, 9vw, 132px);
  aspect-ratio: 4800 / 1671;
  background: currentColor;
  -webkit-mask: url("../images/brand/kynd-logo.svg") center / contain no-repeat;
  mask: url("../images/brand/kynd-logo.svg") center / contain no-repeat;
}
.symbol {
  display: block;
  aspect-ratio: 1740 / 1671;
  background: currentColor;
  -webkit-mask: url("../images/brand/kynd-symbol.svg") center / contain no-repeat;
  mask: url("../images/brand/kynd-symbol.svg") center / contain no-repeat;
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  color: var(--ink);
  transition: transform 0.5s var(--ease-out), background-color 0.3s, color 0.3s;
}
.site-header[data-theme="dark"] { color: var(--paper); }
.site-header.is-solid { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.menu-open { background: transparent; color: var(--ink); box-shadow: none; transform: none; }

.site-nav ul { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.site-nav a:not(.btn) {
  position: relative; font-weight: 500; font-size: 1rem; padding-block: 8px; display: inline-block;
}
.site-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease-out);
}
.site-nav a:not(.btn):hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav .btn { padding-block: 0.8em; font-size: 0.95rem; }

.menu-toggle {
  display: none; align-items: center; gap: 10px;
  font-weight: 600; min-height: 48px; padding-inline: 4px; position: relative; z-index: 2;
}
.menu-toggle .dot { width: 14px; height: 14px; margin: 0; background: currentColor; transition: transform 0.4s var(--ease-out); }
.menu-toggle[aria-expanded="true"] .dot { transform: scale(1.7); }

/* mobile menu panel */
.menu-panel {
  position: fixed; inset: 0; z-index: 90; background: var(--lime); color: var(--ink);
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: circle(0% at calc(100% - 56px) 38px);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-io), visibility 0s 0.7s;
}
.menu-panel.is-open { clip-path: circle(150% at calc(100% - 56px) 38px); visibility: visible; transition: clip-path 0.7s var(--ease-io), visibility 0s; }
.menu-panel ul { display: grid; gap: 2px; }
.menu-panel li a {
  display: flex; align-items: baseline; gap: 0.25em;
  font-size: clamp(3rem, 14.5vw, 5rem);
  padding-block: 4px;
}
.menu-panel li a .dot { width: 0.16em; height: 0.16em; background: var(--ink); display: none; }
.menu-panel li a:hover .dot, .menu-panel li a[aria-current="page"] .dot { display: inline-block; }
.menu-panel__foot { display: grid; gap: 6px; font-size: 1.05rem; }
.menu-panel__foot a { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

@media (max-width: 960px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-hover: var(--navy);
  --cut: 0.85em;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 0.75em;
  padding: 1.05em calc(1.9em + var(--cut)) 1.05em 1.6em;
  font-weight: 600; font-size: 1rem; line-height: 1; letter-spacing: -0.005em;
  color: var(--btn-fg); background: none; cursor: pointer; white-space: nowrap;
  transition: color 0.3s;
}
.btn::before, .btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}
.btn::before { background: var(--btn-bg); }
.btn::after {
  background: var(--btn-hover);
  clip-path: polygon(0 100%, 100% 100%, calc(100% - var(--cut)) 100%, 0 100%);
  transition: clip-path 0.5s var(--ease-out);
}
.btn:hover::after, .btn:focus-visible::after {
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}
.btn--lime { --btn-bg: var(--lime); --btn-fg: var(--ink); --btn-hover: var(--paper); }
.btn--paper { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-hover: var(--lime); }
.btn--ghost-hover:hover { color: var(--paper); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.link {
  display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  transition: background-size 0.45s var(--ease-out);
}
.link:hover { background-size: 0 2px; background-position: 100% 100%; }
.link svg { width: 0.9em; height: 0.9em; transition: transform 0.4s var(--ease-out); }
.link:hover svg { transform: translate(3px, -3px); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > legend, .fieldset > legend { font-size: 0.95rem; font-weight: 600; padding: 0; }
.field .hint { font-weight: 400; opacity: 0.72; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid currentColor;
  padding: 10px 0 12px; font-size: 1.25rem; line-height: 1.3; border-radius: 0; appearance: none; -webkit-appearance: none;
}
.field textarea { resize: vertical; min-height: 7.5em; }
.field select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(-45deg, transparent 50%, currentColor 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 7px) 55%; background-size: 7px 7px; background-repeat: no-repeat;
  padding-right: 32px;
}
.field select option { color: var(--ink); background: var(--paper); }
.field input::placeholder, .field textarea::placeholder { color: currentColor; opacity: 0.5; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; box-shadow: none; border-bottom-width: 6px; padding-bottom: 8px;
}
.field [aria-invalid="true"] { border-bottom-color: #c4182a; }
.on-lime .field [aria-invalid="true"] { border-bottom-color: #a00f1e; }
.field-error { font-size: 0.9rem; font-weight: 600; color: #b3121f; min-height: 0; }
.on-lime .field-error { color: #8a0b17; }
.field-error:empty { display: none; }

.fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: block; padding: 10px 16px; border: 2px solid currentColor; font-weight: 500; font-size: 1rem;
  transition: background-color 0.2s, color 0.2s;
}
.chip input:checked + span { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 3px; }
.form-note { font-size: 0.9rem; opacity: 0.8; max-width: 44ch; }
.form-status { font-weight: 600; min-height: 1.5em; }
.form-status[data-state="ok"] { padding: 18px 20px; background: var(--ink); color: var(--lime); }
.form-status[data-state="error"] { color: #8a0b17; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); padding: clamp(56px, 8vw, 112px) var(--gutter) 28px; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 72px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
.site-footer .logo { width: clamp(150px, 16vw, 230px); color: var(--paper); }
.site-footer__tag { margin-top: 22px; font-family: var(--serif); font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1.1; max-width: 14ch; color: var(--lime); }
.site-footer h2 { font-size: 0.95rem; font-weight: 500; opacity: 0.62; margin-bottom: 14px; }
.site-footer li + li { margin-top: 8px; }
.site-footer a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.4s var(--ease-out), color 0.2s; padding-bottom: 2px; }
.site-footer a:hover { background-size: 100% 1px; color: var(--lime); }
.site-footer address { font-style: normal; line-height: 1.5; }
.site-footer__base {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px solid var(--rule-light); font-size: 0.92rem; opacity: 0.85;
}
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ---------- page transition: the dot grows to fill the screen ---------- */
.wipe {
  position: fixed; inset: 0; z-index: 400; background: var(--lime); pointer-events: none;
  clip-path: circle(0% at 50% 50%); will-change: clip-path;
}

html.is-wiping .wipe { clip-path: circle(150% at 50% 50%); }

/* default dark button: wipe to navy and lift the label to lime */
.btn:not(.btn--lime):not(.btn--paper):hover,
.btn:not(.btn--lime):not(.btn--paper):focus-visible { color: var(--lime); }
