/* V1 theme palettes, primary actions and quiet utility controls. */
:root {
  --button-top: #42403c;
  --button-bottom: #2b2926;
  --button-edge: #5b5750;
  --button-ink: #f3ebdd;
  --button-light: #fff1dc52;
  --button-shade: #0005;
  --button-contact: #0008;
  --button-glow: #90867835;
  --button-active-top: #a65937;
  --button-active-bottom: #76381f;
  --button-active-edge: #ab6849;
  --button-active-ink: #fff4e6;
  --button-active-glow: #b868413c;
  --focus-ink: #ffd0a4;
  --section-tint: #1b1a18;
}

.header-tools { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  display: inline-grid; place-items: center; flex: 0 0 42px; width: 42px;
  min-height: 42px; padding: 0; border-radius: 6px;
}
.theme-toggle svg { width: 19px; height: 19px; pointer-events: none; }
.theme-toggle .theme-moon, [data-theme="light"] .theme-toggle .theme-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-moon { display: block; }

:root body button {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  transition: background-color 150ms ease, border-color 150ms ease;
}
:root body button:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
:root body button[aria-pressed="true"] {
  color: var(--fg);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: none;
}
:root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact,
              .theme-toggle, .stack button, .deck-controls button, dialog button) {
  --control-top: var(--button-top);
  --control-bottom: var(--button-bottom);
  --control-edge: var(--button-edge);
  --control-ink: var(--button-ink);
  --control-glow: var(--button-glow);
  color: var(--control-ink);
  background: linear-gradient(180deg, var(--control-top) 0%, var(--control-bottom) 100%);
  border: 1px solid var(--control-edge);
  box-shadow: inset 0 1px var(--button-light), inset 0 -2px var(--button-shade),
              0 1px 2px var(--button-contact), 0 8px 24px -6px var(--control-glow);
  transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}
