/*
Theme Name: Studiofold
Theme URI: https://example.com/studiofold
Author: Bettymedia
Author URI: https://example.com
Description: An editorial, type-led portfolio theme for creative studios and agencies. Full-bleed hero with optional video, expandable featured projects with image sliders, services accordion, client list, and a copy-email contact block. Projects, disciplines and all homepage copy are managed from the WordPress admin and Customizer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: studiofold
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
  --sf-bg: #f4f2ee;
  --sf-fg: #111111;
  --sf-muted: #6f6c66;
  --sf-line: rgba(17, 17, 17, 0.14);
  --sf-accent: #ff4d1c;
  --sf-dark-bg: #0c0c0c;
  --sf-dark-fg: #f4f2ee;

  --sf-font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --sf-gutter: clamp(1rem, 2.4vw, 2rem);
  --sf-max: 1680px;
  --sf-header-h: 64px;
  --sf-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==========================================================================
   2. Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sf-bg);
  color: var(--sf-fg);
  font-family: var(--sf-font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 3px; }

.screen-reader-text,
.skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus {
  width: auto; height: auto; clip: auto; z-index: 1000;
  top: 8px; left: 8px; padding: 8px 14px; background: var(--sf-fg); color: var(--sf-bg);
}

.wrap { width: 100%; max-width: var(--sf-max); margin-inline: auto; padding-inline: var(--sf-gutter); }

/* Type scale */
.t-display { font-size: clamp(2.6rem, 8.2vw, 9.5rem); line-height: 0.92; letter-spacing: -0.045em; font-weight: 500; }
.t-h2      { font-size: clamp(1.8rem, 4.4vw, 4.5rem); line-height: 1; letter-spacing: -0.035em; font-weight: 500; }
.t-h3      { font-size: clamp(1.25rem, 2vw, 1.9rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; }
.t-label   { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sf-muted); }
.t-body    { font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.5; }

/* ==========================================================================
   3. Header + full-screen menu
   ========================================================================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--sf-header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: var(--sf-gutter);
  mix-blend-mode: difference; color: #fff;
}

.site-header { align-items: start; }
.header-clock, .menu-toggle { margin-top: 22px; }
.site-logo { margin-top: 12px; }

.site-logo { font-weight: 600; letter-spacing: -0.03em; font-size: 1.2rem; justify-self: start; margin-top: 12px;} 
.site-logo img { max-height: 200px; width: auto; z-index: above; filter: invert(1);}
.header-clock { font-variant-numeric: tabular-nums; font-size: 0.85rem; justify-self: center;}
.menu-toggle { justify-self: end; margin-top: 22px; font-size: 0.9rem; display: inline-flex; gap: 0.6em; align-items: center;}
.menu-toggle .bars { width: 22px; height: 8px; position: relative; display: inline-block;}
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor;
  transition: transform 0.4s var(--sf-ease);
}
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after  { bottom: 0; }
.menu-open .menu-toggle .bars::before { transform: translateY(3.25px) rotate(45deg); }
.menu-open .menu-toggle .bars::after  { transform: translateY(-3.25px) rotate(-45deg); }

.menu-panel {
  position: fixed; inset: 0; z-index: 40;
  background: var(--sf-dark-bg); color: var(--sf-dark-fg);
  padding: calc(var(--sf-header-h) + 2rem) var(--sf-gutter) var(--sf-gutter);
  display: grid; grid-template-rows: 1fr auto; gap: 2rem;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--sf-ease), visibility 0s 0.7s;
}
.menu-open .menu-panel { clip-path: inset(0); visibility: visible; transition: clip-path 0.7s var(--sf-ease); padding-top:15%;}
.menu-nav a { display: block; font-size: clamp(3rem, 11vw, 9rem); line-height: 0.95; letter-spacing: -0.045em; font-weight: 500;}
.menu-nav a:hover { color: var(--sf-accent); }
.menu-nav .current-menu-item > a { color: var(--sf-accent); }
.menu-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem 2rem; font-size: 0.95rem; }
.menu-meta h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #8d8a84; margin-bottom: 0.4rem; font-weight: 400; }
.menu-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   4. Hero
   ========================================================================== */
