*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --sand:  #f0ece2;
  --sand2: #e6e1d5;
  --sand3: #cdc8b8;
  --ink:   #1c1b17;
  --ink2:  #6b6860;
  --terra: #bf6142;
  --white: #faf9f5;
}



html, body { height: 100%; }
body {
  background: var(--sand);
  color: var(--ink);
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 56px;
  border-bottom: 1px solid var(--sand3);
}
.logo {
  font-family: 'Instrument Serif', serif;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}





.logo i { color: var(--terra); font-style: italic; }
.nav-right { display: flex; align-items: center; gap: 0.1rem; }
.nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  color: var(--ink2);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  letter-spacing: 0.04em;
  transition: background 0.14s, color 0.14s;
}




.nav-link:hover { background: var(--sand2); color: var(--ink); }
.nav-cta {
  font-family: 'Geist Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--white);
  background: var(--ink);
  text-decoration: none;
  padding: 0.38rem 0.9rem;
  border-radius: 6px;
  letter-spacing: 0.04em;
  margin-left: 0.3rem;
  transition: background 0.14s;
}
.nav-cta:hover { background: var(--terra); }
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 3rem;
}
.tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  color: var(--terra);
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}
h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--ink);
  margin-bottom: 1rem;
}



h1 em { font-style: italic; color: var(--terra); }
.sub {
  font-size: 0.87rem;
  font-weight: 300;
  color: var(--ink2);
  text-align: center;
  line-height: 1.7;
  max-width: 320px;
  margin-bottom: 3.2rem;
}


.input-wrap {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}


.url-field {
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 52px;
  gap: 0.7rem;
}


.field-icon { color: var(--sand3); flex-shrink: 0; transition: color 0.15s; }
.field-icon svg { display: block; }
.url-field:focus-within .field-icon { color: var(--terra); }
.url-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Geist', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--ink);
}


.url-field input::placeholder { color: var(--sand3); }


.paste-btn {
  font-family: 'Geist Mono', monospace;
  font-size: 0.63rem;
  font-weight: 500;
  color: var(--ink2);
  background: var(--sand2);
  border: none;
  border-radius: 5px;
  padding: 0.28rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  transition: background 0.13s, color 0.13s;
}


.paste-btn:hover { background: var(--sand3); color: var(--ink); }
.toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--sand2);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}


.toggle-opt {
  border: none;
  background: transparent;
  border-radius: 6px;
  height: 38px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.14s, color 0.14s;
}


.toggle-opt:hover { color: var(--ink); }
.toggle-opt.on { background: var(--white); color: var(--ink); }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sand3);
  transition: background 0.14s;
  flex-shrink: 0;
}



.toggle-opt.on .dot { background: var(--terra); }
.dl {


  height: 52px;
  width: 100%;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: background 0.17s;
}




.dl:hover { background: var(--terra); }
.dl:active { transform: scale(0.99); }
.status {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  color: var(--ink2);
  letter-spacing: 0.04em;
  text-align: center;
  height: 1rem;
  margin-top: 0.2rem;
}
.status.err { color: var(--terra); }
.status.ok  { color: #4d8c5e; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  max-width: 400px;
  margin-top: 2.8rem;
}



.chip {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--ink2);
  background: var(--sand2);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
}
footer {
  border-top: 1px solid var(--sand3);
  padding: 0 2.5rem;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


.foot-left {
  font-family: 'Geist Mono', monospace;
  font-size: 0.63rem;
  color: var(--ink2);
  letter-spacing: 0.04em;
}



.foot-left b { color: var(--ink); font-weight: 500; }
.foot-links { display: flex; align-items: center; gap: 1.4rem; }
.foot-links a {
  font-family: 'Geist Mono', monospace;
  font-size: 0.63rem;
  color: var(--ink2);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.13s;
}
.foot-links a:hover { color: var(--terra); }




.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(28, 27, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--sand2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  color: var(--ink);
  margin: 0;
}


.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink2);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.14s, color 0.14s;
}

.modal-close:hover {
  background: var(--sand2);
  color: var(--ink);
}

.modal-body {
  padding: 1.5rem;
}

.modal-gif {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}




.modal-content h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--ink2);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}



.modal-btn {
  flex: 1;
  min-width: 120px;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.17s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}




.modal-btn.primary {
  background: var(--ink);
  color: var(--white);
}

.modal-btn.primary:hover {
  background: var(--terra);
}

.modal-btn.secondary {
  background: var(--sand2);
  color: var(--ink);
}

.modal-btn.secondary:hover {
  background: var(--sand3);
}

.modal-btn:active {
  transform: scale(0.98);
}



@media (max-width: 560px) {
  nav { padding: 0 1.2rem; }
  .nav-link { display: none; }
  footer { padding: 0 1.2rem; flex-direction: column; height: auto; padding-top: 0.9rem; padding-bottom: 0.9rem; gap: 0.5rem; }
  
  .modal {
    width: 95%;
    margin: 1rem;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-gif {
    max-height: 200px;
  }
  
  .modal-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .modal-btn {
    width: 100%;
    min-width: auto;
    height: 48px;
    font-size: 0.75rem;
    padding: 0 1.5rem;
  }
  
  .modal-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 380px) {
  .modal {
    width: 98%;
    margin: 0.5rem;
  }
  
  .modal-header {
    padding: 0.75rem;
  }
  
  .modal-body {
    padding: 0.75rem;
  }
  
  .modal-title {
    font-size: 1.25rem;
  }
  
  .modal-btn {
    height: 52px;
    font-size: 0.8rem;
  }
}

/* Download Page Styles */
.download-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.video-info-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--sand2);
}

.video-preview-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

.video-thumbnail-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--sand2);
}

.video-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
}

.video-thumbnail-wrapper:hover .video-preview-overlay {
  opacity: 1;
}

.play-button {
  width: 60px;
  height: 60px;
  background: var(--terra);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  transition: transform 0.2s, background 0.2s;
}

.play-button:hover {
  transform: scale(1.1);
  background: var(--ink);
}

.video-details {
  padding: 0.5rem 0;
}

.video-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.8rem;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.video-meta {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink2);
  font-size: 0.95rem;
}

.meta-item i {
  width: 20px;
  text-align: center;
  color: var(--terra);
}

.video-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--terra);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.video-type-badge.audio {
  background: #e74c3c;
}

.video-type-badge.video {
  background: #3498db;
}

.download-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: white;
  min-height: 56px;
}

.download-btn.primary {
  background: var(--ink);
}

.download-btn.primary:hover {
  background: var(--terra);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(191, 97, 66, 0.3);
}

.download-btn.secondary {
  background: var(--sand2);
  color: var(--ink);
}

.download-btn.secondary:hover {
  background: var(--sand3);
  transform: translateY(-2px);
}

.download-btn i {
  font-size: 1.1rem;
}

.preview-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--sand);
  border-radius: 12px;
  border: 1px solid var(--sand2);
}

.preview-container video,
.preview-container audio {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  background: var(--white);
}

.preview-title {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  color: var(--ink2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-title i {
  color: var(--terra);
}

@media (max-width: 768px) {
  .video-preview-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .video-thumbnail-wrapper {
    max-width: 400px;
    margin: 0 auto;
  }
  
  .video-title {
    font-size: 1.4rem;
  }
  
  .download-actions {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .video-info-card {
    padding: 1.5rem;
  }
  
  .video-title {
    font-size: 1.2rem;
  }
  
  .download-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.8rem;
  }
}
