.commission {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  padding: 40px 40px 80px;
  min-height: calc(100vh - 136px);
  box-sizing: border-box;
  align-items: center;
  color: #f5f0e1;
}

@media (min-width: 900px) {
  .commission {
    grid-template-columns: 1fr 1.1fr;
    gap: 96px;
  }
}

.commission-intro h6 {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f4a300;
}

.commission-intro h6::before {
  content: "";
  width: 40px;
  height: 1px;
  background-color: #f4a300;
}

.commission-intro h1 {
  margin: 24px 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.95;
}

.commission-intro p {
  max-width: 28rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(245, 240, 225, 0.7);
}

.commission-intro ol {
  list-style: none;
  margin-top: 36px;
  border-top: 1px solid rgba(245, 240, 225, 0.12);
}

/* the 1-2-3 steps: on hover a gold wash sweeps in, the step slides over, its number glows,
   and a small arrow arrives at the end */
.commission-intro li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(245, 240, 225, 0.12);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.3rem;
  cursor: default;
  isolation: isolate;
  transition:
    padding-left 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    color 0.4s ease;
}

.commission-intro li::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right, rgba(244, 163, 0, 0.14), transparent 85%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.commission-intro li::after {
  content: "→";
  margin-left: auto;
  padding-right: 12px;
  font-family: "Inter", sans-serif;
  font-style: normal;
  font-size: 1rem;
  color: #f4a300;
  opacity: 0;
  translate: -12px 0;
  transition:
    opacity 0.4s ease,
    translate 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.commission-intro li span {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.2em;
  line-height: 2.2;
  color: #f4a300;
  transition:
    scale 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    text-shadow 0.4s ease;
}

.commission-intro li:hover {
  padding-left: 14px;
  color: #f4a300;
}

.commission-intro li:hover::before {
  transform: scaleX(1);
}

.commission-intro li:hover::after {
  opacity: 1;
  translate: 0 0;
}

.commission-intro li:hover span {
  scale: 1.35;
  text-shadow: 0 0 10px rgba(244, 163, 0, 0.7);
}

.commission-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.commission-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 600px) {
  .commission-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Form fields: label, control, then a red message when something needs fixing */
.field {
  --error: #ff7a6b; /* warm coral red, readable on the dark background */
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field label,
.field-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245, 240, 225, 0.6);
}

.field i {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.05em;
  color: rgba(245, 240, 225, 0.62);
}

.field .req {
  color: var(--error);
  font-weight: 400;
}

.field-error {
  min-height: 1em;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--error);
}

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.field-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(245, 240, 225, 0.62);
}

.field.is-invalid label,
.field.is-invalid .field-label {
  color: var(--error);
}

.field.is-invalid :is(input, textarea, .picker-button),
.field.is-missing :is(input, textarea, .picker-button) {
  border-bottom-color: var(--error);
}

/* the field being typed in shows gold focus, even while still missing */
.field.is-missing :is(input, textarea):focus {
  border-bottom-color: #f4a300;
}

.form-missing {
  min-height: 1em;
  margin-bottom: -12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #ff7a6b;
}

/* Custom dropdown + calendar trigger: looks like the other fields */
.picker {
  position: relative;
}

.picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245, 240, 225, 0.3);
  color: #f5f0e1;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  transition: border-color 0.3s ease;
}

.commission-form .picker-button:hover {
  background: transparent;
  color: #f5f0e1;
  border-bottom-color: rgba(244, 163, 0, 0.6);
}

.picker.is-open .picker-button,
.picker-button:focus-visible {
  outline: none;
  border-bottom-color: #f4a300;
}

.picker-button svg {
  flex-shrink: 0;
  color: #f4a300;
  transition: rotate 0.3s ease;
}

/* only the dropdown's chevron flips; the calendar icon stays put */
.picker.is-open [aria-haspopup="listbox"] svg {
  rotate: 180deg;
}

.picker-value.is-empty {
  color: rgba(245, 240, 225, 0.62);
}

/* the entrance animation gives each form row its own layer, so lift the row whose picker is open
   above the rows below it (otherwise their text shows through the panel) */
