/* ==========================================================================
   ARDEN & VALE — General Contractors
   Foundation stylesheet (sits above Tailwind Play CDN utilities)

   Contents
   01. Design tokens
   02. Base & typography helpers
   03. Layout shells & decorative surfaces
   04. Navigation
   05. Buttons & pills
   06. Photography placeholders
   07. Line-art cards & feature grids
   08. Marquee
   09. Accordions
   10. Forms & validation
   11. Portfolio filters
   12. Motion (reveal / counters)
   13. Utilities & accessibility
   ========================================================================== */

/* ---------- 01. Design tokens ------------------------------------------- */

:root {
  --ink: #0f172a;
  --ink-soft: #1e293b;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --cream: #faf9f7;
  --cream-2: #f3f1ed;
  --line: #e7e5e0;
  --line-dark: rgba(255, 255, 255, 0.14);
  --danger: #b91c1c;
  --shell: 88rem;
  --header-h: 4.75rem;
}

/* ---------- 02. Base & typography helpers ------------------------------- */

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: #ffffff;
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

::selection {
  background: var(--ink);
  color: #ffffff;
}

/* Everything that is anchored needs to clear the sticky header. */
[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.display {
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.86;
}

.display-md {
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
}

.eyebrow-sm {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}

.lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--muted);
}

@media (min-width: 768px) {
  .lede {
    font-size: 1.125rem;
  }
}

.tabnum {
  font-variant-numeric: tabular-nums;
}

.balance {
  text-wrap: balance;
}

/* ---------- 03. Layout shells & decorative surfaces ---------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 768px) {
  .shell {
    padding-inline: 2rem;
  }
}

@media (min-width: 1280px) {
  .shell {
    padding-inline: 2.5rem;
  }
}

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center center;
}

.bg-grid-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center center;
}

.bg-dots {
  background-image: radial-gradient(rgba(15, 23, 42, 0.16) 1px, transparent 1px);
  background-size: 20px 20px;
}

.bg-dots-light {
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hairline {
  border-color: var(--line);
}

.hairline-dark {
  border-color: var(--line-dark);
}

/* Faint hairline frame used behind hero / CTA blocks. */
.frame {
  position: relative;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: inherit;
}

/* ---------- 04. Navigation ---------------------------------------------- */

.site-header {
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header[data-scrolled="true"] {
  background-color: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1px;
  width: 100%;
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left center;
}

#mobile-menu {
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu[data-open="false"] {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

#mobile-menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 1.5px;
  background-color: var(--ink);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.scroll-progress {
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* ---------- 05. Buttons & pills ----------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 1rem 1.6rem;
  white-space: nowrap;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--ink);
  color: #ffffff;
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  background-color: #000000;
  border-color: #000000;
  box-shadow: 0 14px 34px -16px rgba(15, 23, 42, 0.75);
}

.btn-ghost {
  background-color: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink);
  box-shadow: 0 14px 34px -20px rgba(15, 23, 42, 0.5);
}

.btn-invert {
  background-color: #ffffff;
  color: var(--ink);
  border: 1px solid #ffffff;
}

.btn-invert:hover {
  background-color: var(--cream);
}

.btn-outline-invert {
  background-color: transparent;
  color: #ffffff;
  border: 1px solid var(--line-dark);
}

.btn-outline-invert:hover {
  border-color: #ffffff;
}

.btn .btn-arrow {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.5rem 0.95rem 0.5rem 0.65rem;
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--ink);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.32);
  animation: pulse-ring 2.6s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Inline arrow used on index-style list rows. */
.row-arrow {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .row-arrow,
.group:focus-visible .row-arrow {
  transform: translate(5px, -5px);
}

/* ---------- 06. Photography placeholders ------------------------------- */
/* Layered gradient "plates" that stand in for photography until final
   imagery is supplied. Each plate simulates a directional light source,
   a surface texture and film grain so layouts read as photographic.     */

.ph {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: #d8d5cf;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.07);
}

.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: inherit;
  background-blend-mode: normal;
}

.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    radial-gradient(110% 90% at 50% 120%, rgba(15, 23, 42, 0.3), transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.9;
  mix-blend-mode: multiply;
}

/* Direct children are lifted above the grain overlay. `position` is
   deliberately NOT set here so that utility classes such as `absolute`
   (used by captions and corner marks) are never overridden. */
.ph > * {
  z-index: 2;
}

/* Warm poured concrete */
.ph-concrete {
  background-color: #c9c5bc;
  background-image:
    radial-gradient(115% 85% at 16% 6%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 56%),
    radial-gradient(95% 75% at 90% 104%, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0) 62%),
    repeating-linear-gradient(114deg, rgba(255, 255, 255, 0.11) 0 2px, rgba(0, 0, 0, 0) 2px 10px);
}

/* Cool galvanised steel */
.ph-steel {
  background-color: #9aa4b1;
  background-image:
    radial-gradient(110% 80% at 78% 10%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 55%),
    radial-gradient(100% 80% at 6% 96%, rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0) 60%),
    repeating-linear-gradient(168deg, rgba(255, 255, 255, 0.13) 0 1px, rgba(0, 0, 0, 0) 1px 14px);
}

