/* =========================================================
   BArch Creative Studios
   services.css — the seven-discipline drafting plate
   ========================================================= */

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

.services-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 5vw, 88px);
  align-items: end;
}
.services-head .section-title { max-width: 11ch; }
.services-head-copy p {
  max-width: 40ch;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}
.services-head-copy .text-link { margin-top: 24px; }

.service-reel {
  display: grid;
  grid-template-columns: minmax(210px, 0.68fr) minmax(0, 1.32fr);
  grid-template-areas: "index viewport";
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(36px, 5vw, 64px);
  padding-top: clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--line);
}

.reel-index {
  grid-area: index;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-width: 0;
}

.reel-tabs { display: flex; flex-direction: column; }
.reel-tab {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 16px;
  gap: 10px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: padding 0.35s var(--ease), color 0.25s var(--ease);
}
.reel-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1px;
  width: 2px;
  background: var(--clay);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease);
}
.reel-tab:hover { color: var(--clay-deep); }
.reel-tab:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.reel-tab[aria-selected="true"] { padding-left: 14px; }
.reel-tab[aria-selected="true"]::before { transform: scaleY(1); }
.reel-tab-num {
  padding-top: 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.reel-tab-body { min-width: 0; }
.reel-tab-title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  transition: color 0.25s var(--ease);
}
.reel-tab-tags {
  display: block;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.3s var(--ease), max-height 0.4s var(--ease), margin 0.4s var(--ease);
}
.reel-tab[aria-selected="true"] .reel-tab-tags {
  max-height: 18px;
  margin-top: 6px;
  opacity: 1;
}
.reel-tab-arrow {
  align-self: start;
  padding-top: 4px;
  font-size: 11px;
  color: var(--clay-deep);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}
.reel-tab[aria-selected="true"] .reel-tab-arrow { opacity: 1; transform: none; }

.reel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.reel-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.reel-arrows { display: flex; gap: 8px; }
.reel-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.reel-arrow:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.reel-arrow:active { transform: scale(0.94); }
.reel-arrow:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

.reel-viewport { grid-area: viewport; min-width: 0; }
.reel-stage {
  position: relative;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
}
.reel-stage::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 4;
}
.reel-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}

.reel-art {
  position: absolute;
  inset: 0;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 3vw, 34px) clamp(42px, 4.5vw, 54px);
  z-index: 1;
  opacity: 0;
  transform: translateY(10px) scale(0.994);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.reel-art.is-active { opacity: 1; transform: none; }
.reel-art svg { display: block; width: 100%; height: 100%; }
.reel-art .accent-clay { fill: var(--clay); }
.reel-art .accent-ochre { fill: var(--ochre); }
.reel-art .accent-blue { fill: var(--blue); }
.reel-art .stroke-clay { stroke: var(--clay); }
.reel-art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.reel-art.is-active.is-drawn .draw {
  animation: reel-draw 1s cubic-bezier(0.22, 0.61, 0.24, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reel-draw { to { stroke-dashoffset: 0; } }

/* Optional real photography: shown when a photo file exists. */
.reel-art .reel-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scale(1.06);
  transition: transform 1.4s var(--ease-out);
}
.reel-art.has-photo .reel-photo { display: block; }
.reel-art.has-photo.is-active .reel-photo { transform: scale(1); }
.reel-art.has-photo svg { opacity: 0; }
.reel-art.has-photo .draw { animation: none; stroke-dashoffset: 0; }
.reel-art.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(16, 42, 60, 0.04) 0%, rgba(16, 42, 60, 0.16) 100%);
}

.reel-big-num {
  position: absolute;
  top: 40px;
  right: 34px;
  z-index: 3;
  font-family: var(--serif);
  font-size: clamp(72px, 11vw, 132px);
  line-height: 1;
  color: var(--ink);
  opacity: 0.055;
  pointer-events: none;
}
.reel-big-num.is-flipping { animation: reel-num 0.55s var(--ease); }
@keyframes reel-num {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0.055; transform: none; }
}