.commission-form > :has(.picker.is-open) {
  position: relative;
  z-index: 30;
}

.picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  box-sizing: border-box;
  /* near-solid: the entrance animation's layers stop the blur from reaching the fields below,
     so the panel mustn't rely on it to hide them */
  background-color: rgba(16, 20, 31, 0.97);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(244, 163, 0, 0.45);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: picker-in 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

.picker-list {
  right: 0;
  list-style: none;
  padding: 8px;
}

.picker-list li {
  padding: 11px 14px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.picker-list li small {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: rgba(245, 240, 225, 0.62);
}

.picker-list li:hover {
  background-color: rgba(245, 240, 225, 0.06);
}

.picker-list li[aria-selected="true"] {
  background-color: rgba(244, 163, 0, 0.14);
  color: #f4a300;
}

.picker-list li {
  position: relative;
  padding-right: 36px; /* room for the tick */
}

.picker-list li[aria-selected="true"]::after {
  content: "✓";
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
}

/* Calendar */
.calendar {
  width: 300px;
  padding: 16px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  color: #f5f0e1;
}

.commission-form .calendar-nav {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(245, 240, 225, 0.25);
  color: #f5f0e1;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.commission-form .calendar-nav:hover:not(:disabled) {
  background-color: #f4a300;
  border-color: #f4a300;
  color: #1a1a1a;
}

.calendar-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-dow {
  padding-bottom: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 240, 225, 0.62);
}

.commission-form .calendar-grid button {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: #f5f0e1;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.commission-form .calendar-grid button:hover:not(:disabled) {
  background-color: rgba(244, 163, 0, 0.18);
  color: #f5f0e1;
}

.calendar-grid button.is-today {
  border-color: rgba(244, 163, 0, 0.6);
}

.commission-form .calendar-grid button.is-selected,
.commission-form .calendar-grid button.is-selected:hover {
  background-color: #f4a300;
  color: #1a1a1a;
}

.calendar-grid button:disabled {
  color: rgba(245, 240, 225, 0.18);
  cursor: default;
}

/* weekends: closed for fittings */
.calendar-grid button.is-closed {
  text-decoration: line-through;
  text-decoration-color: rgba(245, 240, 225, 0.2);
}

.calendar-dow.is-closed {
  color: rgba(245, 240, 225, 0.18);
}

.calendar-hours {
  margin-top: 10px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 225, 0.55);
}

.field-hint {
  margin-bottom: -6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: rgba(245, 240, 225, 0.62);
}

.calendar-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 240, 225, 0.1);
}

.commission-form .calendar-today {
  padding: 4px 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(244, 163, 0, 0.5);
  color: #f4a300;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.commission-form .calendar-today:hover {
  background-color: #f4a300;
  color: #1a1a1a;
}

/* focused day (e.g. after "Today") gets a clear ring */
.commission-form .calendar-grid button:focus-visible {
  outline: 2px solid #f4a300;
  outline-offset: 2px;
}

.commission-form .calendar-clear {
  padding: 4px 0;
  background: none;
  border: none;
  color: rgba(245, 240, 225, 0.55);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.commission-form .calendar-clear:hover {
  background: none;
  color: #f4a300;
}

.commission-form :is(input, select, textarea) {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245, 240, 225, 0.3);
  border-radius: 0;
  color: #f5f0e1;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color-scheme: dark; /* dark date picker and dropdown */
  transition: border-color 0.3s ease;
}

.commission-form textarea {
  resize: vertical;
}

.commission-form :is(input, select, textarea)::placeholder {
  color: rgba(245, 240, 225, 0.62);
}

.commission-form :is(input, select, textarea):focus {
  outline: none;
  border-bottom-color: #f4a300;
}

.commission-form select option {
  background-color: rgb(10, 12, 20);
}

.commission-form > button[type="submit"] {
  align-self: flex-start;
  padding: 16px 32px;
}

.commission-note {
  min-height: 1.2em;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #f4a300;
}

/* Studio map on the Commission page: Google's map, restyled dark with a gold frame */
/* holds the map's place in the page while it's enlarged */
.studio-map-slot {
  margin-top: 36px;
  height: 260px;
}

