/* ==========================================================================
   components.css: system previews, project index, process, tools,
   contact form, footer
   ========================================================================== */

/* ---------- Shared section header ---------- */
.block {
  padding-block: clamp(5rem, 11vw, 9rem);
}
.sec-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.sec-head h2 {
  font-weight: 600;
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}
.sec-head p {
  justify-self: end;
  max-width: 40ch;
  color: var(--grey);
}

/* ---------- More systems (preview stages) ---------- */
.others {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--edge);
}
.others-head,
.more-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.others-head h3 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}
.others-head p {
  color: var(--grey);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1.25rem, 2.5vw, 2rem);
}
.mini-text {
  margin-top: 1.3rem;
}
.mini-text .ctx {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--grey);
}
.mini-text h4 {
  font-weight: 600;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.mini-text > p:last-child {
  max-width: 48ch;
  margin-top: 0.55rem;
  font-size: 0.96rem;
  color: var(--grey);
}
.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(360px, 31vw, 430px);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 1px solid #1b1b1b;
  border-radius: var(--radius-lg);
  background: #101010;
  --q: 0;
}
.js .stage {
  clip-path: inset(10% 8% 10% 8% round 24px);
  transition: clip-path 1.3s var(--ease);
}
.js .stage.in {
  clip-path: inset(0 0 0 0 round var(--radius-lg));
}
.art {
  display: grid;
  place-items: center;
  width: 100%;
  transform: translate3d(0, calc(var(--q) * 46px), 0) rotate(calc(var(--q) * -1.6deg));
}
.art > * {
  scale: 0.86;
}
.js .stage .art > * {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 1s var(--ease) 0.25s,
    transform 1.3s var(--ease) 0.25s;
}
.js .stage.in .art > * {
  opacity: 1;
  transform: none;
}

/* Preview: import window */
.win {
  width: min(100%, 470px);
  border-radius: 10px;
  background: #f6f6f3;
  color: #161616;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  font-size: 0.88rem;
}
.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #ddddd8;
}
.win-bar strong {
  font-weight: 650;
}
.win-bar span {
  overflow: hidden;
  color: #77776f;
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.steps {
  margin: 0;
  padding: 0.5rem 1rem 0;
  list-style: none;
  counter-reset: s;
}
.steps li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0;
  border-bottom: 1px dashed #d6d6d0;
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: #161616;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.steps li b {
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.win-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
}
.badges {
  display: flex;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #e4e4df;
  color: #2a2a28;
}
.badge.alt {
  border: 1px solid #cfcfc9;
  background: transparent;
  color: #6b6b64;
}
.fake-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  background: #161616;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
}

/* Preview: asset tag */
.tag-scene {
  display: grid;
  gap: 0.9rem;
  width: min(100%, 430px);
}
.tag {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
  color: #161616;
  box-shadow: 0 26px 44px -26px rgba(0, 0, 0, 0.95);
}
.qr {
  display: grid;
  grid-template-columns: repeat(21, 5px);
  grid-auto-rows: 5px;
  padding: 5px;
  background: #fff;
}
.qr i {
  display: block;
}
.qr i.k {
  background: #161616;
}
.tag-body small {
  display: block;
  color: #77776f;
  font-size: 0.72rem;
}
.tag-body strong {
  display: block;
  margin: 0.1rem 0 0.35rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.tag-body p {
  font-size: 0.8rem;
  line-height: 1.4;
}
.log {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: #f4f4f1;
  color: #161616;
  font-size: 0.78rem;
}
.log p {
  margin-bottom: 0.35rem;
  font-weight: 650;
}
.log div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-top: 1px dashed #d6d6d0;
}
.log time {
  color: #77776f;
  font-variant-numeric: tabular-nums;
}

/* ---------- Everything else (filterable index) ---------- */
.more {
  margin-top: clamp(4rem, 8vw, 6rem);
}
.more-head {
  margin-bottom: 1.5rem;
}
.more-head h3 {
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.filters button,
.choice span {
  min-height: 2.4rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid #333;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    border-color 0.25s,
    background-color 0.25s,
    color 0.25s;
}
.filters button:hover,
.choice span:hover {
  border-color: #777;
  color: var(--white);
}
.filters button[aria-pressed='true'] {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}
.filters button span {
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}
.index {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.index li {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 1.6fr) minmax(0, 2.6fr);
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.2rem 0.25rem;
  border-bottom: 1px solid var(--edge);
  transition:
    background-color 0.3s,
    padding 0.4s var(--ease);
}
.index li:hover {
  padding-left: 0.9rem;
  background: #0b0b0b;
}
.index li[hidden] {
  display: none;
}
.index strong {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.25;
}
.index .who {
  display: block;
  margin-top: 0.15rem;
  color: var(--grey);
  font-size: 0.82rem;
  font-weight: 400;
}
.index p {
  font-size: 0.95rem;
  color: #c4c4c0;
}
.index .plat {
  font-size: 0.88rem;
}
.index .tech {
  font-size: 0.85rem;
  color: var(--grey);
}
.js .index li {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.8s var(--ease),
    background-color 0.3s,
    padding 0.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.045s), calc(var(--i, 0) * 0.045s), 0s, 0s;
}
.js .index.in li {
  opacity: 1;
  transform: none;
}

