/* || RESET */

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

/* || VARIABLES */

:root {
  /* COLOR PALETTE */
  --color-bg: #F4F1FF;
  --color-surface: #FFFFFF;
  --color-ink: #1E1B2E;
  --color-steel: #6D6580;
  --color-violet: #7C3AED;
  --color-orange: #F97316;
  --color-border: #E4DFF7;
  --color-border-strong: #C4B5F5;
  --color-error: #DC2626;
  --gradient-accent: linear-gradient(90deg, #7C3AED, #F97316);

  /* TYPOGRAPHY */
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-data: 'IBM Plex Mono', monospace;

  /* LIGHT SKEUOMORPHISM */
  --shadow-card: 0 1px 2px rgba(124, 58, 237, 0.05), 0 8px 20px rgba(124, 58, 237, 0.08);
  --shadow-card-hover: 0 2px 4px rgba(124, 58, 237, 0.06), 0 14px 28px rgba(124, 58, 237, 0.12);
  --shadow-inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* || UTILITY CLASSES */

.none {
  display: none;
}

.block {
  display: block;
}

/* || BASE STYLES */

html {
  font-size: 100%;
  font-family: var(--font-body);
  color: var(--color-ink);
  line-height: 1.5;
}

body {
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

header,
main {
  position: relative;
  z-index: 2;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 720px;
}

/* || SITE HEADER */

.site-header {
  width: 100%;
  max-width: 720px;
  padding: 0.5rem 0 0;
}

.site-header__wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--color-ink);
}

.site-header__wordmark-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* || HERO SECTION */

.hero {
  width: 100%;
  max-width: 560px;
  text-align: center;
  padding: 2rem 0 1rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-steel);
}

/* || TOOL WRAPPER */

.tool {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* || DROP ZONE */

.drop-zone {
  position: relative;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 200px;
  padding: 2rem 1.25rem;
  background-color: var(--color-surface);
  border-radius: 16px;
  border: 3px dashed var(--color-border-strong);
  text-align: center;
  box-shadow: var(--shadow-card), var(--shadow-inset-highlight);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.drop-zone:hover {
  box-shadow: var(--shadow-card-hover), var(--shadow-inset-highlight);
}

.drop-zone:active {
  transform: scale(0.99);
}

.drop-zone--active {
  border-color: var(--color-violet);
}

.drop-zone__icon {
  font-size: 2.5rem;
  color: var(--color-steel);
  transition: transform 0.25s ease, color 0.2s ease;
}

.drop-zone--active .drop-zone__icon {
  color: var(--color-violet);
  transform: scale(1.15) rotate(10deg);
}

.drop-zone__label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
}

.drop-zone__browse-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: #FFFFFF;
  background: var(--gradient-accent);
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.drop-zone__browse-btn:hover {
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.32);
}

.drop-zone__browse-btn:active {
  transform: scale(0.96);
}

.drop-zone__hint {
  font-family: var(--font-data);
  font-size: 0.7rem;
  color: var(--color-steel);
}

/* || RESULTS SECTION */

.results {
  background-color: var(--color-surface);
  margin: 1rem auto;
  padding: 0.75rem;
  border-radius: 16px;
  width: 100%;
  box-shadow: var(--shadow-card), var(--shadow-inset-highlight);
}

.results__list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.results__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.6rem;
  border-radius: 10px;
  background-color: var(--color-bg);
  transition: box-shadow 0.2s ease;
}

.results__item:hover {
  box-shadow: var(--shadow-card);
}

.results__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.results__title {
  font-family: var(--font-body);
  font-weight: 500;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.results__size {
  font-family: var(--font-data);
  font-size: 0.7rem;
  color: var(--color-steel);
  white-space: nowrap;
}

.results__progress {
  appearance: none;
  width: 100%;
  height: 26px;
  position: relative;
}

::-moz-progress-bar {
  background: var(--color-violet);
  border-radius: 15px;
}

::-webkit-progress-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 15px;
}

::-webkit-progress-value {
  background: var(--color-violet);
  border-radius: 15px;
}

.results__progress.finished::-webkit-progress-value,
.results__progress.finished::-moz-progress-bar {
  background: var(--color-orange);
}

.results__progress.error::-webkit-progress-value,
.results__progress.error::-moz-progress-bar {
  background: var(--color-error);
}

.results__progress.finished::before,
.results__progress.error::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-data);
  font-size: 0.65rem;
  color: var(--color-ink);
}

.results__progress.finished::before {
  content: "Finished";
}

.results__progress.error::before {
  content: "File Error";
}

.results__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.results__new-size {
  font-family: var(--font-data);
  font-size: 0.7rem;
  color: var(--color-ink);
  white-space: nowrap;
}

.results__download-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results__download {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-violet);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.results__download:hover {
  text-decoration: underline;
}

.results__download:active {
  opacity: 0.6;
}

.results__saved {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--color-orange);
  white-space: nowrap;
}

/* HOW IT WORKS SECTION */

.how-it-works {
  width: 100%;
  max-width: 720px;
  margin: 1.5rem 0 1rem;
}

.how-it-works__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.how-it-works__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  background-color: var(--color-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-card), var(--shadow-inset-highlight);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.how-it-works__item:hover {
  box-shadow: var(--shadow-card-hover), var(--shadow-inset-highlight);
  transform: translateY(-2px);
}

.how-it-works__icon {
  font-size: 1.25rem;
  color: var(--color-violet);
}

.how-it-works__step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-ink);
}

.how-it-works__step-desc {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--color-steel);
}

/* || MODAL */

.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 320px;
  width: 90%;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-card-hover);
}

.modal::backdrop {
  background-color: rgba(30, 27, 46, 0.5);
}

.modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.modal__message {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-ink);
}

.modal__button {
  font-family: var(--font-body);
  font-weight: 600;
  color: #FFFFFF;
  background: var(--gradient-accent);
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  cursor: pointer;
}

/* || MEDIA QUERIES */

@media only screen and (min-width: 480px) {
  .drop-zone__label {
    font-size: 1rem;
  }

  .results__item {
    flex-direction: row;
    align-items: center;
  }

  .results__info {
    flex-direction: column;
    align-items: flex-start;
    width: 30%;
  }

  .results__progress {
    width: 30%;
  }

  .results__meta {
    width: 40%;
  }
}

@media only screen and (min-width: 640px) {
  .results__title {
    max-width: 160px;
  }

  .how-it-works__list {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
  }

  .how-it-works__item--drop {
    grid-column: 1;
    grid-row: 1 / 3;
    padding: 2rem 1.5rem;
  }

  .how-it-works__item--drop .how-it-works__icon {
    font-size: 1.75rem;
  }

  .how-it-works__item--drop .how-it-works__step-title {
    font-size: 1.15rem;
  }

  .how-it-works__item--compress {
    grid-column: 2;
    grid-row: 1;
  }

  .how-it-works__item--download {
    grid-column: 2;
    grid-row: 2;
  }
}