:root {
  color-scheme: dark;
  --bg: #131519;
  --panel: #1a1d22;
  --text: #f4efe7;
  --muted: #bfbab3;
  --line: #36383c;
  --gold: #ffb341;
  --orange: #ef713c;
  --mono: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  scrollbar-gutter: stable;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
[id] { scroll-margin-block-start: 2rem; }

.wrap {
  width: min(100% - 6rem, 70rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  transform: translateY(-180%);
  padding: .8rem 1.1rem;
  border-radius: .35rem;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus { transform: none; }

.site-header {
  display: flex;
  min-height: 5.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; flex-shrink: 0; }
.brand img { object-fit: contain; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(.85rem, 3vw, 2.25rem);
  color: var(--muted);
  font-size: .94rem;
  font-weight: 600;
}

.site-header nav a { display: block; padding-block: .55rem; }
.site-header nav a:hover { color: var(--gold); }
.site-header nav .nav-contact {
  padding-inline: .95rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  color: var(--text);
}

.site-header nav .nav-contact:hover { border-color: var(--gold); }

.hero {
  display: grid;
  min-height: 32.5rem;
  grid-template-columns: minmax(0, 1.47fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  padding-block: 3.5rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font: 600 .875rem/1.5 var(--mono);
  letter-spacing: .085em;
  text-transform: uppercase;
}

.eyebrow::before { content: ''; width: 1.45rem; height: 2px; flex-shrink: 0; background: var(--gold); }

h1 {
  font-size: clamp(2.75rem, 6.25vw, 5.65rem);
  font-weight: 750;
  letter-spacing: -.072em;
  line-height: .99;
}

h1 span { color: var(--gold); }

.mission {
  max-width: 31rem;
  margin-block: 1.6rem 1.8rem;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.7vw, 1.23rem);
  line-height: 1.6;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: .35rem;
  background: var(--gold);
  color: var(--bg);
  font-size: .95rem;
  font-weight: 750;
  transition: background-color .18s, border-color .18s, color .18s;
}

.button:hover { border-color: #ffc76b; background: #ffc76b; }

.hero-art {
  position: relative;
  isolation: isolate;
  display: grid;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 440 / 380;
  place-items: center;
}

.hero-grid, .hero-guides { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-grid {
  z-index: -1;
  background:
    radial-gradient(circle, #a9a198 1px, transparent 1.4px) center / 18px 18px,
    radial-gradient(ellipse, #36281d 0%, var(--bg) 72%);
  opacity: .33;
  mask-image: radial-gradient(ellipse, #000 30%, transparent 74%);
}

.hero-guides { z-index: -1; stroke: #69503a; stroke-width: 1; }
.guide-axis, .guide-inner { stroke: #4c3b31; stroke-dasharray: 2 6; }
.guide-ticks { stroke: #ae7f4b; }
.projects { padding-block: 3.75rem 4.35rem; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

h2 { font-size: clamp(1.8rem, 3.25vw, 2.75rem); font-weight: 730; letter-spacing: -.048em; line-height: 1.12; }
.section-heading a, .project-source, .project-destination {
  color: var(--gold);
  font-size: .94rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: #a46d29;
  text-underline-offset: .28em;
  text-decoration-thickness: 1px;
}

.section-heading a:hover, .project-source:hover, .project-heading:hover .project-destination {
  color: var(--text);
  text-decoration-color: var(--text);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project {
  min-width: 0;
  padding: clamp(1.15rem, 2.4vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--panel);
}

.project:hover, .project:focus-within { border-color: #796045; }
.project-heading {
  display: grid;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.25rem);
  border-radius: .6rem;
}

.project-heading:hover .project-name, .project-heading:focus-visible .project-name { color: var(--gold); }
.project-name {
  display: block;
  margin-bottom: .2rem;
  font-size: clamp(1.5rem, 3.25vw, 2.2rem);
  font-weight: 750;
  letter-spacing: -.045em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.project-badge {
  display: grid;
  width: clamp(3.75rem, 8vw, 5rem);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .85rem;
}

.project-badge img { width: 82%; height: auto; }
.project-badge-anyinfer { border-color: #365953; background: #1a302e; }
.project-badge-unifisharp { border-color: #bdcbd5; background: #edf2f6; }
.project-badge-switchyard { border-color: #364656; background: #16212b; }
.project-badge-switchyard img { width: 100%; }
.project-badge-plug {
  border-color: #6a5036;
  background: #25201c;
  color: var(--gold);
}

.project-badge-plug svg {
  width: 62%;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project p, .approach p, .contact p { margin-top: .42rem; color: var(--muted); line-height: 1.55; }
.project p { margin-top: 1rem; }
.project-source { display: inline-flex; align-items: center; min-height: 2rem; margin-top: .35rem; }

.approach {
  padding-block: 3rem 4.35rem;
  border-top: 1px solid var(--line);
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
  margin-top: 1.5rem;
}

.approach h3 { font-size: 1.2rem; letter-spacing: -.02em; }

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4.4vw, 3.3rem);
  border: 1px solid #624831;
  border-radius: .5rem;
  background: linear-gradient(115deg, #271f1b, #1e1b1b 60%, var(--panel));
}

.contact p { max-width: 31rem; margin-top: .6rem; }
.button-outline { background: transparent; color: var(--gold); }
.button-outline:hover { color: var(--bg); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 6.25rem;
  color: var(--muted);
  font-size: .9rem;
}

.intro-running { overflow: hidden; }
.intro-running .site-shell { opacity: 0; }
.site-reveal :is(.site-header, .hero-copy, .hero-grid, .hero-guides, .projects, .approach, .contact, .site-footer) {
  animation: reveal .48s cubic-bezier(.2, .65, .3, 1) both;
}
.site-reveal .hero-grid { animation-name: reveal-grid; }

.intro {
  --logo-width: clamp(9.25rem, 19vw, 15rem);
  position: fixed;
  z-index: 5;
  inset: 0;
  overflow: clip;
  background: radial-gradient(ellipse at center, #201b1b 0%, var(--bg) 68%);
}

.intro-scene { position: absolute; inset: 0; display: grid; place-items: center; }
.intro-position {
  position: relative;
  width: var(--logo-width);
  perspective: 760px;
}

.intro-mark {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 .55rem rgb(4 5 8 / .4));
  animation: land .72s 1.08s both;
}
.ribbon-red { fill: var(--orange); }
.ribbon-gold { fill: var(--gold); }
.draw {
  fill: none;
  stroke: #fff;
  stroke-width: 25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  animation: draw-ribbon .63s .31s cubic-bezier(.28, .42, .22, 1) both;
}

.draw-second { animation-delay: .52s; animation-duration: .54s; }

.intro-thread {
  position: absolute;
  top: calc(50% - 2px);
  width: calc(50% - var(--logo-width) * .35);
  height: 4px;
  animation: send-thread .77s cubic-bezier(.4, 0, .25, 1) both;
}

.intro-thread-left {
  left: 0;
  transform-origin: left;
  background: linear-gradient(90deg, transparent, var(--orange) 82%);
}

.intro-thread-right {
  right: 0;
  transform-origin: right;
  background: linear-gradient(270deg, transparent, var(--gold) 82%);
}

.intro-shadow, .intro-impact {
  position: absolute;
  inset: -15%;
  opacity: 0;
  pointer-events: none;
}

.intro-shadow {
  background: radial-gradient(circle closest-side, #040508 28%, rgb(4 5 8 / .76) 56%, transparent);
  animation: shadow .75s 1.08s;
}

.intro-impact {
  background: radial-gradient(circle closest-side, transparent 36%, rgb(182 162 147 / .23) 65%, transparent 100%);
  animation: impact .44s 1.45s ease-out;
}

.intro-fly { background: transparent; }
.intro-fly .intro-position { will-change: transform; }

.intro-skip {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 4vw, 3rem);
  padding: .55rem .9rem;
  border: 1px solid #6c6258;
  border-radius: .35rem;
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
}

.intro-skip:hover { border-color: var(--gold); color: var(--gold); }

@keyframes send-thread {
  0% { opacity: .7; transform: scaleX(.03); }
  45% { opacity: 1; transform: scaleX(1); }
  64% { opacity: .9; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1) scaleY(.25); }
}

@keyframes draw-ribbon {
  0% { opacity: 0; stroke-dashoffset: 1; }
  2% { opacity: 1; }
  100% { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes land {
  0% { transform: translateZ(0); }
  34% { transform: translateZ(142px); animation-timing-function: cubic-bezier(.59, .05, .83, .57); }
  53% { transform: translateZ(-50px); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  74% { transform: translateZ(16px); }
  100% { transform: translateZ(0); }
}

@keyframes shadow {
  0% { opacity: 0; transform: scale(.96); }
  34% { opacity: .38; transform: scale(1.28); }
  51% { opacity: .9; transform: scale(.95); }
  76% { opacity: .42; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes impact {
  0% { opacity: 0; transform: scale(.74); }
  18% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.63); }
}

@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes reveal-grid { from { opacity: 0; } to { opacity: .33; } }

@media (max-width: 53rem) {
  .wrap { width: calc(100% - 3rem); }
  .hero { min-height: 27.5rem; gap: .4rem; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 42rem) {
  .wrap { width: calc(100% - 2rem); }
  .site-header { min-height: 4.75rem; }
  .site-header .brand img { width: 7.15rem; height: auto; }
  .site-header nav { gap: clamp(.5rem, 2.7vw, 1.25rem); font-size: .875rem; }
  .site-header nav .nav-contact { padding-inline: .55rem; }
  .hero { grid-template-columns: 1fr; gap: .55rem; padding-block: 1.2rem 2.75rem; }
  .hero-art { grid-row: 1; justify-self: center; width: min(100%, 18rem); }
  h1 { font-size: clamp(2.65rem, 9.5vw, 4rem); }
  .eyebrow { margin-bottom: .9rem; letter-spacing: .05em; }
  .mission { margin-block: 1.1rem 1.4rem; }
  .projects { padding-block: 2.6rem 3rem; }
  .section-heading { gap: .65rem; margin-bottom: 1.1rem; }
  .project-grid { gap: .8rem; }
  .approach { padding-block: 2.6rem 3rem; }
  .approach-grid { grid-template-columns: 1fr; margin-top: 1.1rem; }
  .contact { flex-direction: column; align-items: flex-start; }
  .site-footer { min-height: 0; flex-wrap: wrap; gap: .65rem 1rem; padding-block: 1.2rem; }
}

@media (max-width: 23rem) {
  .site-header { gap: .5rem; }
  .site-header .brand img { width: 6rem; }
  .site-header nav { gap: .5rem; }
  .site-header nav .nav-contact { padding-inline: .35rem; }
  .projects .section-heading { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