:root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  --control-top: var(--button-active-top);
  --control-bottom: var(--button-active-bottom);
  --control-edge: var(--button-active-edge);
  --control-ink: var(--button-active-ink);
  --control-glow: var(--button-active-glow);
}
:root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact,
              .stageart button, .segments button, .deck-controls button, dialog button) {
  border-radius: 6px;
}
:root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact,
              .theme-toggle, .stack button, .deck-controls button, dialog button):hover {
  border-color: color-mix(in srgb, var(--control-edge), var(--control-ink) 30%);
}
:root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact,
              .theme-toggle, .stack button, .deck-controls button, dialog button):active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px var(--button-shade);
}
@media (prefers-reduced-motion: no-preference) {
  :root body :is(.btn, .site-header .direct-phone, .site-header .mobile-contact):is(:hover,:focus-visible)::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 33%, #ffe1be32 50%, transparent 67%);
    animation: advertia-button-sheen 650ms ease-out both;
  }
  @keyframes advertia-button-sheen {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
  }
}
:root body :is(button, .btn, .site-header .direct-phone, .site-header .mobile-contact):focus-visible {
  outline: 2px solid var(--focus-ink); outline-offset: 3px;
}
:root body button:disabled { opacity: .65; cursor: not-allowed; }
:root body .dock button { border-color: transparent; box-shadow: none; background: transparent; color: var(--muted); }
:root body .dock button.current { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
:root body .filters button, :root body .toolbar button { border-radius: 5px; margin: 0 4px 5px 0; }
:root body .filters button { min-height: 44px; }
:root body .intake-controls .back { text-decoration: none; border-radius: 5px; padding-inline: 14px; }
@media (min-width: 761px) and (max-width: 900px) { .header-tools { gap: 6px; } }
@media (max-width: 390px) {
  .header-tools { gap: 6px; }
  .site-header.wrap { padding-inline: 14px; gap: 8px; }
  .site-header .brand { font-size: 19px; }
  .site-header .brand b { margin-right: 6px; }
  :root body .site-header .mobile-contact { padding-inline: 10px; font-size: 14px; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #191919;
  --muted: #52514e;
  --line: #d9d7d2;
  --accent: #943f29;
  --paper-card: #ffffff;
  --paper-inset: #f7f7f5;
  --paper-cream: #f3f2ef;
  --paper-strong: #e8e7e3;
  --section-tint: #f6f6f4;
  --focus-ink: #783b25;
  --button-top: #ffffff;
  --button-bottom: #e8e7e3;
  --button-edge: #aaa7a0;
  --button-ink: #22211f;
  --button-light: #fffc;
  --button-shade: #5f382b3b;
  --button-contact: #4c2c213b;
  --button-glow: #a464411a;
  --button-active-top: #9b5133;
  --button-active-bottom: #703722;
  --button-active-edge: #733e29;
  --button-active-ink: #fff4e6;
  --button-active-glow: #a4644133;
}
[data-theme="light"] ::selection { background: #813e28; color: #fffaf2; }
[data-theme="light"] :is(input,select,textarea,.catalogue input) { background: #fff; color: var(--fg); border-color: #aaa7a0; caret-color: var(--accent); }
[data-theme="light"] :is(input,textarea)::placeholder { color: #66645e; }
[data-theme="light"] :is(input,select,textarea):focus-visible { outline-color: var(--focus-ink); }
[data-theme="light"] .site-header { border-bottom: 1px solid var(--line); }
[data-theme="light"] .site-header .nav-panel { background: var(--paper-card); border-color: #cac8c2; box-shadow: 0 20px 42px #24232124; }
[data-theme="light"] .site-header :is(.nav-menu-index,.nav-panel-small .social-profiles) { border-color: var(--line); }
[data-theme="light"] .site-header :is(.nav-menu-grid,.nav-panel-small) a:hover { background: var(--paper-cream); }
[data-theme="light"] :is(.nav-item-text > span,.site-header .direct-email,.footer-contact a) { color: var(--muted); }
[data-theme="light"] .nav-art { background: var(--paper-strong); border-color: var(--line); }
[data-theme="light"] .social-profiles a { border-color: #aaa7a0; }
[data-theme="light"] .social-profiles a:hover { background: var(--paper-cream); }
[data-theme="light"] :is(.tag,.coord,.coord time,.stageart figcaption,.platepic small,.interior .folio,.crumb,.fileline,.coverstory span,.office-deck .deck-head p,.office-deck .deck-track figcaption,.office-deck .deck-track figcaption a,.deck-controls output) { color: var(--muted); }
[data-theme="light"] .folio::before, [data-theme="light"] .office-deck .deck-track figure::before { color: var(--accent); }
[data-theme="light"] .opening {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr);
  gap: clamp(24px, 5vw, 76px);
  padding-block: clamp(34px, 5vw, 82px);
}
[data-theme="light"] .herocopy { padding-block: 22px; }
[data-theme="light"] .opening h1 {
  font-size: clamp(48px, 5.4vw, 86px);
  line-height: 1;
  font-weight: 395;
  letter-spacing: -.06em;
}
[data-theme="light"] .opening p { max-width: 40ch; }
[data-theme="light"] .stageart {
  min-height: clamp(360px, 40vw, 550px);
  isolation: isolate;
  overflow: hidden;
  border-radius: 4px;
  background: #232322;
}
[data-theme="light"] .crossfield {
  inset: 0;
  mask-image: none;
  background-image: radial-gradient(#ffffff24 .7px, transparent 1.2px);
  background-size: 12px 12px;
}
[data-theme="light"] .stageart :is(img,canvas) { height: 83%; inset: 1% 0 auto; }
:root[data-theme="light"] .opening .stageart figcaption { color: #e1dfd8; margin-right: 110px; }
:root[data-theme="light"] body .opening .stageart button {
  right: 5%;
  color: #fff;
  background: #363635;
  border-color: #888782;
}
:root[data-theme="light"] body .opening .stageart button:hover { background: #474745; }
[data-theme="light"] :is(.workbench,.coverstory,.reading a,.serviceplate,.productstrip,.partnergrid > a,.partnergrid > article) { background: var(--paper-card); }
[data-theme="light"] :is(.contactbox,.console,.stage,dialog) { background: var(--paper-inset); border-color: var(--line); }
[data-theme="light"] :is(.workstory figure,.screenproof,.evidence) { background: var(--paper-strong); }
[data-theme="light"] :is(.platepic,.partnergrid .obj,.objectwell) { background: #f4f4f2; }
[data-theme="light"] .platelabel { background: #fff; }
[data-theme="light"] .catalogcard { background: var(--paper-card); }
[data-theme="light"] .feature-services .service-feature { background: #fff; border-color: #bfbdb5; }
[data-theme="light"] .stack { background: #ecebe7; }
[data-theme="light"] .stack::before { background: #deddd8; }
[data-theme="light"] .stack article { background: #fff; border: 1px solid var(--line); }
[data-theme="dark"] :is(.platepic,.partnergrid .obj,.objectwell) { background: #252421; }
[data-theme="dark"] :is(.screenproof,.evidence) { background: #d8d2c8; }
[data-theme="light"] .office-reviews article.office-deck { background: var(--paper-card); border-color: var(--line); }
[data-theme="light"] .office-deck :is(.deck-head,.deck-controls) { border-color: var(--line); }
[data-theme="light"] .office-deck .deck-track figure { color: var(--fg); }
[data-theme="light"] .fieldhero :is(h1,small,p) { color: #f8efe1; }
[data-theme="light"] .skip:focus { color: #fffaf2; background: #442715; }
[data-theme="light"] .dock { background: #fffffff7; border-color: var(--line); box-shadow: 0 4px 16px #24232120; }
[data-theme="light"] .dock a { color: var(--muted); }
[data-theme="light"] .dock a[aria-current] { background: #f3efec; color: #78341f; }
@media (max-width: 760px) {
  [data-theme="light"] .opening { gap: 20px; padding-block: 24px 30px; }
  [data-theme="light"] .opening h1 { font-size: clamp(43px, 11vw, 56px); }
  [data-theme="light"] .herocopy { padding: 0; }
  [data-theme="light"] .stageart { min-height: clamp(230px, 68vw, 350px); }
  [data-theme="light"] .stageart figcaption { font-size: 10px; }
}

/* Keep the original V1 content measure across the site's wide layouts. */
:root {
  --site-frame: 1440px;
  --site-gutter: max(5.6vw, calc((100vw - var(--site-frame)) / 2));
}
.wrap { padding-inline: var(--site-gutter); }
@media (max-width: 760px) {
  :root { --site-gutter: 20px; }
}

/* Repeat the same subtle tint for the two homepage sections that need separation. */
#main > :is(#services, .aboutstudio) { background-color: var(--section-tint); }

/* Use rules between major sections. */
#main > :is(.software-band,#work,#services,.notes,.process-chapter,.reading-chapter,.aboutstudio,.chapter:has(.contactbox)) {
  position: relative;
}
#main > :is(#work,#services,.notes,.process-chapter,.reading-chapter,.aboutstudio,.chapter:has(.contactbox))::before {
  content: '';
  position: absolute;
  inset: 0 var(--site-gutter) auto;
  border-top: 1px solid var(--line);
  pointer-events: none;
}
.software-band .productstrip {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.about-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.about-links .textlink { display: inline-flex; align-items: center; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  :root body :is(button,.btn,.site-header .direct-phone,.site-header .mobile-contact) { transition: none; }
  :root body :is(button,.btn,.site-header .direct-phone,.site-header .mobile-contact):active { transform: none; }
}

