/* Hallmark · shape: Broadsheet · genre: editorial · theme: Studio (by request) · job: hire · draw: bcb6f6
 * hero: ledge · nav: none · footer: none · imagery: none · signature: the pointer as a measuring tool on the wordmark construction sheet
 * axes: light/roman-serif/warm · posture: restrained · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P9 H9 E9 S9 R9 V9 · weakest: S, single-screen Studio wordmark construction sheet with modal contact form per user request */
/* Hallmark · dismissed 77 · single-screen Studio construction sheet with dialog contact form per explicit user requirement */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --dots: radial-gradient(circle at 1px 1px, var(--color-dot) 1px, transparent 1.4px);
  --wm: clamp(52px, min(calc((min(100vw, var(--container)) - 2 * var(--gutter) - 150px) / 6.5), 24dvh), 200px);
}

body {
  color: var(--color-ink-2);
}
h1, h2, h3 {
  color: var(--color-ink);
  font-optical-sizing: auto;
}
h1, h2 {
  line-height: 1.0;
}

/* Crop marks: the edge every printed piece on the page shares */
.crop {
  position: relative;
  --crop-l: 8px;
  --crop-g: 4px;
  --crop-c: var(--color-mark);
}
.crop::before {
  --o: calc(var(--crop-l) + var(--crop-g));
  content: "";
  position: absolute;
  inset: calc(-1 * var(--o));
  pointer-events: none;
  z-index: 2;
  background:
    linear-gradient(var(--crop-c), var(--crop-c)) 0 var(--o) / var(--crop-l) 1px,
    linear-gradient(var(--crop-c), var(--crop-c)) var(--o) 0 / 1px var(--crop-l),
    linear-gradient(var(--crop-c), var(--crop-c)) 100% var(--o) / var(--crop-l) 1px,
    linear-gradient(var(--crop-c), var(--crop-c)) calc(100% - var(--o)) 0 / 1px var(--crop-l),
    linear-gradient(var(--crop-c), var(--crop-c)) 0 calc(100% - var(--o)) / var(--crop-l) 1px,
    linear-gradient(var(--crop-c), var(--crop-c)) var(--o) 100% / 1px var(--crop-l),
    linear-gradient(var(--crop-c), var(--crop-c)) 100% calc(100% - var(--o)) / var(--crop-l) 1px,
    linear-gradient(var(--crop-c), var(--crop-c)) calc(100% - var(--o)) 100% / 1px var(--crop-l);
  background-repeat: no-repeat;
  transition: transform var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}
.crop--sheet {
  --crop-l: 16px;
  --crop-g: 8px;
}

/* Registration marks: a circle and a cross, printed on every plate */
.reg {
  position: absolute;
  top: calc(50% - 10px);
  width: 20px;
  height: 20px;
  border: 1px solid var(--color-mark);
  border-radius: 50%;
  pointer-events: none;
}
.reg::before,
.reg::after {
  content: "";
  position: absolute;
  background: var(--color-mark);
}
.reg::before {
  left: -8px;
  right: -8px;
  top: 50%;
  height: 1px;
  transform: translateY(-0.5px);
}
.reg::after {
  top: -8px;
  bottom: -8px;
  left: 50%;
  width: 1px;
  transform: translateX(-0.5px);
}
.reg--l {
  left: -40px;
}
.reg--r {
  right: -40px;
}

/* Dimension lines: a rule with end ticks and its value set small */
.dim {
  position: absolute;
  pointer-events: none;
  color: var(--color-spec);
}
.dim--h {
  height: 1px;
  background: currentColor;
}
.dim--h::before,
.dim--h::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 8px;
  background: currentColor;
}
.dim--h::before {
  left: 0;
}
.dim--h::after {
  right: 0;
}
.dim b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-3xs) var(--space-2xs);
  background: var(--color-paper);
  color: var(--color-ink-2);
  font: 500 var(--text-xs)/1 var(--font-body);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
}