/* Warm timber / cedar cladding */
.ph-timber {
  background-color: #b78b5e;
  background-image:
    radial-gradient(115% 90% at 22% 12%, rgba(255, 236, 205, 0.9), rgba(255, 236, 205, 0) 58%),
    radial-gradient(95% 70% at 86% 100%, rgba(58, 30, 12, 0.48), rgba(58, 30, 12, 0) 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 3px, rgba(0, 0, 0, 0.08) 3px 4px);
}

/* Low-light industrial interior */
.ph-night {
  background-color: #1f2937;
  background-image:
    radial-gradient(90% 70% at 30% 12%, rgba(203, 213, 225, 0.55), rgba(203, 213, 225, 0) 58%),
    radial-gradient(120% 90% at 70% 108%, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0) 66%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 22px, rgba(0, 0, 0, 0.16) 22px 26px);
}

/* Terracotta / masonry */
.ph-clay {
  background-color: #b4694c;
  background-image:
    radial-gradient(110% 85% at 28% 8%, rgba(255, 226, 205, 0.88), rgba(255, 226, 205, 0) 56%),
    radial-gradient(100% 75% at 92% 102%, rgba(46, 15, 8, 0.5), rgba(46, 15, 8, 0) 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, rgba(0, 0, 0, 0.07) 1px 18px);
}

/* Pale curtain-wall glass */
.ph-glass {
  background-color: #b8c6d4;
  background-image:
    radial-gradient(120% 95% at 50% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 62%),
    radial-gradient(90% 70% at 12% 104%, rgba(30, 41, 59, 0.36), rgba(30, 41, 59, 0) 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, rgba(15, 23, 42, 0.1) 1px 26px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, rgba(15, 23, 42, 0.07) 1px 30px);
}

/* Deep forest / landscape plate */
.ph-verdant {
  background-color: #6f7d68;
  background-image:
    radial-gradient(110% 85% at 24% 10%, rgba(240, 248, 232, 0.8), rgba(240, 248, 232, 0) 58%),
    radial-gradient(100% 80% at 84% 104%, rgba(15, 31, 20, 0.5), rgba(15, 31, 20, 0) 62%),
    repeating-linear-gradient(72deg, rgba(255, 255, 255, 0.07) 0 4px, rgba(0, 0, 0, 0.05) 4px 9px);
}

/* Architectural line-art overlay drawn on top of a plate. */
.ph-arch::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' fill='none' stroke='%23ffffff' stroke-opacity='0.34' stroke-width='1.4'%3E%3Cpath d='M34 300V116l78-38 78 38v184'/%3E%3Cpath d='M190 300V58h92v242'/%3E%3Cpath d='M282 300V142h84v158'/%3E%3Cpath d='M52 152h120M52 196h120M52 240h120'/%3E%3Cpath d='M208 104h58M208 158h58M208 212h58M208 266h58'/%3E%3Cpath d='M0 300h400'/%3E%3C/svg%3E"),
    linear-gradient(140deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.7));
  background-size: cover, cover;
}

.ph-arch-dark::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300' fill='none' stroke='%230f172a' stroke-opacity='0.2' stroke-width='1.4'%3E%3Cpath d='M34 300V116l78-38 78 38v184'/%3E%3Cpath d='M190 300V58h92v242'/%3E%3Cpath d='M282 300V142h84v158'/%3E%3Cpath d='M52 152h120M52 196h120M52 240h120'/%3E%3Cpath d='M208 104h58M208 158h58M208 212h58M208 266h58'/%3E%3Cpath d='M0 300h400'/%3E%3C/svg%3E");
  background-size: cover;
}

/* Caption chip that sits inside a plate. */
.ph-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
}

.ph-tag-dark {
  background-color: rgba(15, 23, 42, 0.62);
  color: #ffffff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ph-corner {
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  border-color: rgba(255, 255, 255, 0.55);
  z-index: 3;
  pointer-events: none;
}

.ph-sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.3) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .ph-sweep,
.group:focus-within .ph-sweep {
  transform: translateX(120%);
}

/* ---------- 07. Line-art cards ------------------------------------------ */

.card-line {
  position: relative;
  background-color: #ffffff;
  border: 1px solid var(--line);
  transition: border-color 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s ease;
}

.card-line:hover {
  border-color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 26px 50px -34px rgba(15, 23, 42, 0.55);
}

/* Top accent that wipes in on hover. */
.card-line::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  height: 2px;
  width: calc(100% + 2px);
  background-color: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-line:hover::before {
  transform: scaleX(1);
}

.icon-line {
  color: var(--ink);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-line:hover .icon-line {
  transform: translateY(-3px);
}

.card-line-dark {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-dark);
}

.card-line-dark:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.step-num {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

/* Checklist ticks drawn with CSS, used on tier cards. */
.tick {
  position: relative;
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 9999px;
  border: 1px solid currentColor;
  opacity: 0.85;
}

.tick::after {
  content: "";
  position: absolute;
  left: 0.34rem;
  top: 0.13rem;
  width: 0.28rem;
  height: 0.55rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}

.dash {
  border: none;
  border-top: 1px solid var(--line);
}

/* ---------- 08. Marquee ------------------------------------------------ */

.marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
}

