/* ==========================================================================
   Components v2 — editorial, image-led, flat
   ========================================================================== */

/* Generic image frame: every real photo in the template sits in one of
   these so aspect ratio stays controlled before real photos are dropped in. */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.ratio-1-1   { aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-sunken); border-radius: var(--r-sharp); }
.ratio-4-3   { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-sunken); border-radius: var(--r-sharp); }
.ratio-3-4   { aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-sunken); border-radius: var(--r-sharp); }
.ratio-16-9  { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-sunken); border-radius: var(--r-sharp); }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .9rem 1.7rem;
  border-radius: var(--r-soft);
  font-size: .95rem;
  font-weight: 600;
  border: 2px solid var(--text-primary);
  transition: transform var(--dur-fast) var(--ease-editorial), background var(--dur-fast) ease, color var(--dur-fast) ease;
  white-space: nowrap;
}
.btn-primary { background: var(--text-primary); color: var(--bg-base); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--text-primary); color: var(--bg-base); }
.btn-sm { padding: .6rem 1.2rem; font-size: .85rem; }

/* ---------------------------------------------------------------------- */
/* Layout split modifiers                                                  */
/* These replace one-off inline `grid-template-columns` styles. Inline     */
/* styles always beat a stylesheet's media query, which is exactly what   */
/* broke responsiveness before (columns stayed side-by-side at any width).*/
/* Wrapping them in a min-width query means the base .hero-grid mobile     */
/* collapse rule (1fr) is always free to win below 901px.                  */
/* ---------------------------------------------------------------------- */
@media (min-width: 901px) {
  .split-even    { grid-template-columns: 1fr 1fr; }
  .split-108-92  { grid-template-columns: 1.1fr .9fr; }
  .split-78-122  { grid-template-columns: .78fr 1.22fr; }
  .split-100-130 { grid-template-columns: 1fr 1.3fr; }
}

.trio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 900px) { .trio-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .trio-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------- */
/* Hero — image-led masthead spread, signature tilted photo tag           */
/* ---------------------------------------------------------------------- */
.hero { padding-block: var(--sp-5) var(--sp-6); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr .82fr;
  align-items: center;
  gap: var(--sp-5);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: .1em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  margin-bottom: var(--sp-2);
}
.hero h1 {  max-width: 100%; font-weight: 700; }
.lede { font-size: var(--fs-body-lg); max-width: 48ch; color: var(--text-secondary); }
.hero-cta-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: var(--sp-5);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.hero-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  color: var(--text-primary);
}
.hero-stat span { font-size: var(--fs-small); color: var(--text-muted); }

/* Signature element: framed portrait with 3D tilt + floating layers behind it.
   The stage establishes perspective; .tilt-3d elements are rotated by JS
   on mousemove (see main.js) and eased back to rest on mouseleave. */
.tilt-stage {
  position: relative;
  perspective: 1200px;
}
.tilt-3d {
  transition: transform 320ms var(--ease-editorial);
  transform-style: preserve-3d;
  will-change: transform;
}
.portrait-frame {
  position: relative;
  border: 2px solid var(--text-primary);
  border-radius: var(--r-soft);
  padding: 10px;
  background: var(--bg-raised);
  transform: rotateX(4deg) rotateY(-8deg);
}
.portrait-frame .ratio-3-4 { background: var(--bg-sunken); }
.portrait-tag {
  position: absolute;
  top: -18px;
  inset-inline-end: -22px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: .6rem 1rem;
  border-radius: var(--r-sharp);
  transform: translateZ(40px) rotate(6deg);
  box-shadow: var(--shadow-1);
}

/* Floating decorative panels behind the portrait, drifting gently */
.float-deco {
  position: absolute;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-soft);
  background: var(--accent-soft);
  z-index: -1;
  animation: drift 7s ease-in-out infinite;
}
.float-deco.d1 { width: 160px; height: 110px; top: 6%; inset-inline-start: -8%; transform: translateZ(-70px) rotate(-6deg); animation-delay: 0s; }
.float-deco.d2 { width: 120px; height: 120px; bottom: 4%; inset-inline-end: -6%; border-color: var(--accent); background: transparent; transform: translateZ(-40px) rotate(10deg); animation-delay: 1.2s; }