/* Links: an orange line drawn under */
.mail-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-ink);
  font: 500 var(--text-lead)/1.4 var(--font-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--color-rule);
  transition: text-decoration-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.mail-link:hover {
  text-decoration-color: var(--color-accent);
  color: var(--color-ink);
}

/* Controls: stamped labels, a double rule and crop marks at the corners */
.btn {
  --rule2: color-mix(in oklab, var(--color-ink) 62%, transparent);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-lg);
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: 2px;
  background: transparent;
  color: var(--color-ink);
  font: 500 var(--text-md)/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid var(--rule2);
  border-radius: 1px;
  pointer-events: none;
}
.btn::before {
  --l: 8px;
  --g: 4px;
  --o: calc(var(--l) + var(--g));
  --c: var(--color-mark);
  content: "";
  position: absolute;
  inset: calc(-1 * var(--o) - 1px);
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) 0 var(--o) / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) var(--o) 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% var(--o) / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) calc(100% - var(--o)) 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 0 calc(100% - var(--o)) / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) var(--o) 100% / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% calc(100% - var(--o)) / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) calc(100% - var(--o)) 100% / 1px var(--l);
  background-repeat: no-repeat;
  transition: transform var(--dur-short) var(--ease-out);
}
.btn:hover {
  background: var(--color-paper-2);
}
.btn:hover::before {
  transform: scale(1.04, 1.12);
}
.btn:active {
  transform: translateY(1px);
  --rule2: var(--color-ink);
}
.btn:active::before {
  transform: none;
}
.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 4px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--color-paper-3);
  --rule2: var(--color-rule);
  border-color: var(--color-muted);
  color: var(--color-muted);
  cursor: not-allowed;
  transform: none;
}
.btn[aria-busy="true"] {
  cursor: progress;
}
.btn--primary {
  --rule2: color-mix(in oklab, var(--color-ink) 55%, transparent);
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.btn--primary:hover:not(:disabled) {
  background: color-mix(in oklab, var(--color-accent) 88%, var(--color-ink));
}
.btn--small {
  min-height: 44px;
  padding: 0 var(--space-md);
  font-size: var(--text-sm);
}
.btn--small::before {
  --l: 4px;
  --g: 4px;
}

/* Hero: a proof of the wordmark construction */
.hero {
  position: relative;
  display: grid;
  min-height: 100dvh;
  padding-block: var(--space-xl);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain), var(--dots);
  background-size: 160px 160px, 24px 24px;
}
.hero__in {
  display: grid;
}
.construction {
  display: contents;
}
.trim {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  row-gap: var(--space-xl);
  min-width: 0;
}

.sheet-head {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  min-height: 24px;
  padding-bottom: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-ink);
  font: 500 var(--text-xs)/1.4 var(--font-body);
  color: var(--color-muted);
}
.readout {
  margin: 0;
  text-align: right;
  color: var(--color-ink-2);
  font-variant-numeric: tabular-nums;
}
html:not(.js) .readout {
  visibility: hidden;
}

.mark {
  position: relative;
  align-self: center;
  font-size: var(--wm);
  line-height: 1;
}
.mark__box {
  position: relative;
  width: max-content;
  padding: 0.37em 0.505em 0.37em 0.49em;
}
.mark__box::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed var(--color-spec);
  pointer-events: none;
}
.wm {
  margin: 0;
  max-width: none;
  font-family: var(--font-display);
  font-size: 1em;
  font-weight: var(--display-weight);
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--color-ink);
  white-space: nowrap;
  font-optical-sizing: auto;
  text-wrap: nowrap;
}
.wm__w {
  cursor: crosshair;
}
.wm__sp {
  position: relative;
}
.dim--word {
  top: 0.76em;
  left: 0;
  right: -0.04em;
}

