:root {
  --bg: #0a0a0a;
  --fg: #e8e6e3;
  --fg-soft: #b8b6b1;
  --muted: #7a7874;
  --muted-dim: #5c5a57;
  --accent: #8c8c88;
  --line: #262626;
  --line-strong: #2e2e2e;
  --chrome: #c4c2bd;
  --status-gold: #d4a843;
  --space-sm: 0.85rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: clamp(2.5rem, 6vh, 4rem);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --marquee-bg: #222222;
  /* Wide layouts; narrowed on small viewports in media queries below. */
  --hero-title-size: clamp(2.5rem, 8vw, 5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
}

body {
  min-height: 100vh;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  overflow-x: clip;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.scan {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

.header-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
}

.status-pulse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}

.status-pulse:hover {
  opacity: 1;
}

.status-pulse__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-gold);
  flex-shrink: 0;
  animation: status-pulse-breathe 2.8s ease-in-out infinite;
}

@keyframes status-pulse-breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

.status-pulse__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--status-gold);
  text-transform: uppercase;
  line-height: 1;
}

.wrap {
  --wrap-pad: clamp(1.35rem, 4.2vw, 2.35rem);
  --wrap-pad-left: max(var(--wrap-pad), env(safe-area-inset-left, 0px));
  --wrap-pad-right: max(var(--wrap-pad), env(safe-area-inset-right, 0px));
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: max(var(--wrap-pad), env(safe-area-inset-top, 0px))
    var(--wrap-pad-right)
    max(var(--wrap-pad), env(safe-area-inset-bottom, 0px))
    var(--wrap-pad-left);
  max-width: 1120px;
  margin: 0 auto;
}

header {
  display: grid;
  grid-template-columns: 1fr minmax(0, auto);
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--line-strong);
}

.mark {
  font-family: "Barlow Condensed", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.55rem, 3.8vw, 2.2rem);
  letter-spacing: -0.028em;
  text-transform: uppercase;
  color: var(--fg);
  display: inline-block;
  line-height: 0.95;
  transition: color 0.35s var(--ease-soft);
}

.meta {
  text-align: right;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.06em;
}

.meta span {
  display: block;
}

.meta span + span {
  margin-top: 0.2em;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.marquee-region {
  width: calc(100% + var(--wrap-pad-left) + var(--wrap-pad-right));
  max-width: none;
  margin-left: calc(-1 * var(--wrap-pad-left));
  margin-right: calc(-1 * var(--wrap-pad-right));
  flex-shrink: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--marquee-bg);
  margin-top: var(--space-md);
  margin-bottom: 0;
}

