:root {
  --background: #080808;
  --surface: #11110f;
  --surface-soft: #171713;
  --surface-border: rgba(210, 171, 92, 0.18);

  --gold: #d3ad64;
  --gold-bright: #f0cf86;
  --gold-dark: #8b6b35;

  --cream: #f5efe3;
  --text: #f4f0e7;
  --text-soft: #aaa69d;
  --text-muted: #747169;

  --navigation-height: 78px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --radius-large: 28px;
  --radius-medium: 20px;
  --radius-small: 14px;

  --shadow:
    0 22px 55px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--background);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(160, 117, 49, 0.12),
      transparent 35%
    ),
    var(--background);

  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.015),
      transparent 18%
    );
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 74px;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    22px
    10px;

  background:
    linear-gradient(
      180deg,
      rgba(8, 8, 8, 0.98),
      rgba(8, 8, 8, 0.84),
      transparent
    );

  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand-name {
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.17em;
}

.brand-ai {
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.profile-button {
  display: grid;
  place-items: center;

  width: 38px;
  height: 38px;

  border: 1px solid rgba(211, 173, 100, 0.34);
  border-radius: 50%;

  color: var(--gold-bright);
  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(240, 207, 134, 0.2),
      rgba(128, 91, 35, 0.08)
    );

  font-family: Georgia, serif;
  font-size: 16px;
}

.main-content {
  padding: 14px 20px calc(var(--navigation-height) + 44px);
}

.welcome-section {
  padding: 24px 2px 24px;
}