.hero {
  position: relative; min-height: 100svh; color: #000; background: #F4F2E6;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--sf-header-h) + 2rem) var(--sf-gutter) var(--sf-gutter);
  overflow: hidden; isolation: isolate;
}
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 0%); }
.hero h1 { max-width: 16ch; }
.hero-foot { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sf-gutter); margin-top: clamp(1rem, 2vh, 4rem); align-items: end;}
.hero-eyebrow { grid-column: 1 / span 3; }
.hero-intro { grid-column: 5 / span 6; max-width: 96ch; }
.hero-more { grid-column: 12 / span 1; justify-self: end; }
.hero-more, .link-arrow { display: inline-flex; gap: 0.5em; align-items: center; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow::after { content: "\2192"; transition: transform 0.3s var(--sf-ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ==========================================================================
   5. Sections
   ========================================================================== */
.section { padding-block: clamp(4rem, 10vw, 9rem); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: clamp(2rem, 5vw, 4rem); gap: 1rem; }
.rule { border: 0; border-top: 1px solid var(--sf-line); margin: 0; }

/* ---- Featured work (expandable rows) ---- */
.work-list { border-top: 1px solid var(--sf-line); }
.work-item { border-bottom: 1px solid var(--sf-line); }
.work-summary {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sf-gutter);
  align-items: center; padding-block: clamp(1.2rem, 2.4vw, 2.2rem);
}
.work-title { grid-column: 1 / span 6; font-size: clamp(2rem, 5.5vw, 6rem); letter-spacing: -0.045em; line-height: 0.95; font-weight: 500; transition: transform 0.5s var(--sf-ease), color 0.3s; }
.work-summary:hover .work-title { transform: translateX(0.6rem); color: var(--sf-accent); }
.work-tagline { grid-column: 7 / span 3; color: var(--sf-muted); }
.work-tags { grid-column: 10 / span 2; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.work-tags li { font-size: 0.78rem; border: 1px solid var(--sf-line); border-radius: 99px; padding: 0.1rem 0.7rem; }
.work-toggle { grid-column: 12 / span 1; justify-self: end; font-size: 0.9rem; }
.work-toggle .less { display: none; }
.work-item.is-open .work-toggle .more { display: none; }
.work-item.is-open .work-toggle .less { display: inline; }

.work-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.7s var(--sf-ease); }
.work-item.is-open .work-panel { grid-template-rows: 1fr; }
.work-panel-inner { overflow: hidden; min-height: 0; }
.work-detail { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sf-gutter); padding-bottom: clamp(2rem, 4vw, 4rem); }
.work-solutions { grid-column: 1 / span 3; }
.work-solutions h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sf-muted); font-weight: 400; margin-bottom: 0.6rem; }
.work-solutions li { padding-block: 0.15rem; }
.work-copy { grid-column: 5 / span 8; max-width: 62ch; }
.work-copy > * + * { margin-top: 1em; }
.work-copy a { text-decoration: underline; text-underline-offset: 3px; }

