:root {
  --bg: #d8ded8;
  --ink: #10120f;
  --muted: #626b60;
  --glass: rgba(255, 255, 255, 0.18);
  --glass-strong: rgba(255, 255, 255, 0.34);
  --glass-line: rgba(255, 255, 255, 0.54);
  --line: rgba(20, 24, 20, 0.13);
  --hot: #ff8700;
  --shadow: 0 34px 96px rgba(20, 24, 20, 0.22);
  --font-condensed: "DIN Pro Condensed", "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
}

@font-face {
  font-family: "Golos Text";
  src:
    url("assets/fonts/Golos-Text_Bold.ttf") format("truetype"),
    local("Golos Text Bold"),
    local("GolosText-Bold");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "Golos Text";
  src:
    url("assets/fonts/Golos-Text_Regular.ttf") format("truetype"),
    local("Golos Text Regular"),
    local("GolosText-Regular");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "DIN Pro Condensed";
  src:
    url("assets/fonts/DINPro-CondBlack.otf") format("opentype"),
    local("DIN Pro Condensed Black"),
    local("DIN Pro Cond Black"),
    local("DINPro-CondensedBlack");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "DIN Pro Condensed";
  src:
    url("assets/fonts/DINPro-CondBold.otf") format("opentype"),
    local("DIN Pro Condensed Bold"),
    local("DIN Pro Cond Bold"),
    local("DINPro-CondensedBold");
  font-weight: 800;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "DIN Pro Condensed";
  src:
    url("assets/fonts/DINPro-Cond.otf") format("opentype"),
    local("DIN Pro Condensed"),
    local("DIN Pro Cond"),
    local("DINPro-Condensed");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-condensed);
  background:
    linear-gradient(112deg, rgba(255, 253, 247, 0.92) 0%, rgba(210, 225, 219, 0.86) 30%, rgba(238, 231, 219, 0.82) 62%, rgba(218, 226, 223, 0.96) 100%),
    linear-gradient(154deg, transparent 0%, rgba(255, 255, 255, 0.5) 18%, transparent 39%),
    linear-gradient(31deg, rgba(255, 135, 0, 0.05), transparent 42%, rgba(68, 118, 142, 0.06)),
    var(--bg);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(104deg, transparent 7%, rgba(255, 255, 255, 0.86) 8%, transparent 10%),
    linear-gradient(146deg, transparent 24%, rgba(43, 105, 133, 0.12) 29%, rgba(255, 135, 0, 0.13) 33%, transparent 40%),
    linear-gradient(22deg, transparent 54%, rgba(255, 255, 255, 0.5) 56%, transparent 58%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' viewBox='0 0 150 150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.9;
}

body::after {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.glass-pane {
  --mx: 24%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0.24)),
    rgba(255, 255, 255, 0.12);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 1px 0 0 rgba(255, 255, 255, 0.36),
    inset 0 -1px 0 rgba(18, 22, 18, 0.12);
  backdrop-filter: url("#liquid-glass-distortion") blur(22px) saturate(185%) contrast(1.08) brightness(1.06);
  -webkit-backdrop-filter: url("#liquid-glass-distortion") blur(22px) saturate(185%) contrast(1.08) brightness(1.06);
}

.glass-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.78), transparent 26%),
    linear-gradient(128deg, rgba(255, 255, 255, 0.62) 0%, transparent 19%, rgba(255, 255, 255, 0.17) 42%, transparent 72%),
    linear-gradient(28deg, rgba(255, 135, 0, 0.1), transparent 36%, rgba(68, 118, 142, 0.1));
  filter: url("#liquid-glass-distortion");
  mix-blend-mode: screen;
  opacity: 0.82;
}

.glass-pane::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(142deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.16) 28%, rgba(16, 18, 15, 0.12) 50%, rgba(255, 255, 255, 0.82) 100%),
    linear-gradient(90deg, rgba(255, 135, 0, 0.18), rgba(64, 130, 158, 0.12));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.95;
}

.glass-pane > * {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto 18px;
  padding: 18px 20px;
  border-radius: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.session-pill {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  padding: 9px 11px;
  color: rgba(16, 18, 15, 0.66);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  text-transform: uppercase;
}

h1 {
  font-size: 72px;
  line-height: 0.9;
}

h2 {
  font-size: 30px;
  line-height: 0.95;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 0.58fr) minmax(0, 1fr);
  gap: 18px;
  max-width: 1540px;
  margin: 0 auto;
}

.controls {
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
}

.control-section {
  display: grid;
  gap: 8px;
}

.headline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.headline-panel textarea {
  min-height: 174px;
}

.headline-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.headline-tools button {
  position: relative;
  overflow: hidden;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(20, 24, 20, 0.1);
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  transform: translate3d(0, 0, 0);
  transition:
    transform 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 170ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 170ms ease,
    border-color 170ms ease;
}

.headline-tools button:first-child {
  background:
    linear-gradient(135deg, rgba(128, 198, 32, 0.42), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.14);
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.12)),
    rgba(255, 255, 255, 0.16);
  color: var(--ink);
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -1px 0 rgba(16, 18, 15, 0.08);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

select {
  min-height: 52px;
  padding: 12px 14px;
  font-size: 17px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.drop-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 56%, rgba(255, 255, 255, 0.22)),
    rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(16, 18, 15, 0.08),
    0 16px 34px rgba(20, 24, 20, 0.1);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  cursor: pointer;
  padding: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging,
#imageInput:focus-visible + .drop-zone {
  border-color: rgba(255, 135, 0, 0.78);
  box-shadow:
    0 0 0 4px rgba(255, 135, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 34px rgba(20, 24, 20, 0.12);
  transform: translateY(-1px);
}

.drop-zone-mark {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 18, 15, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 18px rgba(16, 18, 15, 0.18);
}

