@font-face{font-family:VenovanieScript;src:url(assets/fonts/Italianno-Regular.ttf) format("truetype");font-display:swap}
@font-face{font-family:VenovanieHand;src:url(assets/fonts/Caveat.ttf) format("truetype");font-weight:400 700;font-display:swap}
@font-face{font-family:VenovanieDecorative;src:url(assets/fonts/GreatVibes-Regular.ttf) format("truetype");font-display:swap}
@font-face{font-family:VenovanieSans;src:url(assets/fonts/NotoSans-Regular.ttf) format("truetype");font-display:swap}
@font-face{font-family:VenovanieSerif;src:url(assets/fonts/NotoSerif-Regular.ttf) format("truetype");font-display:swap}
@font-face{font-family:VenovanieItalic;src:url(assets/fonts/NotoSerifDisplay-Italic.ttf) format("truetype");font-display:swap}
@font-face{font-family:Nunito;src:url(assets/fonts/Nunito.ttf) format("truetype");font-weight:200 1000;font-display:swap}
@font-face{font-family:Figtree;src:url(assets/fonts/Figtree.ttf) format("truetype");font-weight:300 900;font-display:swap}

:root {
  color-scheme: light;
  --ink: #22211f;
  --secondary: #5c574f;
  --line: #dedad2;
  --gold: #765315;
  --preview: #f3f3f4;
  --display: Nunito, Figtree, system-ui, sans-serif;
  font: 1rem/1.5 Figtree, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #fff; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; }
a { color: inherit; text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.shell { width: min(1140px, calc(100% - 5rem)); margin-inline: auto; }

.intro { padding: 2.65rem 0 2.05rem; }
.intro h1 { font-size: clamp(2.25rem, 5.5vw, 4.25rem); font-weight: 900; letter-spacing: -.035em; }
.title-accent { color: #D5AF33; }

.editor { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); gap: clamp(2rem, 5.5vw, 5rem); align-items: start; }
.controls { display: grid; min-width: 0; }
label { font: 750 .9rem/1.5 var(--display); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.template-picker { margin-top: 1rem; }
.template-picker legend { padding: 0; margin-bottom: .55rem; font: 750 .9rem/1.5 var(--display); }
.template-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin-top: .65rem; }
.template-options label { position: relative; min-width: 0; cursor: pointer; }
.template-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.template-options span { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 210 / 99; min-height: 44px; border: 1px solid #d9d4cb; border-radius: 4px; background: white; color: var(--secondary); text-align: center; font-size: .75rem; }
.template-options canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; box-shadow: none; }
.template-options label:hover span { border-color: var(--gold); }
.template-options input:checked + span { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 1px var(--gold); }
.template-options input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }
.optional-heading { margin-bottom: .75rem; }
.optional-heading summary { cursor: pointer; font-size: .9rem; color: var(--secondary); }
.optional-heading[open] summary { margin-bottom: .55rem; }
.optional-heading[open] .add-heading,
.optional-heading:not([open]) .hide-heading { display: none; }
.optional-heading input[type="text"] { margin-bottom: .25rem; }
.formats, .typography { display: grid; gap: .5rem; }
.typography { align-items: end; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.formats label { position: relative; }
.formats input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.formats span { display: grid; place-items: center; border-bottom: 1px solid #c9c5bd; text-align: center; cursor: pointer; }
.formats input:checked + span { border-bottom: 2px solid var(--gold); color: var(--ink); }
.formats input:not(:checked) + span { color: var(--secondary); }
.formats input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

textarea, input[type="text"], select, #custom-color {
  display: block;
  width: 100%;
  margin: .35rem 0 1rem;
  border: 1px solid #c9c5bd;
  border-radius: 3px;
  background: #fff;
  padding: .55rem .65rem;
  min-height: 2.625rem;
  font-size: 1rem;
  font-weight: 400;
}
textarea { resize: vertical; min-height: 6rem; }
input::placeholder, textarea::placeholder { color: #6e6e6e; opacity: 1; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.field-example { color: var(--secondary); font-size: .76rem; font-weight: 400; }
.field-label:not(:has(+ :placeholder-shown)) .field-example { visibility: hidden; }
.typography label { min-width: 0; }
input[type="text"], select, #custom-color { height: 2.75rem; }
.typography select, #custom-color { margin-bottom: 0; }
.typography select { appearance: none; padding: .45rem 1.5rem .45rem .6rem; background: #fff; }
.typography label:has(select) { position: relative; }
.typography label:has(select)::after { content: ""; position: absolute; pointer-events: none; right: .65rem; bottom: 1.23rem; width: .35rem; height: .35rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.font-control { min-width: 0; }
.font-label { font: 750 .9rem/1.5 var(--display); }
.font-picker { position: relative; margin-top: .35rem; }
.font-picker summary { display: flex; align-items: center; height: 2.75rem; padding: 0 1.5rem 0 .6rem; border: 1px solid #c9c5bd; border-radius: 3px; background: white; cursor: pointer; list-style: none; font-size: 1.2rem; white-space: nowrap; }
.font-picker summary::-webkit-details-marker { display: none; }
.font-picker summary::after { content: ""; position: absolute; right: .65rem; top: 1.03rem; width: .35rem; height: .35rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.font-options { position: absolute; top: calc(100% + .3rem); left: 0; z-index: 2; width: min(17rem, calc(100vw - 2.25rem)); padding: .25rem; border: 1px solid #c9c5bd; border-radius: 4px; background: #fff; box-shadow: 0 3px 12px #2424291a; }
.font-options label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .45rem; padding: .22rem .55rem; min-height: 44px; cursor: pointer; border-radius: 3px; }
.font-options label:hover, .font-options label:has(input:checked) { background: var(--preview); }
.font-options label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: -2px; }
.font-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.font-sample { font-size: 1.35rem; font-weight: 400; white-space: nowrap; }
#custom-color { max-width: 4.8rem; padding: .32rem; cursor: pointer; }
#custom-color::-webkit-color-swatch-wrapper { padding: 0; }
#custom-color::-webkit-color-swatch { border: 0; border-radius: 2px; }
#custom-color::-moz-color-swatch { border: 0; border-radius: 2px; }

.preview { display: grid; grid-template-columns: minmax(0, 1fr); padding: clamp(1.15rem, 3vw, 2.2rem); background: var(--preview); border-radius: 5px; }
.format-picker { margin-bottom: 1rem; }
.formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.formats span { min-height: 44px; height: 100%; padding: .4rem .35rem; }
.paper-stage { display: grid; place-items: center; padding-block: .35rem .75rem; }
canvas { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 3px 12px #2424291a; }
canvas[data-format="a4"] { max-width: 310px; }
.status { color: #893422; font-size: .86rem; margin: .35rem 0 0; }
.primary { justify-self: start; margin-top: .95rem; min-height: 45px; background: var(--ink); color: #fff; padding: .65rem 1.3rem; border: 1px solid transparent; border-radius: 3px; font-weight: 500; }
.primary:hover:enabled { background: #393530; }
.primary:disabled { background: #dedee1; color: #505057; }
.post-download { margin-top: .75rem; font-size: .9rem; }
.post-download p { margin-bottom: .25rem; }

.examples { margin: 3.2rem 0 3rem; }
.examples h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 800; margin-bottom: 1.25rem; }
.example-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.example-group { display: flex; flex-direction: column; gap: .7rem; min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.1rem .65rem; }
.example-grid { display: grid; flex: 1; }
.example-grid article { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
.example-switcher article { grid-area: 1 / 1; visibility: hidden; }
.example-switcher .example-current { visibility: visible; }
.example-grid h3 { font-size: 1.07rem; font-weight: 750; }
.example-grid p { color: var(--secondary); font-size: .94rem; }
.example-grid button { border: 0; background: transparent; min-height: 40px; padding: .25rem 0; margin-top: auto; font-size: .875rem; text-decoration: underline; text-underline-offset: .22em; }
.example-grid button:hover { color: var(--gold); }
.example-navigation { display: flex; justify-content: center; }
.example-navigation button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: transparent; padding: 0; }
.example-navigation button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c4af8c; }
.example-navigation button[aria-pressed="true"]::before { width: 11px; height: 11px; }
.example-navigation button:hover::before { background: #ae9670; }
footer { padding: 1rem 0 1.5rem; color: var(--secondary); font-size: .87rem; }
footer .shell { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .25rem 1rem; }
.operator-details summary { cursor: pointer; }
.operator-details address { margin-top: .55rem; font-style: normal; }

@media (max-width: 790px) {
  .template-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { width: calc(100% - 2.25rem); }
  .intro { padding: 2rem 0 1.45rem; }
  .editor { grid-template-columns: 1fr; gap: 1.45rem; }
  .primary { width: 100%; }
  .example-cards { grid-template-columns: 1fr; }
  .examples { margin: 2rem 0; }
}

@media (max-width: 400px) {
  .shell { width: calc(100% - 1.5rem); }
  .typography { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(62px, auto); }
  .typography label, .font-label { font-size: .8rem; }
}