.slider { grid-column: 1 / -1; position: relative; margin-top: clamp(1rem, 3vw, 2.5rem); }
.slider-track { display: flex; gap: var(--sf-gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 min(78%, 920px); scroll-snap-align: start; background: #e6e3dd; aspect-ratio: 16 / 10; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-ui { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: 0.9rem; }
.slider-ui button { padding: 0.2rem 0.6rem; border: 1px solid var(--sf-line); border-radius: 99px; margin-left: 0.4rem; }
.slider-ui button:hover { background: var(--sf-fg); color: var(--sf-bg); }

.section-foot { margin-top: clamp(2rem, 4vw, 3.5rem); }

/* ---- About / services / clients ---- */
.about { background: var(--sf-dark-bg); color: var(--sf-dark-fg); }
.about .t-label { color: #8d8a84; }
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(2.5rem, 6vw, 5rem) var(--sf-gutter); }
.about-title { grid-column: 1 / span 7; }
.about-text { grid-column: 1 / span 5; align-self: start; }
.about-text .link-arrow { margin-top: 1.5rem; }
.about-services { grid-column: 7 / span 6; }
.about-clients { grid-column: 1 / span 5; }
.about .rule { border-color: rgba(244, 242, 238, 0.18); }

.acc-item { border-top: 1px solid rgba(244, 242, 238, 0.18); }
.acc-item:last-child { border-bottom: 1px solid rgba(244, 242, 238, 0.18); }
.acc-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; padding-block: 1rem; font-size: clamp(1.4rem, 2.4vw, 2.2rem); letter-spacing: -0.03em; }
.acc-btn .sign { font-size: 0.9rem; color: #8d8a84; transition: transform 0.4s var(--sf-ease); }
.acc-item.is-open .sign { transform: rotate(45deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--sf-ease); }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; min-height: 0; }
.acc-panel ul { columns: 2; column-gap: 2rem; padding-bottom: 1.2rem; color: #c9c6bf; }
.acc-panel li { padding-block: 0.15rem; break-inside: avoid; }

.client-list { columns: 2; column-gap: 2rem; margin-top: 1rem; }
.client-list li { padding-block: 0.2rem; break-inside: avoid; }

/* ---- Contact ---- */
.contact { text-align: left; }
.contact-email { display: inline-block; margin-top: 2rem; font-size: clamp(1.4rem, 4vw, 3.6rem); letter-spacing: -0.04em; font-weight: 500; word-break: break-all; }
.contact-actions { display: flex; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.contact-actions a, .contact-actions button { border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.contact-actions .copied { color: var(--sf-accent); border-color: transparent; }

/* ==========================================================================
   6. Footer
   ========================================================================== */
.site-footer { padding-block: 1.5rem 2rem; border-top: 1px solid var(--sf-line); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   7. Inner pages, archive, single project, blog
   ========================================================================== */
.page-hero { padding: calc(var(--sf-header-h) + clamp(3rem, 8vw, 7rem)) 0 clamp(2rem, 5vw, 4rem); }
.page-hero .sub { margin-top: 1.5rem; max-width: 50ch; color: var(--sf-muted); }

.entry-content { max-width: 70ch; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: 2rem; letter-spacing: -0.03em; margin-top: 2em; }
.entry-content h3 { font-size: 1.4rem; letter-spacing: -0.02em; margin-top: 1.6em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { height: auto; }
.entry-content .alignwide { max-width: min(100%, 1200px); }
.entry-content .alignfull { max-width: none; }
.wp-block-image figcaption, .wp-caption-text { font-size: 0.85rem; color: var(--sf-muted); margin-top: 0.5rem; }

.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-bar a { border: 1px solid var(--sf-line); border-radius: 99px; padding: 0.25rem 1rem; font-size: 0.9rem; }
.filter-bar a.is-active, .filter-bar a:hover { background: var(--sf-fg); color: var(--sf-bg); }

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(2rem, 4vw, 3.5rem) var(--sf-gutter); }
.project-card .thumb { aspect-ratio: 4 / 3; overflow: hidden; background: #e6e3dd; }
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--sf-ease); }
.project-card:hover .thumb img { transform: scale(1.04); }
.project-card h2 { margin-top: 0.9rem; font-size: clamp(1.4rem, 2.4vw, 2.2rem); letter-spacing: -0.03em; line-height: 1.05; font-weight: 500; }
.project-card .meta { color: var(--sf-muted); display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.3rem; }

.single-project-hero { width: 100%; aspect-ratio: 16 / 8; max-height: 80svh; overflow: hidden; background: #ddd; }
.single-project-hero img { width: 100%; height: 100%; object-fit: cover; }
.project-gallery { display: grid; gap: var(--sf-gutter); margin-top: clamp(2rem, 5vw, 4rem); }
.project-gallery img { width: 100%; }
.project-nav { display: flex; justify-content: space-between; gap: 1rem; padding-block: 3rem; border-top: 1px solid var(--sf-line); margin-top: 4rem; }

.post-list article { padding-block: 2rem; border-top: 1px solid var(--sf-line); display: grid; grid-template-columns: 1fr 3fr; gap: var(--sf-gutter); }
.pagination { display: flex; gap: 1rem; padding-block: 2rem; }

/* ==========================================================================
   8. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-eyebrow, .hero-intro, .hero-more { grid-column: 1 / -1; justify-self: start; }
  .work-title { grid-column: 1 / span 10; }
  .work-toggle { grid-column: 11 / span 2; }
  .work-tagline { grid-column: 1 / span 12; grid-row: 2; }
  .work-tags { grid-column: 1 / span 12; grid-row: 3; }
  .work-solutions, .work-copy { grid-column: 1 / -1; }
  .slide { flex-basis: 88%; }
  .about-title, .about-text, .about-services, .about-clients { grid-column: 1 / -1; }
  .project-grid { grid-template-columns: 1fr; }
  .post-list article { grid-template-columns: 1fr; }
  .header-clock { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   9. Hover headline carousel
   ========================================================================== */
.hc-section {
  --hc-card-w: 520px;
  --hc-ratio: 2.06;
  --hc-gap: 20px;
  --hc-speed: 40s;
  --hc-radius: 18px;
  --hc-tilt-scale: 1;
  padding: clamp(3rem, 7vw, 5rem) 0;
  overflow: hidden;
}
.hc-headline {
  text-align: center; padding: 0 24px; margin: 0 auto 48px; max-width: 1100px;
  font-size: clamp(28px, 5vw, 64px); line-height: 1.1; font-weight: 600; letter-spacing: -0.03em;
}
.hc-prefix { display: block; color:#000;}
.hc-swap {
  display: block; color: var(--sf-accent); min-height: 2.2em;
  transition: opacity .25s ease, transform .25s ease;
}
.hc-swap.is-changing { opacity: 0; transform: translateY(8px); }

.hc-carousel {
  --hc-card-w: 520px; --hc-gap: 20px; --hc-radius: 18px; --hc-tilt-scale: 1;
  overflow: hidden; width: 100%; padding: 48px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.hc-track { display: flex; gap: var(--hc-gap); width: max-content; animation: hc-scroll var(--hc-speed, 40s) linear infinite; }
.hc-carousel:hover .hc-track, .hc-carousel:focus-within .hc-track { animation-play-state: paused; }
@keyframes hc-scroll { to { transform: translateX(calc(-50% - var(--hc-gap) / 2)); } }

.hc-slide {
  position: relative; flex: 0 0 auto; width: var(--hc-card-w); aspect-ratio: 2.06;
  border-radius: var(--hc-radius); overflow: hidden; color: #fff; background: #ddd;
  transform: rotate(calc(var(--tilt-raw, 0) * var(--hc-tilt-scale) * 1deg));
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.hc-slide:hover, .hc-slide:focus-visible { transform: rotate(0deg) scale(1.04); box-shadow: 0 18px 40px rgba(0,0,0,.22); z-index: 2; }
.hc-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.hc-slide:hover img, .hc-slide:focus-visible img { transform: scale(1.06); }
.hc-caption {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: end;
  padding: 28px 24px 20px; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
}
.hc-caption strong { font-size: 22px; font-weight: 600; }
.hc-caption span {
  font-size: 14px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.7); border-radius: 999px;
  transition: background .25s, color .25s;
}
.hc-slide:hover .hc-caption span, .hc-slide:focus-visible .hc-caption span { background: #fff; color: #000; }

@media (max-width: 1024px) {
  .hc-carousel { --hc-card-w: 420px; }
  .hc-headline { margin-bottom: 36px; }
}
@media (max-width: 700px) {
  .hc-carousel { --hc-card-w: 78vw; --hc-gap: 14px; --hc-radius: 14px; --hc-tilt-scale: .6; padding: 32px 0; }
  .hc-headline { margin-bottom: 28px; }
  .hc-swap { min-height: 2.4em; }
  .hc-caption { padding: 22px 16px 14px; }
  .hc-caption strong { font-size: 17px; }
  .hc-caption span { font-size: 10px; padding: 6px 10px; }
}
@media (max-width: 380px) {
  .hc-carousel { --hc-card-w: 84vw; }
  .hc-headline { font-size: 26px; }
}
@media (hover: none) {
  .hc-slide:hover img { transform: none; }
  .hc-slide:hover { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hc-carousel { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scroll-snap-type: x mandatory; }
  .hc-track { animation: none; }
  .hc-slide { scroll-snap-align: center; }
  .hc-slide[aria-hidden="true"] { display: none; }
  .hc-swap { transition: none; }
}

/* Carousel placed inside the hero (below the headline) */
.hero .hc-in-hero { padding: 0; margin: clamp(1.25rem, 3.5vh, 2.5rem) calc(var(--sf-gutter) * -1) 0; color: #fff; overflow: hidden; }
.hero .hc-in-hero .hc-headline {
  text-align: left; max-width: none; margin: 0 0 0 var(--sf-gutter); padding: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.9rem); font-weight: 500;
}
.hero .hc-in-hero .hc-prefix { display: inline; opacity: 0.75; }
.hero .hc-in-hero .hc-swap { display: inline-block; min-height: 0; margin-left: 0.3em; }
.hero .hc-in-hero .hc-carousel { --hc-card-w: clamp(240px, 24vw, 380px); padding: 28px 0 8px; }
.hero .hc-in-hero .hc-slide { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
@media (max-width: 700px) {
  .hero .hc-in-hero .hc-carousel { --hc-card-w: 68vw; padding-top: 20px; }
  .hero .hc-in-hero .hc-prefix, .hero .hc-in-hero .hc-swap { display: block; margin-left: 0; }
}
