/* The engraving field with the name that engraves itself on the pen */

:root {
  --page: #ffffff;
  --card: #ffffff;
  --ink: #17191c;
  --ink-2: #5b6168;
  --ink-3: #9aa0a7;
  --line: #e7e9ec;
  --panel-a: #f6f7f8;
  --panel-b: #eceef1;
  --accent: #1f2329;
  --hot: #ff9a3d;
  --steel-engrave: #4f555c;
  --ok: #2f8f5b;
  --warn: #c47a12;
  --ui: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  --serif: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  --script: 'Caveat Variable', 'Caveat', cursive;
  --mono: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 32px) 12px;
}

.card {
  position: relative;
  width: min(440px, 94vw);
  padding: clamp(14px, 3.6vh, 24px) clamp(14px, 4vw, 24px);
  background: var(--card);
  border-radius: 26px;
  border: 1px solid rgba(20, 24, 30, 0.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(20, 24, 30, 0.05),
    0 6px 14px rgba(20, 24, 30, 0.06),
    0 24px 48px -12px rgba(20, 24, 30, 0.14);
  display: grid;
  gap: clamp(9px, 2.6vh, 16px);
}

/* the head */
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card__brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 640; font-size: 14px; letter-spacing: -0.01em; }
.card__brand svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card__name { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the pen panel */
.pen {
  position: relative;
  height: clamp(84px, 22vh, 150px);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--panel-a), var(--panel-b));
  box-shadow: inset 0 0 0 1px rgba(20, 24, 30, 0.05), inset 0 -10px 24px -14px rgba(20, 24, 30, 0.18);
  overflow: hidden;
}
.pen__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pen__shadow { fill: rgba(25, 30, 36, 0.26); }
.pen__contact { fill: rgba(25, 30, 36, 0.45); }
.pen__edge { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 1; }
.pen__clip { fill: url(#steel); stroke: rgba(40, 44, 50, 0.35); stroke-width: 0.6; }
.pen__clip-shine { fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 1; stroke-linecap: round; }
.pen__sheen { mix-blend-mode: soft-light; }

.pen__hint {
  position: absolute; left: 0; right: 0; bottom: clamp(5px, 1.4vh, 10px);
  text-align: center; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}

/* the engraving, over the barrel */
.engrave { position: absolute; pointer-events: none; display: flex; align-items: center; justify-content: center; overflow: visible; }
.engrave__text { position: relative; display: flex; align-items: center; white-space: pre; line-height: 1; }
.engrave__text span { display: inline-block; white-space: pre; will-change: transform; }
.engrave[data-face='serif'] .engrave__text { font-family: var(--serif); font-variation-settings: 'opsz' 14, 'SOFT' 0, 'WONK' 0; font-weight: 520; letter-spacing: 0.06em; }
.engrave[data-face='script'] .engrave__text { font-family: var(--script); font-weight: 560; letter-spacing: 0.01em; }
.engrave[data-face='mono'] .engrave__text { font-family: var(--mono); font-weight: 520; letter-spacing: 0.04em; text-transform: uppercase; }
.engrave__line {
  position: absolute; top: 8%; bottom: 8%; left: 0; width: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(180deg, rgba(255, 245, 225, 0), #fff6e3 30%, #fff6e3 70%, rgba(255, 245, 225, 0));
  box-shadow: 0 0 10px 2px rgba(255, 176, 96, 0.55);
}

/* the field */
.field { display: grid; gap: 8px; }
.field__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field__label { font-size: 13px; font-weight: 620; color: var(--ink); }

.styles {
  position: relative; display: inline-flex; padding: 3px; border-radius: 999px;
  background: #f1f2f4; box-shadow: inset 0 0 0 1px rgba(20, 24, 30, 0.05);
}
.styles__pill {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 30, 0.12), 0 4px 10px -4px rgba(20, 24, 30, 0.2), inset 0 0 0 1px rgba(20, 24, 30, 0.04);
}
.styles__opt {
  position: relative; z-index: 1; appearance: none; border: 0; background: none; cursor: pointer;
  padding: 6px clamp(8px, 2.6vw, 12px); font: 600 12px var(--ui); color: var(--ink-2); border-radius: 999px;
  transition: color 0.25s;
}
.styles__opt[data-style='serif'] { font-family: var(--serif); font-weight: 560; }
.styles__opt[data-style='script'] { font-family: var(--script); font-size: 15px; font-weight: 600; line-height: 12px; }
.styles__opt[data-style='mono'] { font-family: var(--mono); font-size: 11px; }
.styles__opt.is-on { color: var(--ink); }
@media (hover: hover) { .styles__opt:hover { color: var(--ink); } }

.field__box {
  position: relative; display: flex; align-items: center; height: clamp(40px, 10.5vh, 48px); border-radius: 14px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(20, 24, 30, 0.04);
  transition: box-shadow 0.25s;
}
.field__box.is-focus { box-shadow: inset 0 0 0 1.5px #1f2329, 0 0 0 4px rgba(31, 35, 41, 0.08); }
.field__input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; padding: 0 14px;
  font: 500 15px var(--ui); color: var(--ink); caret-color: var(--ink);
}
.field__input::placeholder { color: var(--ink-3); }
.field__count { padding-right: 14px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; transition: color 0.25s; }
.field__count.is-near { color: var(--warn); }

/* the foot */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.foot__price { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.foot__label { font-size: 12px; color: var(--ink-2); grid-column: 1 / -1; }
.foot__total { display: inline-flex; font-size: clamp(20px, 5.6vh, 24px); font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.foot__total .d { display: inline-block; height: 1.1em; overflow: hidden; }
.foot__total .d > span { display: flex; flex-direction: column; }
.foot__total .d > span > i { font-style: normal; height: 1.1em; }
.foot__extra { font-size: 11.5px; color: var(--ok); white-space: nowrap; opacity: 0; }

.bag {
  position: relative; appearance: none; border: 0; cursor: pointer; height: clamp(40px, 10.5vh, 48px);
  padding: 0 clamp(16px, 5vw, 24px); border-radius: 999px; background: var(--accent); color: #fff;
  font: 620 14px var(--ui); letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 18px -8px rgba(20, 24, 30, 0.5);
}
.bag__in { display: inline-flex; align-items: center; gap: 8px; }
.bag__check { width: 0; height: 18px; overflow: visible; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .bag:hover { background: #2a2f36; } }

/* the drawn pointer */
.pointer {
  position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; z-index: 5; opacity: 0;
  fill: #111; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

@media (max-width: 380px) {
  .card__name { display: none; }
}
