:root {
  color-scheme: light dark;
  --background: #f4f1eb;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #18201e;
  --muted: #63706c;
  --accent: #087f70;
  --border: rgba(24, 32, 30, 0.11);
  --shadow: 0 24px 70px rgba(24, 32, 30, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101513;
    --surface: rgba(28, 36, 33, 0.82);
    --text: #eef4f1;
    --muted: #a8b5b0;
    --accent: #62d6c2;
    --border: rgba(238, 244, 241, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  line-height: 1.55;
  background: var(--background);
  color: var(--text);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(43, 183, 160, 0.16), transparent 34rem),
    var(--background);
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

.shell {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 72px;
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-links,
.language-links {
  display: flex;
  gap: 18px;
  font-size: 0.92rem;
}

.nav-links a,
.language-links a {
  color: var(--muted);
  text-decoration: none;
}

header {
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.8rem);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.lede {
  max-width: 630px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
}

.card,
article {
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.card {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.card h2 {
  margin-top: 0;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
}

article + article {
  margin-top: 28px;
}

h2 {
  margin: 1.8em 0 0.45em;
  font-size: 1.38rem;
  letter-spacing: -0.025em;
}

article h2:first-child {
  margin-top: 0;
}

p,
li {
  max-width: 68ch;
}

li + li {
  margin-top: 0.45em;
}

.meta,
footer {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice {
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 4px 14px 14px 4px;
  background: rgba(43, 183, 160, 0.1);
}

.button {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #071a16;
  font-weight: 700;
  text-decoration: none;
}

footer {
  margin-top: 36px;
  text-align: center;
}


/* The landing page's three steps: numbered, unboxed, so the cards below
   remain the only thing on the page asking to be clicked. */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 46px;
}

.step h2 {
  margin: 0 0 0.35em;
  font-size: 1.15rem;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 6px;
}

.feature h3 {
  margin: 0 0 0.35em;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.store-note {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

section + section,
section + article {
  margin-top: 28px;
}

/* Prices. The founders plan is marked because it is the one that goes away. */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.plan {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
}

.plan.featured {
  border-color: var(--accent);
  background: rgba(43, 183, 160, 0.08);
}

.plan p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.plan-name {
  color: var(--accent) !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-price {
  margin: 8px 0 10px !important;
  color: var(--text) !important;
  font-size: 1.6rem !important;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.plan-price span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
}

article h3 {
  margin: 1.5em 0 0.3em;
  font-size: 1.02rem;
}

@media (max-width: 620px) {
  nav {
    align-items: flex-start;
    margin-bottom: 52px;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Screenshots. Three abreast on a desktop, a swipeable row on a phone: a
   stack of full-height phone pictures pushes everything else off the page. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 34px;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.gallery figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 620px) {
  .gallery {
    grid-auto-columns: 74%;
    grid-auto-flow: column;
    grid-template-columns: none;
    margin-right: -18px;
    overflow-x: auto;
    padding-right: 18px;
    scroll-snap-type: x mandatory;
  }

  .gallery figure {
    scroll-snap-align: start;
  }
}

/* The Schengen calculator: the trips, then the answer under them. Side by
   side, a column this narrow cut the dates short. */
.calc {
  display: grid;
  gap: 18px;
}

.calc article + article {
  margin-top: 0;
}

.trip-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.trip-row {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  gap: 10px;
  align-items: end;
  max-width: 520px;
}

.trip-row label,
.check-date {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.check-date {
  max-width: 244px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.check-date span {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

/* iOS gives a date field a width of its own until its native look is
   turned off, and two of them then overlap in a phone-width row. */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.trip-remove {
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.trip-remove:hover {
  background: var(--border);
}

.button-quiet {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.calc-empty {
  margin: 0;
  color: var(--muted);
}

.calc-figure p {
  margin: 0;
}

.calc-number {
  font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 760;
  letter-spacing: -0.05em;
  line-height: 1;
}

.calc-caption {
  margin-top: 6px !important;
  color: var(--muted);
  font-size: 0.92rem;
}

.calc-left {
  margin-top: 14px !important;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
}

.calc-figure.over .calc-number,
.calc-figure.over .calc-left,
.calc-warning {
  color: #c2410c;
}

/* The 180 days as six rows of thirty, oldest first. */
.window-strip {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 3px;
  max-width: 520px;
  margin: 22px 0 8px;
}

.cell {
  display: inline-block;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--border);
}

.cell.used {
  background: var(--accent);
}

.cell.today {
  outline: 2px solid var(--text);
  outline-offset: 0;
}

.strip-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.strip-legend .cell {
  width: 10px;
}

.strip-legend .cell + * {
  margin-right: 10px;
}

@media (max-width: 720px) {
  .trip-row {
    grid-template-columns: 1fr 1fr 32px;
    gap: 8px;
  }
}

/* The app's screenshots under the calculator, below the button that sells it. */
.app-shots {
  margin: 30px 0 0;
}

/* The other calculators: a rule to pick, and for "my own" the numbers. */
.rule-picker {
  display: grid;
  gap: 4px;
  max-width: 420px;
  margin: 0 0 22px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rule-picker span,
.rule-custom span {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.rule-picker select,
.rule-custom input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.rule-picker select {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.rule-custom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 520px;
  margin: -8px 0 22px;
}

.rule-custom[hidden] {
  display: none;
}

.rule-custom label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.rule-custom span {
  font-size: 0.85rem;
}

.cell.ahead:not(.used) {
  opacity: 0.45;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: 0.95rem;
}

.rules-table th,
.rules-table td {
  padding: 9px 10px 9px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.rules-table th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related li + li {
  margin-top: 0;
}

@media (max-width: 720px) {
  .rule-custom {
    grid-template-columns: 1fr;
  }
}

/* Language switch. The pages written in both languages show one at a time (lang.js); the calculators are
   one page per language, and their switch is a pair of links. */
html.l-en [data-only="ru"],
html.l-ru [data-only="en"] { display: none !important; }
html:not(.l-en):not(.l-ru):not([data-fixed]) .lang-switch { display: none; }

.nav-links { align-items: center; }

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
}

.lang-switch button,
.nav-links .lang-switch a {
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.lang-switch [aria-pressed="true"],
.nav-links .lang-switch [aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .lang-switch [aria-pressed="true"],
  .nav-links .lang-switch [aria-current="page"] { color: #101513; }
}
