/* Optional enhancements share the site's typography and spacing system. */
:root {
  color-scheme: light;
  --page-bg: #f8fafc;
  --panel: #e2e8f0;
  --edge: #334155;
  --tool-ink: #0f172a;
  --tool-bg: #ffffff;
  --tool-accent: #1e1b4b;
  --tool-selected: #ffffff;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0b100c;
  --ink: #f8faf8;
  --muted: #d7e0d8;
  --soft: #141a15;
  --panel: #1c241e;
  --edge: #8a9a8c;
  --accent-text: #ffe566;
  --focus: #ffe566;
  --line: #ffffff33;
  --tool-ink: #f8faf8;
  --tool-bg: #1c241e;
  --tool-accent: #ffe566;
  --tool-selected: #101410;
}
body {
  background: var(--page-bg);
}
.site-header nav {
  order: 1;
}
.theme-toggle {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 0.8rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--line);
}
.theme-toggle span {
  white-space: nowrap;
}
.menu-toggle {
  order: 3;
}
.work-tools {
  text-align: center;
  margin-bottom: 2rem;
}
.work-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.work-filters button {
  border: 1px solid var(--edge);
  background: var(--tool-bg);
  color: var(--tool-ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}
.work-filters button[aria-pressed="true"] {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  color: var(--tool-selected);
}
.filter-status {
  font-size: 0.8rem;
  margin-top: 0.8rem;
}
.work-preview {
  position: relative;
  display: block;
  border-radius: 6px;
}
.work-preview:focus-visible {
  outline-offset: -4px;
  outline-width: 4px;
}
.preview-hint {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  max-width: calc(100% - 1.4rem);
  padding: 0.4rem 0.65rem;
  border: 1px solid #ffffff50;
  border-radius: 4px;
  background: #12151bec;
  color: #fff;
  font-size: 0.75rem;
}
.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: var(--tool-bg);
  color: var(--tool-ink);
  box-shadow: 0 4px 20px #0003;
  font-size: 1.4rem;
}
.image-viewer {
  width: calc(100% - 2rem);
  max-width: 1000px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--page-bg);
  color: var(--ink);
  overscroll-behavior: contain;
}
.image-viewer::backdrop {
  background: #050709df;
}
.viewer-toolbar,
.viewer-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.viewer-toolbar {
  margin-bottom: 1rem;
}
.viewer-toolbar p {
  font-size: 0.8rem;
}
.viewer-toolbar button,
.viewer-actions button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: var(--tool-bg);
  color: var(--tool-ink);
}
.viewer-image {
  width: 100%;
  max-height: 65vh;
  max-height: 65dvh;
  object-fit: contain;
}
.viewer-details {
  padding-top: 1rem;
}
.viewer-details h2 {
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0;
}
.viewer-actions {
  display: flex;
  gap: 0.5rem;
}
body.viewer-open {
  overflow: hidden;
}
html {
  scrollbar-gutter: stable;
}
@media (max-width: 1100px) {
  .theme-toggle span {
    display: none;
  }
}
@media (max-width: 960px) {
  .site-header .brand {
    margin-right: auto;
  }
  .site-header nav {
    order: 4;
  }
}
@media (max-width: 300px) {
  .site-header .brand {
    flex-basis: 100%;
  }
  .theme-toggle {
    margin-left: auto;
  }
}
@media (max-width: 520px) {
  .viewer-details {
    align-items: flex-start;
    flex-direction: column;
  }
  .work-tools {
    width: 100%;
  }
  .back-to-top {
    width: 44px;
    height: 44px;
  }
}