.drop-zone-mark::before,
.drop-zone-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 3px;
  border-radius: 4px;
  background: #fff;
  transform: translate(-50%, -50%);
}

.drop-zone-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.drop-zone-title,
.drop-zone-meta {
  display: block;
}

.drop-zone-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 0.9;
  text-transform: uppercase;
}

.drop-zone-meta {
  margin-top: 5px;
  color: rgba(16, 18, 15, 0.52);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

textarea {
  min-height: 174px;
  resize: vertical;
  padding: 18px;
  font-size: 18px;
  line-height: 1.08;
  text-transform: uppercase;
}

select:focus,
textarea:focus {
  border-color: rgba(255, 135, 0, 0.78);
  box-shadow: 0 0 0 4px rgba(255, 135, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.title-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  padding: 8px 9px;
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
}

.title-counts-heading {
  flex: 1 0 100%;
  margin: 0;
  color: rgba(16, 18, 15, 0.62);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.title-counts-list {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.title-counts span {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  padding: 5px 5px;
  color: rgba(16, 18, 15, 0.62);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.035em;
  text-align: center;
  white-space: nowrap;
}

.color-runs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.color-runs span {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(117, 188, 31, 0.45);
  border-radius: 6px;
  background: rgba(117, 188, 31, 0.16);
  padding: 5px 7px;
  color: rgba(16, 18, 15, 0.72);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.primary-button,
.secondary-button,
.format-actions button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(49, 52, 48, 0.94), rgba(15, 17, 15, 0.74)),
    rgba(16, 18, 15, 0.78);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 12px 28px rgba(16, 18, 15, 0.22);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translate3d(0, 0, 0);
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 180ms ease,
    border-color 180ms ease;
}

.primary-button::after,
.secondary-button::after,
.format-actions button::after,
.headline-tools button::after {
  content: "";
  position: absolute;
  inset: -42%;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--press-x, 50%) var(--press-y, 50%), rgba(255, 255, 255, 0.78) 0 8%, rgba(255, 255, 255, 0.28) 20%, transparent 44%);
  opacity: 0;
  transform: scale(0.58);
}

.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.format-actions button:not(:disabled):hover,
.headline-tools button:not(:disabled):hover {
  border-color: rgba(255, 255, 255, 0.86);
  filter: saturate(1.08) brightness(1.03);
}

.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.format-actions button:not(:disabled):active,
.headline-tools button:not(:disabled):active {
  box-shadow:
    inset 0 1px 4px rgba(0, 0, 0, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2),
    0 8px 18px rgba(16, 18, 15, 0.18);
  filter: saturate(1.14) brightness(0.98);
  transform: translate3d(0, 1px, 0) scale(0.982);
}

.primary-button.is-pressing::after,
.secondary-button.is-pressing::after,
.format-actions button.is-pressing::after,
.headline-tools button.is-pressing::after {
  animation: button-press-ripple 520ms cubic-bezier(0.18, 0.9, 0.24, 1);
}

@keyframes button-press-ripple {
  0% {
    opacity: 0.78;
    transform: scale(0.5);
  }

  72% {
    opacity: 0.22;
  }

  100% {
    opacity: 0;
    transform: scale(1.36);
  }
}

.primary-button {
  min-height: 48px;
  padding: 0 18px;
}

.secondary-button {
  min-height: 48px;
  padding: 0 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.18);
  color: var(--ink);
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: start;
  gap: 18px;
}

.format-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 13px;
}

.format-card[data-format-card$="-vertical"] {
  width: 100%;
  max-width: 360px;
  justify-self: center;
}

.format-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.format-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.format-actions button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.format-actions button:first-child {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.14)),
    rgba(255, 255, 255, 0.18);
  color: var(--ink);
}

.canvas-frame {
  justify-self: center;
  width: 100%;
  max-width: 260px;
  background: #050505;
  box-shadow:
    0 28px 72px rgba(20, 24, 20, 0.26),
    0 1px 0 rgba(255, 255, 255, 0.36);
  touch-action: none;
  user-select: none;
}

.canvas-frame.wide {
  max-width: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

canvas.dragging {
  cursor: grabbing;
}

.crop-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crop-readout span,
.zoom-control {
  min-width: 82px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 10px;
  color: rgba(16, 18, 15, 0.72);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 116px;
  padding: 5px 8px;
}

.zoom-control input {
  appearance: textfield;
  width: 46px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -1px 0 rgba(20, 24, 20, 0.08);
  color: var(--ink);
  font: inherit;
  line-height: 1;
  outline: none;
  padding: 3px 4px 2px;
  text-align: right;
}

.zoom-control input:focus {
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.7),
    0 0 0 4px rgba(117, 188, 31, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.zoom-control input::-webkit-outer-spin-button,
.zoom-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .glass-pane {
    background: rgba(247, 248, 245, 0.94);
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .format-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .controls {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .controls {
    gap: 12px;
    padding: 12px;
  }

  .headline-grid {
    gap: 8px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 auto;
  }

  .session-pill {
    flex-basis: 100%;
    text-align: center;
  }

  .headline-panel textarea {
    min-height: 144px;
    padding: 12px;
    font-size: 16px;
  }

  .headline-tools button {
    flex: 1 1 100%;
  }

  .title-counts {
    gap: 5px;
    padding: 6px;
  }

  .title-counts-heading {
    font-size: 9px;
  }

  .title-counts span {
    border-radius: 5px;
    padding: 4px 3px;
    font-size: 8px;
    letter-spacing: 0.02em;
  }

  .title-counts-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .title-counts span {
    text-align: left;
  }

  h1 {
    font-size: 46px;
  }

  .format-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .format-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .format-actions button {
    width: 100%;
  }
}