@keyframes drift {
  0%, 100% { transform: translateZ(-70px) rotate(-6deg) translateY(0); }
  50%      { transform: translateZ(-70px) rotate(-6deg) translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .float-deco { animation: none; }
}

/* ---------------------------------------------------------------------- */
/* Section headings                                                        */
/* ---------------------------------------------------------------------- */
.section { padding-block: var(--sp-6); }
.section-head { max-width: 640px; margin-bottom: var(--sp-5); }
.section-head-row {
  display: flex; justify-content: space-between; align-items: end;
  flex-wrap: wrap; gap: var(--sp-3); max-width: none; margin-bottom: var(--sp-5);
}

/* ---------------------------------------------------------------------- */
/* Flat cards (services, values, etc.)                                    */
/* ---------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--border); border-inline-start: 1px solid var(--border); }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.flat-card {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  border-inline-end: 1px solid var(--border);
  transition: background var(--dur-fast) ease, transform var(--dur-med) var(--ease-editorial);
}
.flat-card:hover { background: var(--accent-soft); transform: translateY(-3px); }
.flat-card .num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: .85rem;
  display: block;
  margin-bottom: var(--sp-2);
}
.flat-card h3 { margin-bottom: .5rem; }
.flat-card p { margin-bottom: 0; font-size: .95rem; }
.icon-tile {
  width: 44px; height: 44px;
  border: 1px solid var(--border-strong);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: var(--sp-3);
}

/* ---------------------------------------------------------------------- */
/* Timeline (resume) — vertical ledger                                    */
/* ---------------------------------------------------------------------- */
.ledger { position: relative; padding-inline-start: var(--sp-5); border-inline-start: 2px solid var(--text-primary); }
.ledger-item { position: relative; padding-bottom: var(--sp-5); }
.ledger-item:last-child { padding-bottom: 0; }
.ledger-item::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(-1 * var(--sp-5) - 5px);
  top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.ledger-period { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent); margin-bottom: .35rem; display: block; }
.ledger-item h3 { margin-bottom: .3rem; }
.ledger-org { color: var(--text-muted); font-size: .9rem; margin-bottom: .6rem; display: block; }

/* ---------------------------------------------------------------------- */
/* Skills                                                                  */
/* ---------------------------------------------------------------------- */
.skill-bar-row { margin-bottom: var(--sp-3); }
.skill-bar-label { display: flex; justify-content: space-between; margin-bottom: .5rem; font-size: .95rem; }
.skill-bar-track { height: 6px; background: var(--bg-sunken); overflow: hidden; }
.skill-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width 1.1s var(--ease-editorial); }
.tool-chip-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.tool-chip { padding: .55rem 1.1rem; border: 1px solid var(--border-strong); border-radius: var(--r-pill); font-size: .88rem; display: inline-flex; align-items: center; gap: .5rem; }

/* ---------------------------------------------------------------------- */
/* Portfolio / Project gallery — large editorial tiles with real photos   */
/* ---------------------------------------------------------------------- */
.portfolio-filter { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.filter-btn { padding: .55rem 1.2rem; border: 1px solid var(--border-strong); border-radius: var(--r-pill); font-size: .88rem; color: var(--text-secondary); transition: all var(--dur-fast) ease; }
.filter-btn.is-active, .filter-btn:hover { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); perspective: 1000px; }
@media (max-width: 700px) { .project-grid { grid-template-columns: 1fr; } }

.project-tile { display: block; text-align: start; width: 100%; transition: transform var(--dur-med) var(--ease-editorial); transform-style: preserve-3d; }
.project-tile:hover { transform: rotateX(3deg) rotateY(-4deg) translateY(-4px); }
.project-tile .ratio-4-3 { border: 1px solid var(--border); border-radius: var(--r-soft); }
.project-tile:hover img { transform: scale(1.06); }
.project-tile img { transition: transform var(--dur-slow) var(--ease-editorial); }
.tile-caption { display: flex; justify-content: space-between; align-items: start; padding-top: var(--sp-2); gap: var(--sp-2); }
.tile-caption .num { font-family: var(--font-mono); color: var(--accent); font-size: .8rem; }
.tile-caption h3 { margin: .2rem 0 0; font-size: 1.1rem; }
.tile-caption span.label { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

/* ---------------------------------------------------------------------- */
/* Pricing                                                                 */
/* ---------------------------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; border-top: 2px solid var(--text-primary); border-inline-start: 1px solid var(--border); }
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; border-inline-start:none; } }
.price-card { padding: var(--sp-4); border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; transition: transform var(--dur-med) var(--ease-editorial); -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); }
.price-card.is-featured { background: var(--accent-soft); transform: translateY(0px) scale(1); -webkit-transform: translateY(0px) scale(1); -moz-transform: translateY(0px) scale(1); -ms-transform: translateY(0px) scale(1); -o-transform: translateY(0px) scale(1); }
.price-tag { font-family: var(--font-mono); font-size: 2.2rem; margin: var(--sp-2) 0; }
.price-tag small { font-size: .9rem; color: var(--text-muted); }
.price-features { margin: var(--sp-3) 0; flex-grow: 1; }
.price-features li { padding: .55rem 0; border-top: 1px solid var(--border); font-size: .9rem; }
.price-features li:first-child { border-top: none; }

/* ---------------------------------------------------------------------- */
/* Testimonials — with real avatar photos                                  */
/* ---------------------------------------------------------------------- */
.testimonial-track { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--sp-4); }
@media (max-width: 760px) { .testimonial-track { grid-template-columns: 1fr; } }
.testimonial-card { padding: var(--sp-4) 0; border-top: 2px solid var(--text-primary); }
.testimonial-card .quote-mark { color: var(--accent); font-size: 2.6rem; font-family: var(--font-display); line-height: 1; }
.testimonial-person { display: flex; align-items: center; gap: .8rem; margin-top: var(--sp-3); }
.testimonial-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--bg-sunken); }