/* The clear-space unit: an outlined x in each corner, the height of the x */
.xsq {
  position: absolute;
  display: grid;
  place-items: center;
  width: calc(var(--wm) * 0.52);
  height: calc(var(--wm) * 0.52);
  border: 1px solid color-mix(in oklab, var(--color-spec) 70%, transparent);
  background: color-mix(in oklab, var(--color-spec) 5%, transparent);
  font: 500 var(--text-xs)/1 var(--font-body);
  letter-spacing: 0;
  color: var(--color-ink-2);
  pointer-events: none;
}
.xsq--tl { top: 0; left: 0; }
.xsq--tr { top: 0; right: 0; }
.xsq--bl { bottom: 0; left: 0; }
.xsq--br { bottom: 0; right: 0; }

/* The guides: five rules across the sheet at the font's own heights */
.guides {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1.74em;
  pointer-events: none;
}
.g {
  position: absolute;
  left: 0;
  right: 0;
  top: round(down, var(--y), 1px);
  height: 1px;
  background: var(--color-spec);
  transform-origin: 0 50%;
}
.g i {
  position: absolute;
  right: 0;
  bottom: var(--space-2xs);
  font: 500 var(--text-xs)/1 var(--font-body);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--color-ink-2);
  white-space: nowrap;
}
.g--asc { --y: 0.42em; }
.g--cap { --y: 0.52em; }
.g--x { --y: 0.70em; }
.g--base { --y: 1.22em; }
.g--desc { --y: 1.467em; }
.g--asc,
.g--desc {
  background: color-mix(in oklab, var(--color-spec) 55%, transparent);
}
.guides--2 {
  display: none;
  transform: translateY(1em);
}

.hero__text {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  align-items: end;
}
.hero__status {
  grid-column: 1 / span 7;
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--text-display-s);
  letter-spacing: var(--tracking-display);
  line-height: 1.02;
  color: var(--color-ink);
  text-wrap: balance;
}
.hero__side {
  grid-column: 8 / -1;
}
.hero .lead {
  max-width: 30ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.redlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}
.redlines text {
  font: 500 12px var(--font-body);
  font-variant-numeric: tabular-nums;
  fill: var(--color-ink);
}