.marquee__track {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  animation: marquee-slide 42s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee__group {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  padding-right: 3.5rem;
  flex: none;
}

@keyframes marquee-slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track {
    animation: none;
  }
}

/* ---------- 09. Accordions ---------------------------------------------- */

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

.acc:last-of-type {
  border-bottom: 1px solid var(--line);
}

.acc-trigger {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  padding: 1.6rem 0;
  transition: color 0.3s ease;
}

.acc-trigger:hover {
  color: var(--muted);
}

.acc-mark {
  position: relative;
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.4rem;
}

.acc-mark::before,
.acc-mark::after {
  content: "";
  position: absolute;
  background-color: currentColor;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.acc-mark::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  margin-top: -0.75px;
}

.acc-mark::after {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  margin-left: -0.75px;
}

.acc[data-open="true"] .acc-mark::after {
  transform: rotate(90deg);
  opacity: 0;
}

.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.acc[data-open="true"] .acc-body {
  grid-template-rows: 1fr;
}

.acc-body > div {
  overflow: hidden;
}

.acc-panel {
  padding-bottom: 1.9rem;
  padding-left: 2rem;
}

/* ---------- 10. Forms & validation -------------------------------------- */

.field-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.field {
  position: relative;
  width: 100%;
  background-color: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.9rem 1rem;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.field::placeholder {
  color: var(--muted-light);
}

.field:hover {
  border-color: #cfccc5;
}

.field:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.07);
}

.field:focus-visible {
  outline: none;
}

select.field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%230f172a' stroke-width='1.6'%3E%3Cpath d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

.field[aria-invalid="true"] {
  border-color: var(--danger);
  background-color: #fffafa;
}

.field[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.09);
}

textarea.field {
  resize: vertical;
  min-height: 9rem;
  line-height: 1.6;
}

.field-msg {
  display: none;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--danger);
}

/* Shown when the field fails validation. The attribute is set by main.js so
   the message works for plain inputs, selects, textareas and checkboxes
   alike — no reliance on sibling order. */
.field-msg[data-show="true"] {
  display: flex;
}

/* Fallback for progressively enhanced markup (input immediately followed by
   its message) in case JavaScript has not run yet. */
.field[aria-invalid="true"] ~ .field-msg {
  display: flex;
}

.field[aria-invalid="false"] ~ .field-msg {
  display: none;
}

/* Choice chips (radio / checkbox as bordered tiles) */
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 0.65rem 1.05rem;
  font-size: 0.8125rem;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.choice:hover {
  border-color: #cfccc5;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  border: 1px solid #cfccc5;
  flex: none;
  position: relative;
  transition: border-color 0.25s ease;
}

.choice-dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 9999px;
  background-color: var(--ink);
  transform: scale(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice input:checked ~ .choice-dot {
  border-color: var(--ink);
}

.choice input:checked ~ .choice-dot::after {
  transform: scale(1);
}

.choice:has(input:checked) {
  border-color: var(--ink);
  background-color: var(--ink);
  color: #ffffff;
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.checkbox-card {
  position: relative;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}

.checkbox-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  flex: none;
  margin-top: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid #cfccc5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.checkbox-box svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkbox-card input:checked ~ .checkbox-box {
  background-color: var(--ink);
  border-color: var(--ink);
}

.checkbox-card input:checked ~ .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.checkbox-card:has(input:focus-visible) .checkbox-box {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.checkbox-card[data-invalid="true"] .checkbox-box {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.09);
}

.btn-spinner {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.alert {
  border: 1px solid rgba(185, 28, 28, 0.28);
  background-color: #fffafa;
  color: #7f1d1d;
}

.alert[data-hidden="true"] {
  display: none;
}

[data-quote-success][data-hidden="true"] {
  display: none;
}

.char-count {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.char-count[data-state="warn"] {
  color: #b45309;
}

.char-count[data-state="ok"] {
  color: var(--ink);
}

/* ---------- 11. Portfolio filters --------------------------------------- */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 0.65rem 1.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  background-color: #ffffff;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill[aria-pressed="true"] {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.filter-pill .pill-count {
  margin-left: 0.45rem;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.project-card {
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card[hidden] {
  display: none;
}

.project-card[data-filtering="true"] {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}

.empty-state[hidden] {
  display: none;
}

/* ---------- 12. Motion -------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal[data-reveal="left"] {
  transform: translateX(-26px);
}

.reveal[data-reveal="scale"] {
  transform: scale(0.975);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- 13. Utilities & accessibility ------------------------------- */

.no-bar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-bar::-webkit-scrollbar {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.footer-wordmark {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.82;
}

.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-underline:hover {
  background-size: 100% 1px;
}

.sr-only-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-200%);
  background-color: var(--ink);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  border-radius: 9999px;
  transition: transform 0.25s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.rule-y {
  border-left: 1px solid var(--line);
}

@media (min-width: 768px) {
  .rule-y-md {
    border-left: 1px solid var(--line);
  }
}