.studio-map {
  position: relative;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(244, 163, 0, 0.45);
  background-color: #10141f;
}

.studio-map-canvas {
  position: absolute;
  inset: 0;
  background-color: #10141f;
}

/* OpenStreetMap's light tiles, flipped dark to match the site (tiles only: the pin keeps its gold) */
.studio-map .leaflet-tile-pane {
  filter: invert(0.92) hue-rotate(180deg) saturate(0.5) brightness(0.9) contrast(0.95);
}

/* gold pin with a slow pulse */
.studio-pin {
  border-radius: 50%;
  background-color: #f4a300;
  border: 3px solid #10141f;
  box-shadow: 0 0 0 0 rgba(244, 163, 0, 0.6);
  animation: pin-pulse 2s ease-out infinite;
}

/* Leaflet's zoom buttons and credit line, in the site's colours */
.studio-map .leaflet-bar {
  border: 1px solid rgba(244, 163, 0, 0.45);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
}

.studio-map .leaflet-bar a {
  background-color: rgba(10, 12, 20, 0.9);
  color: #f5f0e1;
  border-bottom-color: rgba(245, 240, 225, 0.12);
}

.studio-map .leaflet-bar a:hover {
  background-color: #f4a300;
  color: #1a1a1a;
}

.studio-map .leaflet-control-attribution {
  background-color: rgba(10, 12, 20, 0.7);
  color: rgba(245, 240, 225, 0.62);
  font-size: 9px;
}

.studio-map .leaflet-control-attribution a {
  color: rgba(245, 240, 225, 0.65);
}

.studio-map-info {
  position: absolute;
  z-index: 1000; /* above Leaflet's layers */
  pointer-events: none; /* let scroll-zoom and drag reach the map underneath */
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: calc(100% - 24px);
  padding: 12px 16px;
  border-radius: 10px;
  background-color: rgba(10, 12, 20, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 240, 225, 0.1);
}

.studio-map-info h6 {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #f4a300;
}

.studio-map .studio-address {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.15rem;
  color: #f5f0e1;
}

.studio-map .studio-hours {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(245, 240, 225, 0.55);
}

.studio-directions {
  pointer-events: auto;
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f5f0e1;
  text-decoration: none;
  transition: color 0.3s ease;
}

.studio-directions:hover {
  color: #f4a300;
}

.commission-intro h6 {
  animation: enter-rise 0.8s cubic-bezier(0.19, 1, 0.22, 1) 0.1s both;
}

.commission-intro h6::before {
  animation: enter-draw 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.2s both;
}

.commission-intro h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em; /* room for descenders inside the mask */
  margin-bottom: -0.12em;
}

.commission-intro h1 .line > span {
  display: inline-block;
  animation: enter-line 1.1s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.commission-intro h1 .line:nth-child(1) > span {
  animation-delay: 0.2s;
}

.commission-intro h1 .line:nth-child(2) > span {
  animation-delay: 0.35s;
}

.commission-intro p {
  animation: enter-rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.55s both;
}

.commission-intro li {
  animation: enter-rise 0.8s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.commission-intro li:nth-child(1) {
  animation-delay: 0.7s;
}

.commission-intro li:nth-child(2) {
  animation-delay: 0.8s;
}

.commission-intro li:nth-child(3) {
  animation-delay: 0.9s;
}

.commission-intro .studio-map-slot {
  animation: enter-rise 1s cubic-bezier(0.19, 1, 0.22, 1) 1.05s both;
}

.commission-intro .studio-map p {
  animation: none; /* the card animates as one */
}

.commission-form > * {
  animation: enter-rise 0.8s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.commission-form > :nth-child(1) {
  animation-delay: 0.45s;
}

.commission-form > :nth-child(2) {
  animation-delay: 0.55s;
}

.commission-form > :nth-child(3) {
  animation-delay: 0.65s;
}

.commission-form > :nth-child(4) {
  animation-delay: 0.75s;
}

.commission-form > :nth-child(n + 5) {
  animation-delay: 0.85s;
}

/* Phone: fixed +27, then 9 dashed slots, one per digit (mono font so each digit sits on its dash) */
.phone-input {
  --slot: calc(1ch + 14px); /* one digit + the gap to the next */
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
}

.phone-prefix {
  padding: 10px 12px 9px;
  border-radius: 6px;
  background-color: rgba(244, 163, 0, 0.12);
  color: #f4a300;
  font-size: 0.95rem;
}

.phone-slots {
  position: relative;
  flex: none;
}

/* the dashes: one 1ch+8px line under each digit, exactly nine */
.phone-slots::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(var(--slot) * 9);
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--dash, rgba(245, 240, 225, 0.35)) 0 calc(1ch + 8px),
    transparent calc(1ch + 8px) var(--slot)
  );
  pointer-events: none;
}