/* The construction draws itself once, then holds */
@keyframes draw {
  from { transform: scaleX(0); }
}
@keyframes appear {
  from { opacity: 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
}
.g {
  animation: draw 1100ms var(--ease-out) both;
}
.g--asc { animation-delay: 150ms; }
.g--cap { animation-delay: 230ms; }
.g--x { animation-delay: 310ms; }
.g--base { animation-delay: 390ms; }
.g--desc { animation-delay: 470ms; }
.g i,
.dim--word,
.xsq {
  animation: appear 600ms var(--ease-out) both;
  animation-delay: 1000ms;
}
.mark__box::before {
  animation: appear 700ms var(--ease-out) both;
  animation-delay: 700ms;
}

/* Redlines drawn by the measuring tool */
.redlines line {
  stroke: var(--color-spec);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.redlines .rl-box {
  fill: color-mix(in oklab, var(--color-spec) 7%, transparent);
  stroke: var(--color-spec);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.redlines .rl-near {
  fill: none;
  stroke: color-mix(in oklab, var(--color-spec) 70%, transparent);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  shape-rendering: crispEdges;
}
.redlines .rl-glyph {
  fill: color-mix(in oklab, var(--color-spec) 8%, transparent);
  stroke: var(--color-spec);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.redlines .rl-tag rect {
  fill: var(--color-paper);
}
.redlines .rl-tag text {
  fill: var(--color-ink);
}

/* Modal Dialog & Studio Form (usehallmark.com/themes/studio/) */
.modal {
  max-width: 42rem;
  width: 100%;
  margin: auto;
  padding: var(--space-lg);
  border: none;
  background: transparent;
  color: var(--color-ink);
  overflow: visible;
}
.modal::backdrop {
  background: color-mix(in oklab, var(--color-ink) 52%, transparent);
  backdrop-filter: blur(4px);
}
.modal[open] .modal__sheet {
  animation: rise var(--dur-long) var(--ease-out) both;
}
.modal__sheet {
  padding: var(--space-xl);
  background-color: var(--color-paper);
  background-image: var(--grain), var(--dots);
  background-size: 160px 160px, 24px 24px;
  border: var(--rule-hair) solid var(--color-ink);
  box-shadow: var(--shadow-sheet);
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: var(--rule-hair) solid var(--color-ink);
}
.modal__head h2 {
  font-size: var(--text-2xl);
}
.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap-columns);
  row-gap: var(--space-lg);
  padding-top: var(--space-lg);
}
.field--wide {
  grid-column: 1 / -1;
}
.field label {
  display: block;
  margin-bottom: var(--space-xs);
  font: 500 var(--text-sm)/1.4 var(--font-body);
  color: var(--color-ink-2);
}
.ctl {
  --crop-l: 8px;
  --crop-g: 4px;
  --crop-c: var(--color-focus);
  display: block;
}
.ctl::before {
  opacity: 0;
  transform: scale(0.99);
}
.ctl:focus-within::before {
  opacity: 1;
  transform: none;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
  border: var(--rule-hair) solid var(--color-muted);
  border-radius: 2px;
  background: var(--color-paper-hi);
  color: var(--color-ink);
  font: 400 var(--text-md)/1.4 var(--font-body);
  outline: 2px solid transparent;
  outline-offset: -3px;
  transition: background-color var(--dur-short) var(--ease-out);
}
.field textarea {
  min-height: 7rem;
  resize: vertical;
}
.field input:hover,
.field textarea:hover {
  background: var(--color-paper);
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline-color: var(--color-focus);
  background: var(--color-paper-hi);
}
.field [aria-invalid="true"] {
  border-color: var(--color-error);
}
.field input:disabled,
.field textarea:disabled {
  background: var(--color-paper-3);
  color: var(--color-muted);
  cursor: not-allowed;
}
.field-error {
  margin-top: var(--space-2xs);
  font: 500 var(--text-xs)/1.4 var(--font-body);
  color: var(--color-error);
}
.send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-xs);
}
.help {
  min-height: 1lh;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-2);
}
.help[data-state="error"] {
  color: var(--color-error);
}
.help[data-state="success"] {
  color: var(--color-success);
}

@media (max-width: 60rem) {
  .reg { display: none; }
  .g i, .dim--word { visibility: hidden; }
  .sheet-head { grid-template-columns: minmax(0, 1fr) auto; }
  .sheet-head__face { display: none; }
  .hero__status { grid-column: 1 / -1; }
  .hero__side { grid-column: 1 / -1; margin-top: var(--space-lg); }
}

@media (max-width: 40rem) {
  :root {
    --wm: calc((100vw - 2 * var(--gutter)) / 3.9);
  }
  .crop--sheet {
    --crop-l: 8px;
    --crop-g: 4px;
  }
  .hero {
    padding-block: var(--space-md) var(--space-lg);
  }
  .trim {
    row-gap: var(--space-lg);
  }
  .wm {
    display: flex;
    flex-direction: column;
  }
  .wm__sp {
    display: none;
  }
  .guides {
    height: 2.74em;
  }
  .guides--2 {
    display: block;
  }
  .guides:not(.guides--2) .g--desc,
  .guides--2 .g--asc {
    display: none;
  }
  .hero__status {
    font-size: clamp(2rem, 9.4vw, 2.5rem);
  }
  .actions {
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }
  .actions .btn {
    flex: 1 1 0;
    padding: 0 var(--space-sm);
  }
  .modal {
    padding: var(--space-xs);
  }
  .modal__sheet {
    padding: var(--space-lg);
  }
  .form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .g, .g i, .dim--word, .xsq, .mark__box::before, .modal[open] .modal__sheet {
    animation: none;
  }
  .btn, .btn::before, .crop::before, .field input, .field textarea, .mail-link {
    transition: none;
  }
}
