/* ===========================================================
   Paperwork by Hayyat Apps
   © Hayyat Apps LLC. All rights reserved.
   Theme: Hayyat green (#1dbf73) + black
   =========================================================== */

:root {
  --hayyat-green: #1dbf73;
  --hayyat-green-dark: #149955;
  --hayyat-green-darker: #0f7a44;
  --hayyat-green-light: #d7f4e6;
  --hayyat-green-tint: #effaf4;

  --ink: #0a0a0a;
  --ink-soft: #1a1a1a;
  --paper: #ffffff;
  --cream: #fbfbfa;
  --muted: #6b6b6b;
  --border: #e5e5e5;
  --border-strong: #0a0a0a;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success-bg: #effaf4;

  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-md: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-green: 4px 4px 0 var(--hayyat-green);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(29, 191, 115, 0.12) 1px, transparent 0),
    linear-gradient(180deg, var(--hayyat-green-tint) 0%, var(--cream) 400px);
  background-size: 28px 28px, 100% 100%;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}

/* ============== Masthead ============== */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.brand-link { display: inline-flex; align-items: center; }
.brand-logo {
  height: 38px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
.product-wordmark { text-align: center; }
.product-name {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.product-dot { color: var(--hayyat-green); }
.product-by {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  margin-top: 4px;
}
.masthead-nav {
  display: flex;
  gap: 24px;
}
.masthead-nav a {
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.masthead-nav a:hover { color: var(--hayyat-green-dark); }
.masthead-nav a:hover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hayyat-green);
}

/* ============== Hero ============== */
.hero {
  padding: 32px 0 40px;
  max-width: 780px;
  margin: 0 auto 48px;
  text-align: center;
}
.hero-kicker {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 6px 14px;
  border: 1.5px solid var(--ink);
  background: var(--hayyat-green);
  color: var(--ink);
  margin-bottom: 24px;
  font-weight: 500;
}
.hero-title {
  font-family: 'Fraunces', serif;
  font-size: 64px;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
  color: var(--ink);
}
.hero-title em {
  font-style: italic;
  color: var(--hayyat-green-dark);
}
.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--hayyat-green);
  border-radius: 50%;
  display: inline-block;
}

/* ============== Tool picker ============== */
.tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 32px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.tool-btn {
  background: var(--paper);
  border: none;
  border-right: 2px solid var(--ink);
  padding: 24px 20px;
  text-align: left;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-btn:last-child { border-right: none; }
.tool-btn:hover:not(.active) {
  background: var(--hayyat-green-tint);
}
.tool-btn.active {
  background: var(--hayyat-green);
  color: var(--ink);
}
.tool-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--ink);
}
.tool-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 500;
}
.tool-btn.active .tool-num { color: var(--ink-soft); opacity: 0.8; }
.tool-name {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}
.tool-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.tool-btn.active .tool-desc { color: var(--ink); opacity: 0.85; }

/* ============== Panel ============== */
.panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: none;
  margin-bottom: 48px;
}
.panel.active { display: block; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
  gap: 16px;
}
.panel-title {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.panel-title em {
  font-style: italic;
  color: var(--hayyat-green-dark);
}
.panel-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  max-width: 560px;
  line-height: 1.6;
}
.panel-index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: right;
  color: var(--muted);
  flex-shrink: 0;
}
.panel-index span {
  display: block;
  font-size: 48px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
  color: var(--hayyat-green);
}

/* ============== Dropzone ============== */
.dropzone {
  border: 2px dashed var(--ink);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 24px;
  background: var(--cream);
  display: block;
}
.dropzone:hover, .dropzone.dragover {
  background: var(--hayyat-green-light);
  border-color: var(--hayyat-green-dark);
}
.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: block;
  color: var(--ink);
}
.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon { color: var(--hayyat-green-dark); }
.dropzone-text {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.dropzone-hint {
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
input[type="file"] { display: none; }

/* ============== File list ============== */
.filelist { margin-bottom: 24px; }
.filelist:empty { display: none; }
.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  background: var(--cream);
  margin-bottom: 8px;
  font-size: 14px;
}
.file-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  width: 24px;
  font-weight: 500;
}
.file-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}
.file-move { display: flex; gap: 4px; }
.file-move button, .file-remove {
  background: var(--paper);
  border: 1px solid var(--ink);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: var(--ink);
  padding: 0;
}
.file-move button:hover:not(:disabled) {
  background: var(--hayyat-green);
  border-color: var(--hayyat-green-dark);
}
.file-move button:disabled { opacity: 0.3; cursor: not-allowed; }
.file-remove { color: var(--danger); }
.file-remove:hover {
  background: var(--danger);
  color: var(--paper);
  border-color: var(--danger);
}

/* ============== Options / fields ============== */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}
.field input[type="text"],
.field select {
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--cream);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  border-radius: 0;
  outline: none;
  transition: box-shadow 0.1s, transform 0.1s, background 0.1s;
}
.field input[type="text"]:focus,
.field select:focus {
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--hayyat-green);
  transform: translate(-1px, -1px);
}

