*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

main {
  flex: 1 0 auto;
}

h1, h2, p {
  margin: 0;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  position: relative;
  height: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  font-size: 1.05rem;
  white-space: nowrap;
}

.logo-mark {
  display: block;
  height: 36px;
  width: auto;
}

.logo:hover {
  text-decoration: none;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.nav-burger {
  display: none;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

a.nav-link:hover {
  color: var(--link);
  background: color-mix(in srgb, var(--link) 10%, transparent);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--brand);
  font-weight: 650;
}

.nav-link.is-soon {
  color: color-mix(in srgb, var(--text) 45%, var(--bg));
}

.nav-group {
  position: relative;
}

.nav-group > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
}

.nav-group > .nav-link::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  margin-top: -0.15rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
}

.nav-group:hover > .nav-link::after,
.nav-group:focus-within > .nav-link::after {
  margin-top: 0.1rem;
  transform: rotate(225deg);
}

.nav-group.is-active > .nav-link {
  color: var(--brand);
  font-weight: 650;
}

.nav-sub {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  width: max-content;
  max-width: min(36rem, calc(100vw - 1.5rem));
  padding: 0.45rem;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(13.75rem, 16rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--text) 6%, transparent),
    0 16px 40px color-mix(in srgb, var(--text) 14%, transparent);
}

.nav-sub:has(> .nav-sublink:only-child) {
  grid-template-columns: minmax(14rem, 17rem);
}

.nav-sub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.45rem;
  height: 0.45rem;
}

.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub {
  display: grid;
}

.nav-sublink {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.nav-sublink-title {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.nav-sublink-note {
  font-size: 0.8rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--text) 62%, transparent);
}

.nav-sublink:hover,
.nav-sublink.is-active {
  background: var(--tint);
  text-decoration: none;
}

.nav-sublink:hover .nav-sublink-title,
.nav-sublink.is-active .nav-sublink-title {
  color: var(--brand);
}

.home,
.page {
  width: min(40rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.75rem 0 3.5rem;
}

.home h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.page h1 {
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.page p + p {
  margin-top: 0.75rem;
}

.privacy-line {
  margin-top: 0.85rem;
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--brand);
}

.dropzone {
  width: 100%;
  margin-top: 1.75rem;
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--brand);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.dropzone-title {
  font-weight: 600;
}

.dropzone-note {
  max-width: 22rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
  color: color-mix(in srgb, var(--text) 68%, transparent);
}

.dropzone:hover {
  background: var(--tint);
}

.dropzone.is-dragover,
.dropzone.is-busy {
  background: var(--tint-strong);
}

.dropzone:disabled {
  cursor: progress;
}

.dropzone-error {
  margin: 0.85rem 0 0;
  color: #b91c1c;
  font-weight: 650;
  line-height: 1.4;
}

[data-theme="dark"] .dropzone-error {
  color: #f87171;
}

@media (max-width: 720px) {
  .logo-mark {
    height: 28px;
  }

  .nav-toggle:focus-visible + .nav-burger {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 6px;
  }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    min-height: 2.25rem;
    padding: 0 0.35rem;
    color: var(--text);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
  }

  .nav-burger-bar,
  .nav-burger-bar::before,
  .nav-burger-bar::after {
    display: block;
    width: 1.05rem;
    height: 2px;
    background: var(--brand);
    position: relative;
    content: "";
  }

  .nav-burger-bar::before {
    position: absolute;
    top: -5px;
  }

  .nav-burger-bar::after {
    position: absolute;
    top: 5px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.35rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--tint);
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  .nav-link {
    padding: 0.65rem 0.75rem;
  }

  .nav-group > .nav-link::after,
  .nav-sub::before {
    display: none;
  }

  .nav-group:hover .nav-sub,
  .nav-group:focus-within .nav-sub,
  .nav-sub {
    position: static;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: auto;
    max-width: none;
    min-width: 0;
    gap: 0;
    padding: 0 0 0.25rem 0.85rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-sublink {
    display: block;
    flex: none;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0.45rem 0.75rem;
    background: transparent;
    border-radius: 6px;
  }

  .nav-sublink-note {
    display: none;
  }
}