.eyebrow,
.section-kicker,
.promise-label {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.welcome-section h1 {
  max-width: 410px;
  margin-top: 13px;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(35px, 9vw, 47px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.welcome-section h1 span {
  display: block;
  color: var(--gold-bright);
  font-style: italic;
}

.welcome-copy {
  max-width: 380px;
  margin-top: 18px;

  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

.hero-card {
  position: relative;
  overflow: hidden;

  border: 1px solid var(--surface-border);
  border-radius: var(--radius-large);

  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-glow {
  position: absolute;
  z-index: 1;
  top: -100px;
  right: -70px;

  width: 220px;
  height: 220px;

  border-radius: 50%;
  background: rgba(207, 157, 70, 0.12);
  filter: blur(40px);
  pointer-events: none;
}

.hero-image-wrap {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter:
    saturate(0.84)
    contrast(1.04)
    brightness(0.82);
}

.hero-overlay {
  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      180deg,
      transparent 40%,
      rgba(17, 17, 15, 0.56) 72%,
      var(--surface) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 2;

  margin-top: -24px;
  padding: 0 22px 24px;
}

.hero-icon {
  display: grid;
  place-items: center;

  width: 46px;
  height: 46px;

  margin-bottom: 16px;

  border: 1px solid rgba(211, 173, 100, 0.25);
  border-radius: 15px;

  color: var(--gold-bright);
  background: rgba(211, 173, 100, 0.08);
}

.hero-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.hero-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.hero-content p {
  margin-top: 10px;

  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  min-height: 56px;

  margin-top: 22px;
  padding: 0 19px;

  border-radius: 17px;

  color: #18130b;
  background:
    linear-gradient(
      135deg,
      #f3d28d,
      #c99c4d
    );

  box-shadow:
    0 12px 30px rgba(185, 131, 45, 0.18);

  font-size: 14px;
  font-weight: 750;

  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.primary-button:active {
  transform: scale(0.985);
  filter: brightness(0.94);
}

.primary-button svg {
  width: 20px;
  height: 20px;

  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.promise-card {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 16px;

  margin-top: 22px;
  padding: 22px;

  border: 1px solid rgba(211, 173, 100, 0.12);
  border-radius: var(--radius-medium);

  background:
    linear-gradient(
      135deg,
      rgba(211, 173, 100, 0.06),
      rgba(255, 255, 255, 0.015)
    );
}

.promise-line {
  border-radius: 99px;
  background:
    linear-gradient(
      180deg,
      var(--gold-bright),
      rgba(211, 173, 100, 0.1)
    );
}

.promise-card blockquote {
  margin-top: 9px;

  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-style: italic;
  line-height: 1.45;
}

.promise-card blockquote span {
  color: var(--gold-bright);
}

.recent-section {
  margin-top: 33px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin-top: 7px;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
}

.text-button {
  padding: 8px 0;

  color: var(--gold);
  background: transparent;

  font-size: 12px;
  font-weight: 650;
}

.recent-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;

  margin-top: 16px;
}

.project-card,
.new-project-card {
  min-height: 166px;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-medium);
}

.project-card-empty {
  display: grid;
  place-content: center;
  gap: 12px;

  padding: 20px;

  color: var(--text-muted);
  background: var(--surface);
  text-align: center;
}

.empty-project-icon {
  display: grid;
  place-items: center;

  width: 44px;
  height: 44px;

  margin: 0 auto;

  border-radius: 15px;

  color: var(--gold-dark);
  background: rgba(211, 173, 100, 0.06);
}

.empty-project-icon svg {
  width: 23px;
  height: 23px;

  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.project-card-empty p {
  max-width: 180px;

  font-size: 12px;
  line-height: 1.5;
}

.new-project-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;

  color: var(--gold);
  background:
    linear-gradient(
      145deg,
      rgba(211, 173, 100, 0.095),
      rgba(211, 173, 100, 0.025)
    );

  font-size: 12px;
  font-weight: 650;
}

.plus-icon {
  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;

  border: 1px solid rgba(211, 173, 100, 0.25);
  border-radius: 50%;

  font-size: 24px;
  font-weight: 300;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  margin-top: 25px;
  padding: 0 4px;

  color: var(--text-muted);
}

.privacy-note svg {
  flex: 0 0 auto;

  width: 17px;
  height: 17px;

  fill: none;
  stroke: var(--gold-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.privacy-note p {
  font-size: 11px;
  line-height: 1.55;
}

.bottom-navigation {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;

  display: grid;
  grid-template-columns: repeat(4, 1fr);

  width: min(100%, 520px);
  height: calc(var(--navigation-height) + var(--safe-bottom));

  margin: 0 auto;
  padding: 8px 10px calc(8px + var(--safe-bottom));

  border-top: 1px solid rgba(255, 255, 255, 0.07);

  background: rgba(12, 12, 11, 0.94);
  backdrop-filter: blur(24px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  border-radius: 16px;

  color: #77736b;
  background: transparent;

  font-size: 10px;

  transition:
    color 180ms ease,
    background 180ms ease;
}

.nav-item svg {
  width: 21px;
  height: 21px;

  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.nav-item.active {
  color: var(--gold-bright);
  background: rgba(211, 173, 100, 0.07);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: calc(var(--navigation-height) + 22px);
  left: 22px;

  max-width: 470px;
  margin: 0 auto;
  padding: 14px 17px;

  border: 1px solid rgba(211, 173, 100, 0.2);
  border-radius: 15px;

  color: var(--cream);
  background: rgba(28, 27, 23, 0.96);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);

  font-size: 12px;
  line-height: 1.45;

  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);

  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 521px) {
  body {
    padding: 16px 0;
  }

  .app-shell {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
  }

  .bottom-navigation {
    bottom: 16px;
    border-radius: 0 0 28px 28px;
  }
}

/* =====================================================
   PHOTO FINISHING WORKSPACE
===================================================== */

.enhance-screen {
  padding: 14px 20px calc(var(--navigation-height) + 44px);
}

.enhance-screen[hidden] {
  display: none;
}

.enhance-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 12px 0 25px;
}

.enhance-header h2 {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
}

.back-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(211, 173, 100, 0.2);
  border-radius: 15px;
  color: var(--gold-bright);
  background: rgba(211, 173, 100, 0.06);
  font-size: 21px;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 230px;
  padding: 25px;
  border: 1px dashed rgba(211, 173, 100, 0.42);
  border-radius: var(--radius-large);
  color: var(--cream);
  background:
    radial-gradient(
      circle at center,
      rgba(211, 173, 100, 0.09),
      transparent 68%
    ),
    var(--surface);
}

.upload-zone:active {
  transform: scale(0.985);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 5px;
  border: 1px solid rgba(211, 173, 100, 0.34);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(211, 173, 100, 0.08);
  font-size: 30px;
  font-weight: 300;
}

.upload-zone strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 400;
}

.upload-zone small {
  color: var(--text-muted);
  font-size: 11px;
}

.photo-workspace {
  margin-top: 18px;
}

.photo-workspace[hidden] {
  display: none;
}

.preview-frame {
  overflow: hidden;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-frame img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #050505;
}

.finish-options {
  margin-top: 25px;
}

.finish-label {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 13px;
}

.preset-button {
  min-height: 94px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 17px;
  color: var(--text);
  background: var(--surface);
  text-align: left;
}

.preset-button strong,
.preset-button small {
  display: block;
}

.preset-button strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
}

.preset-button small {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.4;
}

.preset-button.active {
  border-color: rgba(240, 207, 134, 0.55);
  background:
    linear-gradient(
      145deg,
      rgba(211, 173, 100, 0.16),
      rgba(211, 173, 100, 0.035)
    );
  box-shadow: 0 10px 26px rgba(177, 125, 42, 0.12);
}

.preservation-note {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid rgba(211, 173, 100, 0.12);
  border-radius: 15px;
  color: var(--text-soft);
  background: rgba(211, 173, 100, 0.045);
  font-size: 11px;
  line-height: 1.6;
}

/* =====================================================
   BEFORE / AFTER RESULT
===================================================== */

.result-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(211, 173, 100, 0.14);
}

.result-section[hidden],
.library-screen[hidden] {
  display: none;
}

.result-heading h2,
.library-header h2 {
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 400;
}

.comparison-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 19px;
  border: 1px solid rgba(211, 173, 100, 0.22);
  border-radius: var(--radius-large);
  background: #050505;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.comparison-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 610px;
  object-fit: contain;
  background: #050505;
}

.before-image-layer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
}