.reel-sheet,
.reel-scale {
  position: absolute;
  bottom: 14px;
  z-index: 5;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.reel-sheet { left: 18px; }
.reel-sheet b { font-weight: 500; color: var(--clay-deep); }
.reel-scale { right: 18px; }

.reel-sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -22%;
  z-index: 2;
  width: 22%;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--clay-rgb), 0.18), transparent);
  border-left: 1px solid rgba(var(--clay-rgb), 0.55);
}
.reel-stage.is-switching .reel-sweep { animation: reel-sweep 0.8s var(--ease); }
@keyframes reel-sweep {
  0% { transform: translateX(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(560%); opacity: 0; }
}

.reel-panels { display: grid; margin-top: 22px; }
.reel-panel {
  grid-area: 1 / 1;
  max-width: 64ch;
  visibility: hidden;
  opacity: 0;
}
.reel-panel[hidden] { display: block; visibility: hidden; }
.reel-panel.is-active {
  z-index: 1;
  visibility: visible;
  opacity: 1;
  animation: reel-panel-in 0.5s var(--ease) both;
}
@keyframes reel-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.reel-panel-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.reel-panel h3 {
  margin-top: 7px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.reel-panel p {
  max-width: 58ch;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.reel-panel .service-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay-deep);
}
.reel-panel .service-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.reel-progress {
  margin-top: 20px;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.reel-progress span {
  display: block;
  height: 100%;
  background: var(--clay);
  transform-origin: left;
  transform: scaleX(0.1428);
  transition: transform 0.6s var(--ease);
}

@media (max-width: 1080px) {
  .services-head { grid-template-columns: 1fr; gap: 22px; align-items: start; }
  .services-head .section-title { max-width: 14ch; }
  .service-reel {
    grid-template-columns: 1fr;
    grid-template-areas: "tabs" "viewport" "controls";
    gap: 20px;
  }
  .reel-index { display: contents; }
  .reel-tabs {
    grid-area: tabs;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .reel-tabs::-webkit-scrollbar { display: none; }
  .reel-tab {
    grid-template-columns: auto auto;
    gap: 7px;
    width: auto;
    flex: 0 0 auto;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 100px;
    transition: background 0.25s var(--ease), color 0.25s var(--ease),
      border-color 0.25s var(--ease);
  }
  .reel-tab::before { display: none; }
  .reel-tab[aria-selected="true"] {
    padding-left: 13px;
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
  }
  .reel-tab[aria-selected="true"] .reel-tab-num { color: var(--paper); opacity: 0.75; }
  .reel-tab-title {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
  .reel-tab-tags,
  .reel-tab-arrow { display: none; }
  .reel-viewport { grid-area: viewport; }
  .reel-controls { grid-area: controls; justify-content: flex-end; }
  .reel-count { margin-right: auto; }
}

@media (min-width: 701px) and (max-width: 1080px) {
  .reel-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .reel-stage { aspect-ratio: 4 / 3; }
  .reel-art { padding: 16px 16px 40px; }
  .reel-panel h3 { font-size: 1.6rem; }
  .reel-panel p { font-size: 13.5px; }
  .reel-big-num { top: 26px; right: 24px; font-size: 84px; }
  .reel-sheet,
  .reel-scale { bottom: 12px; font-size: 8px; }
  .reel-sheet { left: 14px; }
  .reel-scale { right: 14px; }
  .reel-arrow { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-art,
  .reel-art .reel-photo,
  .reel-tab,
  .reel-tab::before,
  .reel-tab-title,
  .reel-tab-tags,
  .reel-tab-arrow,
  .reel-panel.is-active,
  .reel-big-num,
  .reel-progress span {
    animation: none !important;
    transition: none !important;
  }
  .reel-art .reel-photo { transform: none; }
  .reel-art .draw { animation: none !important; stroke-dashoffset: 0; }
  .reel-stage.is-switching .reel-sweep { display: none; }
}