/* ---------- Process ---------- */
.process {
  --fill: 0;
}
.track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin: 0;
  padding: 2.2rem 0 0;
  list-style: none;
}
.track::before,
.track::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #2e2e2c;
}
.track::after {
  background: var(--white);
  transform: scaleX(var(--fill));
  transform-origin: left;
}
.track li {
  position: relative;
}
.track li::before {
  content: '';
  position: absolute;
  top: calc(-2.2rem - 4px);
  left: 0;
  width: 9px;
  height: 9px;
  border: 1px solid #555;
  border-radius: 50%;
  background: var(--black);
  transition:
    background-color 0.4s,
    border-color 0.4s;
}
.track li.on::before {
  border-color: var(--white);
  background: var(--white);
}
.track span {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--grey);
}
.track h3 {
  margin-top: 0.6rem;
  font-weight: 600;
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  letter-spacing: -0.02em;
  transition: color 0.4s;
}
.track p {
  margin-top: 0.6rem;
  color: var(--grey);
  font-size: 0.97rem;
  transition: color 0.4s;
}
.track li:not(.on) h3 {
  color: #6a6a66;
}
.track li.on p {
  color: #c4c4c0;
}


/* ---------- Contact ---------- */
.contact {
  padding: clamp(6rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 6rem);
  border-top: 1px solid var(--edge);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(3rem, 6vw, 6rem);
}
.contact h2 {
  max-width: 12ch;
  margin-top: 1.5rem;
  padding-block: 0.06em;
  font-weight: 600;
  font-size: clamp(2.8rem, 6.5vw, 6.2rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  /* Even line lengths, so the serif phrase is never left hanging alone. */
  text-wrap: balance;
}
.contact h2 em {
  font-family: var(--serif);
  font-weight: 400;
  /* The serif sits on a smaller x-height, so it is nudged up to match the
     sans around it rather than looking like a second, larger heading. */
  font-size: 1.04em;
  line-height: 1;
  letter-spacing: -0.015em;
}
.contact-lead {
  max-width: 40ch;
  margin-top: 1.75rem;
  color: var(--grey);
  font-size: 1.1rem;
}
.contact-direct {
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.contact-direct li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--edge);
}
.contact-direct li:last-child {
  border-bottom: 1px solid var(--edge);
}
.contact-direct a,
.contact-direct span {
  overflow-wrap: anywhere;
}

/* Form */
.form-card {
  padding: clamp(1.5rem, 3vw, 2.75rem);
  border: 1px solid var(--edge);
  border-radius: clamp(24px, 3vw, 36px);
  background: var(--raise);
}
.form-card > h3 {
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  letter-spacing: -0.03em;
}
.form-card > p {
  margin-bottom: 2rem;
  color: var(--grey);
  font-size: 0.95rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem 1.25rem;
}
.field.full {
  grid-column: 1 / -1;
}
.field > label,
.field legend {
  display: block;
  margin-bottom: 0.4rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.55rem 0 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 1.05rem;
  transition: border-color 0.3s;
}
.field textarea {
  min-height: 7.5rem;
  line-height: 1.5;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--white);
}
.field.invalid input,
.field.invalid textarea {
  border-color: var(--error);
}
.field-error {
  display: block;
  min-height: 1.2em;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--error);
}
fieldset.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.3rem;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: inline-flex;
  align-items: center;
}
.choice input:checked + span {
  border-color: var(--white);
  background: var(--white);
  color: var(--black);
}
.choice input:focus-visible + span {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.form-turnstile:not(:empty) {
  margin-top: 1.5rem;
}
.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}
.form-note {
  max-width: 24ch;
  font-size: 0.82rem;
  color: var(--dim);
}
.form-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 1.5em;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}
.form-status[data-state='success']::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}
.form-status[data-state='pending'] {
  color: var(--grey);
}
.form-status[data-state='error'] {
  color: var(--error);
}

/* ---------- Footer ---------- */
footer {
  padding-block: 1.5rem 2rem;
  color: var(--dim);
  font-size: 0.85rem;
}
footer .foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
}