.before-image-layer .comparison-image {
  width: 100vw;
  max-width: 480px;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.comparison-divider {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
  pointer-events: none;
}

.comparison-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(240, 207, 134, 0.55);
  border-radius: 50%;
  color: #20160a;
  background: var(--gold-bright);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
}

.comparison-slider {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.comparison-label {
  position: absolute;
  z-index: 5;
  top: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  color: white;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.comparison-label-before {
  left: 13px;
}

.comparison-label-after {
  right: 13px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 18px;
}

.secondary-action-button {
  width: 100%;
  min-height: 53px;
  border: 1px solid rgba(211, 173, 100, 0.28);
  border-radius: 17px;
  color: var(--gold-bright);
  background: rgba(211, 173, 100, 0.07);
  font-weight: 650;
}

.text-action-button {
  padding: 14px;
  color: var(--text-soft);
  background: transparent;
  font-size: 12px;
}

/* =====================================================
   LIBRARY
===================================================== */

.library-screen {
  min-height: 100vh;
  padding: 14px 20px calc(var(--navigation-height) + 44px);
}

.library-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 12px 0 25px;
}

.library-empty-state {
  display: grid;
  place-items: center;
  min-height: 310px;
  padding: 30px;
  border: 1px dashed rgba(211, 173, 100, 0.24);
  border-radius: var(--radius-large);
  color: var(--text-muted);
  background: var(--surface);
  text-align: center;
}

.library-empty-state span {
  color: var(--gold);
  font-size: 40px;
}

.library-empty-state h3 {
  margin-top: 14px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.library-empty-state p {
  max-width: 280px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
}

.library-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.library-card {
  overflow: hidden;
  border: 1px solid rgba(211, 173, 100, 0.16);
  border-radius: 19px;
  background: var(--surface);
}

.library-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #050505;
}

.library-card-info {
  padding: 12px;
}

.library-card-info strong {
  display: block;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 400;
}

.library-card-info small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 9px;
}

.library-card-actions {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.library-card-actions button {
  flex: 1;
  min-height: 34px;
  padding: 6px;
  border-radius: 10px;
  color: var(--gold);
  background: rgba(211, 173, 100, 0.08);
  font-size: 9px;
}