/* ---------------------------------------------------------------------- */
/* Statistics                                                             */
/* ---------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-3); text-align: center; }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat-grid.cols-3 { grid-template-columns: repeat(3,1fr); }
@media (max-width: 560px) { .stat-grid.cols-3 { grid-template-columns: 1fr; } }
.stat-item b { display: flex; justify-content: center; align-items: center; font-family: var(--font-mono); font-size: 2.3rem; color: var(--accent); }
.stat-item div { font-size: .88rem; color: var(--text-muted); max-width: 100%; text-align: center;}

/* ---------------------------------------------------------------------- */
/* FAQ / Accordion                                                        */
/* ---------------------------------------------------------------------- */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:first-child { border-top: 2px solid var(--text-primary); }
.accordion-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) 0; text-align: start; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.accordion-trigger .plus { transition: transform var(--dur-fast) ease; color: var(--accent); font-size: 1.4rem; }
.accordion-item.is-open .plus { transform: rotate(45deg); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height var(--dur-med) var(--ease-editorial); }
.accordion-panel-inner { padding-bottom: var(--sp-3); color: var(--text-secondary); font-size: .97rem; }

/* ---------------------------------------------------------------------- */
/* Tabs                                                                    */
/* ---------------------------------------------------------------------- */
.tab-list { display: flex; gap: .3rem; border-bottom: 2px solid var(--text-primary); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.tab-btn { padding: .8rem 1.2rem; font-size: .92rem; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn.is-active { color: var(--text-primary); border-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; color: var(--text-muted); }
.field input, .field textarea, .field select {
  padding: .85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sharp);
  background: var(--bg-raised);
  transition: border-color var(--dur-fast) ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 140px; }
.form-note { font-size: .82rem; color: var(--text-muted); margin-top: var(--sp-2); }
.form-alert { padding: var(--sp-3); margin-bottom: var(--sp-3); font-size: .92rem; border: 1px solid var(--border-strong); border-radius: var(--r-sharp); }
.form-alert.success { border-color: var(--forest-500); color: var(--forest-500); }
.form-alert.error { border-color: var(--rust-500); color: var(--rust-500); }

/* Honeypot field: hidden from real users/screen readers, still submitted so
   the handler can detect bots. Uses the same clip-rect technique as
   .visually-hidden instead of position:absolute + a large negative offset,
   so it can never expand the page's scrollable width. */
.hp-field {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.newsletter-box { display: flex; gap: .6rem; border: 1px solid var(--border-strong); border-radius: var(--r-pill); overflow: hidden; max-width: 480px; }
.newsletter-box input { flex: 1; background: transparent; padding: .8rem 1rem; }
.newsletter-box .btn { border: none; border-inline-start: 1px solid var(--border-strong); border-radius: 0; }

/* ---------------------------------------------------------------------- */
/* Breadcrumb / Pagination                                                 */
/* ---------------------------------------------------------------------- */
.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: .87rem; color: var(--text-muted); margin-bottom: var(--sp-4); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .5; }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: var(--sp-5); }
.pagination a, .pagination span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border-strong); font-size: .9rem; }
.pagination .is-current { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }

/* ---------------------------------------------------------------------- */
/* Modal / Gallery lightbox                                                */
/* ---------------------------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 800; background: rgba(22,21,15,.78); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all var(--dur-med) ease; padding: var(--gutter); }
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal-box { background: var(--bg-raised); border: 2px solid var(--text-primary); border-radius: var(--r-soft); max-width: 680px; width: 100%; padding: var(--sp-4); transform: translateY(14px); transition: transform var(--dur-med) var(--ease-editorial); max-height: 86vh; overflow-y: auto; position: relative; }
.modal-overlay.is-open .modal-box { transform: translateY(0); }
.modal-close { position: absolute; top: var(--sp-3); inset-inline-end: var(--sp-3); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; }

/* ---------------------------------------------------------------------- */
/* Page header banner                                                       */
/* ---------------------------------------------------------------------- */
.page-banner { padding-block: var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--border); }
.page-banner h1 { font-size: var(--fs-h1); }

/* ---------------------------------------------------------------------- */
/* 404                                                                      */
/* ---------------------------------------------------------------------- */
.error-stage { text-align: center; padding-block: var(--sp-7); }
.error-code { font-family: var(--font-display); font-size: clamp(5rem, 4rem + 6vw, 9rem); color: var(--accent); line-height: 1; }

/* ---------------------------------------------------------------------- */
/* Article / long-form content                                             */
/* ---------------------------------------------------------------------- */
.article-body p { font-size: 1.05rem; line-height: 1.95; }
.article-body h2 { margin-top: var(--sp-5); }
.article-body blockquote {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: var(--sp-3);
  margin: var(--sp-4) 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
}
.article-figure { margin: var(--sp-4) 0; }
.article-figure figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .6rem; }

/* ---------------------------------------------------------------------- */
/* Scroll reveal utility                                                    */
/* ---------------------------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-editorial), transform var(--dur-slow) var(--ease-editorial); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }


