:root {
  color-scheme: light;
  --paper: #fff8ed;
  --card: #fffdf8;
  --ink: #21140f;
  --muted: #69564c;
  --line: #e2cbb9;
  --rust: #ad351f;
  --rust-dark: #8e2818;
  --olive: #465a39;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --display: "Instrument Serif", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  background: radial-gradient(#a4775329 0.65px, transparent 0.9px) 0 0 / 19px 19px, var(--paper);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button:not(:disabled), summary, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 0.6rem 0.9rem;
  background: white;
}
.studio-width { width: min(1110px, calc(100% - 4rem)); margin-inline: auto; }
.studio-header {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--line);
}
.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.065em;
  text-decoration: none;
}
.studio-brand img { object-fit: contain; }
.studio-brand span span { color: var(--rust); }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.42rem;
  min-height: 46px;
  max-width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.91rem;
  font-weight: 720;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}
.button-outline { color: var(--ink); background: var(--card); }
.button-outline:hover { background: #f9e7d8; }
.button-primary { color: #fffaf2; background: var(--rust); border-color: var(--rust); box-shadow: 0 3px 0 #7e2417; }
.button-primary:hover { background: var(--rust-dark); }
.button:disabled { opacity: 0.65; }
.studio-intro { margin-block: 2.75rem 1.65rem; }
.studio-intro h1 {
  font-size: clamp(2.45rem, 6.6vw, 5.25rem);
  font-weight: 780;
  line-height: 1.04;
  letter-spacing: -0.075em;
}
.studio-intro em { color: var(--rust); font: italic 500 1.04em/1.02 var(--display); letter-spacing: -0.055em; }
.studio-intro p { margin-top: 0.7rem; max-width: 57ch; color: var(--muted); font-size: clamp(0.97rem, 2vw, 1.1rem); }
.step-nav { margin-bottom: 1rem; }
.step-nav ol { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0; padding: 0; list-style: none; }
.step-nav button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem 0.28rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}
.step-nav button:enabled:hover { background: #f6e3d3; }
.step-nav button[aria-current="step"] { border-color: #e9b9a0; color: var(--rust-dark); background: #fbe5d7; }
.step-dot {
  display: inline-grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #efdfd2;
  line-height: 1;
}
[aria-current="step"] .step-dot { background: var(--rust); color: white; }
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.46fr);
  align-items: start;
  gap: 1.65rem;
}
.studio-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--card);
  box-shadow: 0 6px 0 #e9d4c4;
}
.studio-card [data-step] { scroll-margin-top: 0.75rem; }
.step-heading { margin-bottom: 1.2rem; }
.step-heading h2 {
  width: fit-content;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.049em;
  font-weight: 770;
}
.step-heading p { margin-top: 0.4rem; color: var(--muted); }
.example-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.12rem 0.85rem;
  padding: 0.5rem 0.72rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: #f7e8db;
  color: #624234;
  font-size: 0.87rem;
}
.text-button {
  padding: 0.2rem 0;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--rust-dark);
  font-size: inherit;
  font-weight: 740;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.field { display: grid; min-width: 0; gap: 0.3rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 0.93rem; font-weight: 750; }
.field small { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.field input, .field select, .field textarea {
  min-width: 0;
  width: 100%;
  min-height: 45px;
  padding: 0.58rem 0.67rem;
  border: 1px solid #bd9f8b;
  border-radius: 10px;
  color: var(--ink);
  background: #fffcf7;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #786559; }
.field-hint { color: var(--muted); font-size: 0.83rem; }
.field :is(input, textarea)[aria-invalid="true"] { border-color: var(--rust-dark); }
.section-editors { display: grid; gap: 0.65rem; }
.section-editor { --part: #945333; border: 1px solid var(--line); border-radius: 12px; background: #fffaf4; }
.section-editor[data-key="projects"] { --part: var(--rust); }
.section-editor[data-key="skills"] { --part: var(--olive); }
.section-editor[data-key="education"] { --part: #704c78; }
.section-editor summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 51px;
  padding: 0.55rem 0.75rem;
  border-radius: inherit;
  font-weight: 750;
  list-style: none;
}
.section-editor summary::-webkit-details-marker { display: none; }
.section-editor summary::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-inline: 0.15rem 0.12rem;
  transform: rotate(45deg);
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
}
.section-editor[open] summary::after { transform: rotate(225deg); }
.section-marker { width: 10px; height: 10px; border-radius: 50%; background: var(--part); }
.section-status { margin-left: auto; color: var(--muted); font-size: 0.78rem; font-weight: 550; }
.section-fields { display: grid; gap: 0.8rem; padding: 0.8rem 0.75rem 0.95rem; border-top: 1px solid var(--line); }
.signature-field { margin-top: 1.15rem; }
.form-error { margin-top: 0.65rem; color: var(--rust-dark); font-size: 0.92rem; font-weight: 720; }
.form-actions { display: flex; justify-content: space-between; gap: 0.6rem; margin-top: 1.35rem; }
#next-step { margin-left: auto; }
.studio-aside { position: sticky; top: 1rem; }
.aside-card {
  overflow: hidden;
  padding: 1.35rem;
  border: 1px solid #d9af95;
  border-radius: 23px;
  background: radial-gradient(ellipse at 60% 46%, #fff1dc, #f5dac3);
  box-shadow: 0 6px 0 #e9cab3;
}
.aside-card h2 { font-size: 1.06rem; font-weight: 730; }
.pizza-illustration {
  display: grid;
  max-width: 285px;
  place-items: center;
  margin: 1.45rem auto 1.6rem;
  aspect-ratio: 1.08;
}
.pizza-paper {
  width: 82%;
  padding: 0.65rem;
  aspect-ratio: 1;
  transform: rotate(-10deg);
  border: 1px solid #d5a077;
  border-radius: 9px;
  background: conic-gradient(#d77e5b44 25%, #ffe8cd 0 50%, #d77e5b44 0 75%, #ffe8cd 0) 0 0 / 16px 16px;
  box-shadow: 2px 7px 0 #c79670, 9px 17px 18px #7c452f37;
}
.pizza-paper img { display: block; width: 100%; height: auto; }
.aside-profile { padding-top: 1rem; border-top: 1px solid #d8b79f; }
#aside-name { font-size: clamp(1.3rem, 3vw, 1.6rem); font-weight: 780; line-height: 1.15; letter-spacing: -0.04em; overflow-wrap: anywhere; }
#aside-role { margin-top: 0.25rem; color: #684c3d; overflow-wrap: anywhere; }
.review { padding: 0.85rem 1rem; border: 1px solid #e4c1aa; border-radius: 13px; background: #fbece0; }
.review-name { font-size: 1.28rem; font-weight: 760; overflow-wrap: anywhere; }
.review-role { color: var(--muted); overflow-wrap: anywhere; }
.review-signature { margin-top: 0.38rem; color: var(--rust-dark); font-size: 0.9rem; font-weight: 690; overflow-wrap: anywhere; }
.share-options { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 1rem; }
.share-options > div { display: flex; flex-direction: column; align-items: start; gap: 0.52rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 12px; }
.share-options h3 { font-size: 1.02rem; }
.share-options p { color: var(--muted); font-size: 0.91rem; }
.share-options .button { margin-top: auto; }
.export-status:empty { display: none; }
.local-note { margin-top: 0.9rem; color: var(--muted); font-size: 0.88rem; }
.studio-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 1rem; padding-block: 0.95rem 1.35rem; margin-top: 2.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
#clear-dialog { width: min(440px, calc(100% - 2rem)); padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); }
#clear-dialog::backdrop { background: #2c1b15a6; }
#clear-dialog h2 { font-size: 1.25rem; }
#clear-dialog p { margin-top: 0.4rem; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1rem; }

@media (max-width: 790px) {
  .studio-width { width: calc(100% - 2rem); }
  .studio-header { min-height: 63px; }
  .studio-intro { margin-block: 1.5rem 1.15rem; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-aside { display: none; }
}
@media (max-width: 520px) {
  .studio-brand img { width: 34px; height: 34px; }
  .studio-brand { font-size: 1.25rem; }
  .example-link { min-height: 44px; padding-inline: 0.7rem; font-size: 0.8rem; }
  .step-nav ol { flex-wrap: nowrap; justify-content: space-between; gap: 0.2rem; }
  .step-nav button { gap: 0.3rem; padding-inline: 0.17rem 0.3rem; font-size: 0.75rem; }
  .step-dot { width: 23px; height: 23px; }
  .studio-card { padding: 1rem; border-radius: 17px; }
  .field-grid, .share-options { grid-template-columns: 1fr; }
  .share-options .button { width: 100%; }
  .studio-footer { margin-top: 1.6rem; }
}
@media (max-width: 350px) {
  .studio-width { width: calc(100% - 1.3rem); }
  .step-nav button { font-size: 0.7rem; }
  .step-dot { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.social-fields { margin-top: 1rem; border-top: 1px solid var(--line); }
.social-fields summary { padding: .72rem 0; min-height: 44px; font-weight: 700; color: var(--rust-dark); }
.social-fields .field-grid { margin-top: .4rem; }
.section-editor[data-recipe] .section-marker { background: var(--flavor-ink); box-shadow: 0 0 0 4px var(--flavor-paper); }
.aside-pizza, .composer-plate { position: relative; aspect-ratio: 1; }
.studio-grid.is-composing { grid-template-columns: minmax(0,800px); justify-content: center; }
.is-composing .studio-aside { display: none; }
.recipe-composer { display: grid; grid-template-columns: minmax(100px,.86fr) minmax(132px,1fr); align-items: center; gap: clamp(12px,4vw,36px); padding: clamp(12px,3vw,26px); border: 1px solid #ead9bf; border-radius: 14px; background: repeating-linear-gradient(90deg, #dcba8530 0 12px, transparent 12px 24px), repeating-linear-gradient(#dcba8524 0 12px, transparent 12px 24px), #fcf4e4; }
.composer-plate { width: min(100%, 230px); margin: auto; border-radius: 50%; background: #f5eedb; box-shadow: 0 0 0 4px #f9f4e4, 0 0 0 5px #92a18b, 0 0 0 8px #f7f4e9, 2px 8px 8px #79533048; transform: rotate(-7deg); }
.composer-plate .food-piece { appearance: none; border: 0; padding: 0; background: transparent; transition: transform 220ms ease; }
.composer-plate .food-piece:focus-visible { outline-offset: -2px; z-index: 2; }
.composer-plate .selected-piece[data-piece="experience"] { transform: translate(-5%,-5%); }
.composer-plate .selected-piece[data-piece="skills"] { transform: translate(5%,-5%); }
.composer-plate .selected-piece[data-piece="education"] { transform: translate(-5%,5%); }
.composer-plate .selected-piece[data-piece="projects"] { transform: translate(5%,5%); }
.section-picker,.recipe-picker { min-width: 0; padding: 0; margin: 0; border: 0; }
.section-picker legend,.recipe-picker legend { font-weight: 750; margin: 0 0 .45rem; padding: 0; }
#part-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem; }
#part-controls button { min-height: 44px; border: 1px solid #ccbaa6; border-radius: 6px; color: #473a30; background: #fffcf7; font-size: .86rem; }
#part-controls button[aria-pressed="true"] { background: var(--flavor-paper); color: var(--flavor-ink); border: 2px solid var(--flavor-ink); font-weight: 720; }
.recipe-picker { margin-top: 1.15rem; }
.recipe-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; }
.recipe-option { position: relative; min-width: 0; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: .38rem; padding: .6rem .14rem .42rem; min-height: 80px; border: 1px solid #dacaac; border-radius: 8px; cursor: pointer; background: #fffdf7; text-align: center; font-size: .83rem; line-height: 1.16; font-weight: 650; }
.recipe-option .topping { display: block; width: 36px; height: 36px; background: var(--food) center/contain no-repeat; transform: rotate(45deg); }
.recipe-option:has(input:checked) { color: var(--flavor-ink); border-color: var(--flavor-ink); box-shadow: inset 0 0 0 1px var(--flavor-ink); background: var(--flavor-paper); }
.recipe-option:has(input:checked)::after { content: "✓"; position: absolute; right: .28rem; top: .1rem; font-size: .78rem; }
.recipe-option:has(input:focus-visible) { outline: 3px solid var(--olive); outline-offset: 2px; }
@media (max-width: 640px) {
  #part-controls { grid-template-columns: 1fr; gap: 2px; }
  #part-controls button { font-size: .78rem; }
  .section-picker legend { font-size: .83rem; }
  .recipe-composer { grid-template-columns: minmax(75px,1fr) minmax(100px,.85fr); padding: .8rem .72rem; }
  .recipe-options { gap: .3rem; }
  .recipe-option { min-height: 75px; font-size: .74rem; }
  .recipe-option .topping { width: 29px; height: 29px; }
}
@media (max-width: 360px) {
  .recipe-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .step-nav ol { flex-wrap: wrap; }
}
.studio-intro[hidden] + .step-nav { margin-top: .9rem; }
.photo-editor { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .6rem 1rem; padding: .9rem 0 1.2rem; }
.photo-editor .portrait-frame { width: 78px; margin-left: 4px; }
.photo-controls { min-width: 0; }
.photo-controls label { display: block; font-weight: 700; }
.photo-controls small { color: var(--muted); font-weight: 400; }
.photo-controls input { width: 100%; min-height: 44px; padding-block: .4rem; font-size: .8rem; }
.photo-controls input::file-selector-button, .record-actions button, .add-record { min-height: 40px; padding: .3rem .7rem; background: #fffdf6; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); cursor: pointer; }
.photo-controls .text-button { min-height: 32px; }
.photo-editor:has(.portrait-frame[hidden]) .photo-controls, .crop-settings, #photo-status { grid-column: 1 / -1; }
#photo-status:empty { display: none; }
.crop-settings summary { cursor: pointer; min-height: 40px; padding: .4rem 0; color: var(--rust-dark); font-size: .87rem; }
.crop-settings > div { display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); gap: .8rem; }
.crop-settings label { font-size: .82rem; font-weight: 620; }
.crop-settings input { width:100%; display:block; accent-color: var(--rust); }
.section-records { margin: 0 .65rem; }
.record { border-top: 1px solid var(--line); }
.record > summary { color: #463c31; font-size: .9rem; font-weight: 620; }
.record > summary::before { content: "›"; color: var(--rust); font-size: 1.2rem; }
.record[open] > summary::before { transform: rotate(90deg); }
.record > summary::after { display: none; }
.record-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.record-actions button { min-height: 44px; padding-inline: .55rem; font-size: .78rem; }
.record-actions button:disabled { opacity: .4; cursor: default; }
.record-actions [data-remove] { color: var(--rust-dark); margin-left: auto; }
.add-record { margin: .55rem .8rem .8rem; min-height: 44px; font-weight: 650; color: var(--rust-dark); }