/* ============== Quality / Convert option grids ============== */
.quality-grid,
.convert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1.5px solid var(--ink);
  margin-bottom: 24px;
}
.quality-opt,
.convert-opt {
  padding: 18px 16px;
  border-right: 1.5px solid var(--ink);
  cursor: pointer;
  background: var(--cream);
  position: relative;
  transition: background 0.15s;
  display: block;
}
.quality-opt:last-child,
.convert-opt:last-child { border-right: none; }
.quality-opt:hover:not(.selected),
.convert-opt:hover:not(.selected) {
  background: var(--hayyat-green-tint);
}
.quality-opt input,
.convert-opt input { display: none; }
.quality-opt.selected,
.convert-opt.selected {
  background: var(--hayyat-green);
  color: var(--ink);
}
.convert-opt { text-align: center; }
.q-name {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
}
.c-name {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}
.q-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}
.quality-opt.selected .q-label { color: var(--ink-soft); opacity: 0.75; }
.q-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.quality-opt.selected .q-desc { color: var(--ink); opacity: 0.85; }
.c-desc {
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.convert-opt.selected .c-desc { color: var(--ink); opacity: 0.85; }

/* ============== Action row + button ============== */
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
  gap: 16px;
  flex-wrap: wrap;
}
.action-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 500;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 14px 28px;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  box-shadow: var(--shadow-green);
}
.btn-primary:hover:not(:disabled) {
  background: var(--hayyat-green-darker);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn-primary:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--hayyat-green);
}
.btn-primary:disabled {
  background: var(--muted);
  border-color: var(--muted);
  box-shadow: 4px 4px 0 var(--border);
  cursor: not-allowed;
  opacity: 0.8;
}

/* ============== Status ============== */
.status {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1.5px solid var(--ink);
  background: var(--cream);
  display: none;
  font-size: 14px;
  line-height: 1.5;
}
.status.show { display: block; }
.status.success {
  background: var(--success-bg);
  border-color: var(--hayyat-green-dark);
}
.status.error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #7f1d1d;
}
.status.working {
  background: var(--hayyat-green-light);
  border-color: var(--hayyat-green-dark);
}
.status-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--ink);
}
.progress-bar {
  margin-top: 12px;
  height: 8px;
  background: var(--paper);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--hayyat-green);
  width: 0%;
  transition: width 0.25s ease-out;
}

/* ============== Promo strip ============== */
.promo {
  background: var(--ink);
  color: var(--paper);
  padding: 40px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-green);
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
}
.promo-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--hayyat-green);
  margin-bottom: 12px;
  font-weight: 500;
}
.promo-title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.promo-sub {
  color: #cbcbcb;
  font-size: 15px;
  line-height: 1.6;
  max-width: 500px;
}
.promo-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.promo-btn {
  display: inline-block;
  padding: 14px 24px;
  background: var(--hayyat-green);
  color: var(--ink);
  border: 2px solid var(--hayyat-green);
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.15s, transform 0.1s;
}
.promo-btn:hover {
  background: var(--paper);
  border-color: var(--paper);
  transform: translate(-2px, -2px);
}
.promo-btn.secondary {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}
.promo-btn.secondary:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ============== Footer ============== */
.site-foot {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  padding-top: 40px;
  border-top: 2px solid var(--ink);
}
.foot-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: invert(1);
}
.foot-addr {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 16px;
}
.foot-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.foot-right {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.foot-col h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  margin-bottom: 12px;
  font-weight: 500;
}
.foot-col a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s;
}
.foot-col a:hover { color: var(--hayyat-green-dark); }

/* ============== License block ============== */
.license-block {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.license-block[hidden] { display: none !important; }
.license-card {
  background: var(--paper);
  border: 3px solid var(--hayyat-green);
  box-shadow: 8px 8px 0 var(--hayyat-green-dark);
  padding: 40px;
  max-width: 520px;
  text-align: center;
}
.license-mark {
  width: 64px;
  height: 64px;
  border: 3px solid var(--ink);
  background: var(--hayyat-green);
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 600;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.license-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.license-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 12px;
}
.license-meta {
  font-size: 13px !important;
  color: var(--muted) !important;
  margin-top: 20px !important;
}
.license-link {
  display: inline-block;
  margin: 16px 0 24px;
  padding: 12px 24px;
  background: var(--hayyat-green);
  color: var(--ink);
  border: 2px solid var(--ink);
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}
.license-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}
.license-fine {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted) !important;
  margin-top: 16px !important;
  line-height: 1.5;
}

/* ============== Responsive ============== */
@media (max-width: 900px) {
  .wrap { padding: 16px 20px 48px; }
  .masthead { justify-content: center; text-align: center; }
  .masthead-nav { width: 100%; justify-content: center; }
  .hero-title { font-size: 44px; }
  .hero-sub { font-size: 16px; }
  .tools { grid-template-columns: repeat(2, 1fr); box-shadow: var(--shadow-sm); }
  .tool-btn:nth-child(2) { border-right: none; }
  .tool-btn:nth-child(1), .tool-btn:nth-child(2) { border-bottom: 2px solid var(--ink); }
  .panel { padding: 24px; box-shadow: var(--shadow-md); }
  .panel-title { font-size: 28px; }
  .options,
  .quality-grid,
  .convert-grid { grid-template-columns: 1fr; }
  .quality-opt, .convert-opt { border-right: none; border-bottom: 1.5px solid var(--ink); }
  .quality-opt:last-child, .convert-opt:last-child { border-bottom: none; }
  .panel-index span { font-size: 36px; }
  .promo { grid-template-columns: 1fr; padding: 28px; }
  .promo-title { font-size: 24px; }
  .site-foot { grid-template-columns: 1fr; gap: 32px; }
  .foot-right { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (max-width: 520px) {
  .hero-title { font-size: 34px; }
  .masthead-nav { gap: 16px; font-size: 12px; }
  .foot-right { grid-template-columns: 1fr 1fr; }
  .action-row { flex-direction: column; align-items: stretch; }
  .btn-primary { width: 100%; }
}

/* ============== Print ============== */
@media print {
  body::before {
    content: "Paperwork by Hayyat Apps — hayyatapps.com";
    display: block;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
  }
  .tools, .promo, .site-foot { display: none; }
}

/* Subtle text selection accent */
::selection {
  background: var(--hayyat-green);
  color: var(--ink);
}