html[data-theme="dark"] {
  --button-bg: #ffe566;
  --button-text: #0b100d;
  --button-hover: #fff1a0;
}
html[data-theme="dark"] .hero {
  background: radial-gradient(
    ellipse at 50% 0%,
    #3f4218 0%,
    #151a14 48%,
    #0b100d 100%
  );
  border-bottom: 1px solid var(--edge);
}
html[data-theme="dark"] .hero h1 {
  color: #ffe566;
}
html[data-theme="dark"] .hero .eyebrow {
  color: #fff1a0;
  font-weight: 700;
}
html[data-theme="dark"] .hero-content > p {
  color: #e2e8e3;
}
html[data-theme="dark"] .feature > i,
html[data-theme="dark"] .price-card > i {
  color: #ffe566;
}
html[data-theme="dark"] .feature h3,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .price-card h3,
html[data-theme="dark"] .work-card h3,
html[data-theme="dark"] .team-card h3 {
  color: #f8fafc;
}
html[data-theme="dark"] .feature p,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .price-card li,
html[data-theme="dark"] .work-card p {
  color: #d1d9d2;
}
html[data-theme="dark"] .price-card {
  background: var(--panel);
  border: 1px solid #8b968c;
}
html[data-theme="dark"] .price-card.featured {
  border-color: #ffe566;
  box-shadow: 5px 5px 0 #ffe566;
}
html[data-theme="dark"] .price-card .price {
  color: #f8fafc;
}
html[data-theme="dark"] .stats-grid {
  border-color: #8b968c;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea {
  background: #111710;
  color: #f8fafc;
  border: 1.5px solid #9aa79c;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #c5cfc6;
  opacity: 1;
}
html[data-theme="dark"] .site-footer {
  background: #070a08;
  border-top: 1px solid #8b968c;
}
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .back-to-top,
html[data-theme="dark"] .work-filters button {
  border-color: #9aa79c;
  color: #f8fafc;
}
html[data-theme="dark"] .work-filters button[aria-pressed="true"] {
  background: #ffe566;
  border-color: #ffe566;
  color: #0b100d;
  font-weight: 700;
}

/* Light theme: maximum readability and control contrast */
html:not([data-theme="dark"]) body {
  background: #f1f5f9;
  color: #0f172a;
}
html:not([data-theme="dark"]) p {
  color: #1e293b;
}
html:not([data-theme="dark"]) .section-heading h2,
html:not([data-theme="dark"]) .feature h3,
html:not([data-theme="dark"]) .price-card h3,
html:not([data-theme="dark"]) .work-card h3,
html:not([data-theme="dark"]) .team-card h3,
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) h2,
html:not([data-theme="dark"]) h3 {
  color: #020617;
}
html:not([data-theme="dark"]) .hero {
  background: linear-gradient(160deg, #fde047 0%, #facc15 42%, #eab308 100%);
  border-bottom: 2px solid #1e1b4b;
}
html:not([data-theme="dark"]) .hero h1 {
  color: #0f172a;
}
html:not([data-theme="dark"]) .hero .eyebrow,
html:not([data-theme="dark"]) .hero-content > p {
  color: #1e293b;
  font-weight: 600;
}
html:not([data-theme="dark"]) .theme-toggle,
html:not([data-theme="dark"]) .menu-toggle,
html:not([data-theme="dark"]) .back-to-top,
html:not([data-theme="dark"]) .work-filters button,
html:not([data-theme="dark"]) .button {
  border: 1.5px solid #0f172a;
  color: #020617;
  font-weight: 700;
}
html:not([data-theme="dark"]) .button {
  background: #1e1b4b;
  color: #ffffff;
  border-color: #1e1b4b;
}
html:not([data-theme="dark"]) .button:hover {
  background: #312e81;
}
html:not([data-theme="dark"]) .work-filters button[aria-pressed="true"] {
  background: #1e1b4b;
  border-color: #1e1b4b;
  color: #ffffff;
}
html:not([data-theme="dark"]) .price-card,
html:not([data-theme="dark"]) .feature,
html:not([data-theme="dark"]) .work-card,
html:not([data-theme="dark"]) .team-card,
html:not([data-theme="dark"]) .contact-form,
html:not([data-theme="dark"]) .project-notes {
  border-color: #334155;
}
html:not([data-theme="dark"]) .price-card,
html:not([data-theme="dark"]) .team-card {
  background: #ffffff;
  border: 1.5px solid #334155;
}
html:not([data-theme="dark"]) .price-card.featured {
  border-color: #1e1b4b;
  box-shadow: 5px 5px 0 #1e1b4b;
}
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) textarea {
  border: 1.5px solid #1e293b;
  background: #ffffff;
  color: #020617;
}
html:not([data-theme="dark"]) input::placeholder,
html:not([data-theme="dark"]) textarea::placeholder {
  color: #475569;
  opacity: 1;
}
html:not([data-theme="dark"]) .site-footer {
  background: #e2e8f0;
  border-top: 2px solid #1e293b;
  color: #0f172a;
}