.phone-slots:focus-within {
  --dash: #f4a300;
}

.field.is-invalid .phone-slots {
  --dash: var(--error);
}

.commission-form .phone-input input {
  /* 9 slots, plus room for the 4px left padding, the spacing after the last digit and the caret,
     so the ninth digit doesn't make the box scroll */
  width: calc(var(--slot) * 9 + 10px);
  padding: 10px 0 10px 4px;
  border: none;
  background: transparent;
  font: inherit;
  letter-spacing: 14px;
}

/* browser autofill paints its own tint over inputs: delay that change "forever" and keep our text colour */
.commission-form input:-webkit-autofill,
.commission-form input:-webkit-autofill:hover,
.commission-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f5f0e1;
  caret-color: #f5f0e1;
  transition:
    background-color 600000s 0s,
    color 600000s 0s;
}

/* Enlarged map: fills most of the screen over a blurred, dimmed page */
.studio-map.is-expanded {
  position: fixed;
  inset: 6vh 6vw;
  height: auto;
  z-index: 95;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  animation: map-pop 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}

.studio-map-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: rgba(10, 12, 20, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: zoom-out;
}

.studio-map-backdrop.is-on {
  opacity: 1;
  pointer-events: auto;
}

html.map-expanded {
  overflow: hidden;
}

.studio-map-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000; /* above Leaflet's layers */
  padding: 7px 12px;
  border-radius: 999px;
  background-color: rgba(10, 12, 20, 0.85);
  border: 1px solid rgba(244, 163, 0, 0.5);
  color: #f5f0e1;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.studio-map-toggle:hover {
  background-color: #f4a300;
  color: #1a1a1a;
}

@keyframes picker-in {
  from {
    opacity: 0;
    translate: 0 -6px;
  }
}

@keyframes pin-pulse {
  to {
    box-shadow: 0 0 0 16px rgba(244, 163, 0, 0);
  }
}

@keyframes enter-line {
  from {
    translate: 0 110%;
  }
}

@keyframes enter-draw {
  from {
    width: 0;
  }
}

@keyframes map-pop {
  from {
    opacity: 0;
    scale: 0.94;
  }
}

/* map not allowed yet (cookie settings): a quiet note and a button instead of the map */
.studio-map-ask {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(245, 240, 225, 0.6);
}

.studio-map-ask button {
  border-radius: 999px;
}

@media (max-width: 700px) {
  .commission {
    gap: 42px;
    min-height: 0;
    padding: 24px 18px 56px;
  }

  .commission-intro h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .commission-intro ol {
    margin-top: 28px;
  }

  .commission-intro li {
    gap: 14px;
    font-size: 1.15rem;
  }

  .commission-form {
    gap: 22px;
  }

  .commission-row {
    gap: 22px;
  }

  .field-foot {
    gap: 8px;
  }

  /* roomier digits (still fits a 320px screen): the tighter spacing left half the row empty */
  .phone-input {
    --slot: calc(1ch + 12px);
    gap: 10px;
    font-size: 1rem;
  }

  .phone-prefix {
    padding: 9px 8px;
  }

  .commission-form .phone-input input {
    letter-spacing: 12px;
  }

  .commission-form > button[type="submit"] {
    align-self: stretch;
    padding: 18px 24px;
  }

  .studio-directions {
    display: inline-block;
    padding: 12px 0;
  }

  .studio-map.is-expanded {
    inset: 16px 10px;
    border-radius: 12px;
  }
}