.marquee {
  --marquee-edge-fade: linear-gradient(
    90deg,
    transparent,
    var(--marquee-bg) 10%,
    var(--marquee-bg) 90%,
    transparent
  );
  overflow: hidden;
  padding: 0.55rem 0;
  -webkit-mask-image: var(--marquee-edge-fade);
  mask-image: var(--marquee-edge-fade);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 60s linear infinite;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.marquee-seg {
  flex-shrink: 0;
  padding-right: 3.5rem;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.hero-shell {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--space-xl) 0 0;
  min-width: 0;
}

.hero-inner {
  max-width: 44rem;
  width: 100%;
  min-width: 0;
}

.services-band {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.services-center {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

.hero-title {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 500;
  font-size: var(--hero-title-size);
  line-height: 1.08;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
  font-feature-settings: "kern" 1, "liga" 1;
  max-width: 100%;
  overflow-wrap: break-word;
}

.hero-sub-wrap {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 36em;
}

.hero-sub-wrap p {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.line-fade {
  flex-shrink: 0;
  margin-top: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(196, 194, 189, 0.55), transparent 78%);
}

.what-we-do {
  flex: 0 1 auto;
  padding: var(--space-xl) 0 0;
}

.what-we-do > .line-fade:first-of-type {
  opacity: 0.5;
  margin-bottom: var(--space-lg);
}

.what-we-do > .line-fade:last-of-type {
  opacity: 0.25;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.services-section > .line-fade {
  opacity: 0;
  margin-top: var(--space-lg);
  margin-bottom: 0;
}

.services-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 0 var(--space-lg);
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: var(--space-md);
}

.what-grid {
  width: 100%;
  max-width: 100%;
}

.what-text {
  margin: 0;
  width: 100%;
  max-width: none;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--fg-soft);
}

.services {
  --services-vpad: clamp(0.65rem, 1.8vw, 1rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: var(--services-vpad) 0;
  flex-shrink: 0;
  align-items: start;
  width: 100%;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.service-item {
  border-right: 1px solid var(--line-strong);
  padding: 0 clamp(0.75rem, 2vw, 1.15rem);
  min-width: 0;
  transition: background 0.4s var(--ease-soft);
}

.service-item:last-child {
  border-right: none;
}

.service-item:hover {
  background: rgba(255, 255, 255, 0.018);
}

.service-item.is-open {
  background: rgba(255, 255, 255, 0.028);
}

.service-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0 1rem;
  margin: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
  transition: color 0.35s var(--ease-soft);
}

.service-trigger:hover {
  color: rgba(255, 255, 255, 0.82);
}

.service-trigger:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.service-trigger > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.service-trigger .service-chev {
  flex-shrink: 0;
  font-size: 0.62rem;
  margin-top: 0.25em;
  color: var(--muted-dim);
  opacity: 0.9;
  transition: transform 0.45s var(--ease-soft), color 0.35s var(--ease-soft);
}

.service-item.is-open .service-trigger .service-chev {
  transform: rotate(180deg);
  color: var(--accent);
}

.service-panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.48s var(--ease-out);
}

.service-item.is-open .service-panel-wrap {
  grid-template-rows: 1fr;
}

.service-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.service-detail {
  padding: 0 0 1.1rem;
  max-width: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.03em;
  border-left: 1px solid var(--line-strong);
  padding-left: 1rem;
  margin-left: 0.1rem;
}

.service-detail p + p {
  margin-top: 0.75rem;
}

footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding-top: var(--space-lg);
  margin-top: var(--space-sm);
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.footer-address {
  margin: 0;
  max-width: 32rem;
  line-height: 1.65;
  font-weight: 400;
  padding-bottom: var(--space-lg);
}

.footer-address span {
  display: block;
}

.footer-address span + span {
  margin-top: 0.25em;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  border-top: 1px solid var(--line-strong);
  padding-top: var(--space-lg);
}

footer a {
  color: var(--fg-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}

footer a:hover {
  color: var(--fg);
  border-bottom-color: rgba(232, 230, 227, 0.35);
}

.coords {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.frame {
  --frame-inset: clamp(0.5rem, 2vw, 1rem);
  position: fixed;
  top: max(var(--frame-inset), env(safe-area-inset-top));
  right: max(var(--frame-inset), env(safe-area-inset-right));
  bottom: max(var(--frame-inset), env(safe-area-inset-bottom));
  left: max(var(--frame-inset), env(safe-area-inset-left));
  pointer-events: none;
  z-index: 2;
  border: 1px solid var(--line);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent);
  opacity: 0.32;
}

.frame::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.frame::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

@media (max-width: 900px) {
  :root {
    --hero-title-size: clamp(1.55rem, 3.1vw + 0.95rem, 5rem);
  }

  .services {
    --services-vpad: clamp(0.75rem, 2.2vw, 1.1rem);
    grid-template-columns: 1fr;
  }

  .service-item {
    border-right: none;
    border-bottom: 1px solid var(--line-strong);
    padding: 0 0.15rem;
  }

  .service-item:last-child {
    border-bottom: none;
  }

  .service-trigger {
    font-size: clamp(0.78rem, 2.2vw, 0.8rem);
    padding: 1.05rem 0 1.1rem;
  }

  .hero-sub-wrap p {
    font-size: 0.72rem;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  :root {
    --hero-title-size: clamp(1.45rem, 2.85vw + 0.82rem, 3.25rem);
  }

  header {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .header-aside {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .meta {
    text-align: left;
    justify-self: start;
  }

  .hero-title {
    letter-spacing: 0.032em;
  }

  .marquee-seg {
    font-size: 0.58rem;
    letter-spacing: 0.07em;
  }
}

/* Full-bleed marquee to viewport edges (narrow: padding-based bleed avoids iOS 100vw scroll). */
@media (min-width: 901px) {
  .marquee-region {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .hero-inner {
    max-width: none;
  }

  .hero-title {
    overflow-wrap: normal;
    word-break: normal;
  }
}
