:root {
  color-scheme: light;
  --ink: #183b31;
  --ink-soft: #41645a;
  --paper: #f3efe7;
  --card: #fffdf8;
  --line: #d9d4c9;
  --lime: #d9f45d;
  --lime-dark: #bbdc26;
  --coral: #ff866e;
  --shadow: 0 26px 70px rgba(24, 59, 49, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 17%, rgba(217, 244, 93, 0.35), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  border-bottom: 1px solid rgba(24, 59, 49, 0.18);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
}

.brand-mark svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.header-note {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 0.75fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: center;
  min-height: 710px;
  padding: 72px 0 88px;
}

.eyebrow {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 25px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow span {
  width: 23px;
  height: 3px;
  background: var(--coral);
}

h1 {
  margin: 0;
  max-width: 690px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 6.4vw, 94px);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.93;
}

.lead {
  max-width: 540px;
  margin: 30px 0 46px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.6;
}

.legend {
  display: flex;
  gap: 24px;
  align-items: stretch;
  max-width: 470px;
}

.legend-code {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(24, 59, 49, 0.16);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.65);
}

.legend-code span {
  display: grid;
  width: 52px;
  height: 100%;
  min-height: 128px;
  place-items: center;
  border-right: 1px solid rgba(24, 59, 49, 0.13);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
}

.legend-code span:first-child {
  background: var(--ink);
  color: var(--lime);
}

.legend-code span:last-child {
  border-right: 0;
}

.legend-items {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.legend-items p {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(24, 59, 49, 0.13);
}

.legend-items p:last-child {
  border-bottom: 0;
}

.legend-items b {
  min-width: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.legend-items span {
  color: var(--ink-soft);
  font-size: 13px;
}

.card-wrap {
  position: relative;
}

.converter-card {
  position: relative;
  z-index: 2;
  padding: 38px;
  border: 1px solid rgba(24, 59, 49, 0.1);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
}

.decorative-code {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  transform: rotate(-8deg);
}

.decorative-code-one {
  top: -51px;
  right: -34px;
  width: 112px;
  height: 72px;
  border-radius: 17px;
  background: var(--lime);
  font-size: 29px;
}

.decorative-code-two {
  right: -45px;
  bottom: -34px;
  width: 98px;
  height: 66px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--coral);
  font-size: 25px;
  transform: rotate(9deg);
}

.card-heading {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.step-number {
  display: grid;
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.card-heading h2 {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.card-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.input-shell,
.select-shell {
  position: relative;
}

input,
select {
  width: 100%;
  height: 58px;
  border: 1px solid #ccc8be;
  border-radius: 12px;
  outline: 0;
  background: #fffefb;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input {
  padding: 0 150px 0 17px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

select {
  appearance: none;
  padding: 0 44px 0 15px;
  cursor: pointer;
  font-weight: 650;
}

.select-shell::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

input:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(217, 244, 93, 0.55);
}

.input-shell.has-error input {
  border-color: #d64935;
  box-shadow: 0 0 0 3px rgba(255, 134, 110, 0.2);
}

.input-example {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #80948e;
  font-size: 12px;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-hint,
.field-error {
  margin: 7px 0 0;
  color: #718781;
  font-size: 11px;
}

.field-error {
  display: none;
  color: #b72e1d;
  font-weight: 650;
}

.field-error:not(:empty) {
  display: block;
}

.date-fields {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
}

.submit-button {
  display: flex;
  width: 100%;
  height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 0 21px 0 24px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.submit-button:hover {
  background: #0f3027;
  box-shadow: 0 9px 24px rgba(24, 59, 49, 0.2);
  transform: translateY(-2px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button svg {
  width: 24px;
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.result {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #c3dd50;
  border-radius: 14px;
  background: #f1f9cb;
}

.result[hidden] {
  display: none;
}

.result.is-empty {
  border-color: #eaa495;
  background: #fff0eb;
}

.result-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--lime);
}

.is-empty .result-icon {
  background: #7c3025;
  color: #ffd7ce;
}

.result-icon svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.result-label {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.result-date {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.2;
}

.result-meta {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.calendar-section {
  padding: 86px 0 96px;
  border-top: 1px solid rgba(24, 59, 49, 0.18);
}

.calendar-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: end;
  margin-bottom: 42px;
}

.calendar-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.96;
}

.calendar-caption {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 3px;
}

.calendar-caption > p {
  max-width: 320px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.calendar-navigation {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 252px;
  height: 48px;
  border: 1px solid rgba(24, 59, 49, 0.22);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.6);
}

.calendar-navigation button {
  display: grid;
  width: 46px;
  height: 100%;
  flex: 0 0 46px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.calendar-navigation button:hover {
  background: var(--lime);
}

.calendar-navigation button:focus-visible {
  z-index: 1;
  outline: 3px solid var(--coral);
  outline-offset: -3px;
}

.calendar-navigation svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.calendar-navigation strong {
  display: grid;
  min-width: 158px;
  height: 100%;
  flex: 1;
  place-items: center;
  border-right: 1px solid rgba(24, 59, 49, 0.13);
  border-left: 1px solid rgba(24, 59, 49, 0.13);
  font-size: 13px;
  text-transform: capitalize;
}

.calendar-card {
  overflow: hidden;
  border: 1px solid rgba(24, 59, 49, 0.18);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 18px 55px rgba(24, 59, 49, 0.09);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  border-bottom: 1px solid rgba(24, 59, 49, 0.16);
  background: var(--ink);
  color: white;
}

.calendar-weekdays span {
  display: grid;
  height: 58px;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.calendar-weekdays span:last-child {
  border-right: 0;
}

.calendar-weekdays b {
  display: none;
}

.calendar-weekdays i {
  color: #efffc0;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day,
.calendar-blank {
  position: relative;
  min-height: 116px;
  border-right: 1px solid rgba(24, 59, 49, 0.13);
  border-bottom: 1px solid rgba(24, 59, 49, 0.13);
}

.calendar-day:nth-child(7n),
.calendar-blank:nth-child(7n) {
  border-right: 0;
}

.calendar-grid > :nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-blank {
  background:
    linear-gradient(135deg, transparent 46%, rgba(24, 59, 49, 0.025) 46%, rgba(24, 59, 49, 0.025) 54%, transparent 54%),
    #f5f2eb;
  background-size: 10px 10px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  background: #fffdf8;
  transition: background 150ms ease;
}

.calendar-day:hover {
  background: #f5fadf;
}

.calendar-day.is-today::after {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.calendar-day.is-result {
  z-index: 1;
  background: var(--lime);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.calendar-date-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
}

.calendar-code {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 7px;
  background: #e9e5dc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.calendar-day:nth-child(7n) .calendar-code,
.calendar-day:nth-child(7n - 1) .calendar-code {
  background: #ffd9d1;
}

.calendar-day.is-result .calendar-code {
  background: var(--ink);
  color: var(--lime);
}

.calendar-footnote {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 17px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.calendar-footnote span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.how-it-works {
  display: grid;
  grid-template-columns: 0.7fr 1.7fr;
  gap: 72px;
  padding: 76px 0;
  border-top: 1px solid rgba(24, 59, 49, 0.18);
}

.how-it-works h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}

.rules-grid article {
  padding-top: 16px;
  border-top: 3px solid var(--ink);
}

.rules-grid article:nth-child(2) {
  border-color: var(--coral);
}

.rules-grid article:nth-child(3) {
  border-color: var(--lime-dark);
}

.rule-index {
  color: #789086;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}

.rules-grid h3 {
  margin: 20px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 400;
}

.rules-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 27px 0 35px;
  border-top: 1px solid rgba(24, 59, 49, 0.18);
  color: var(--ink-soft);
  font-size: 12px;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 70px 0 95px;
  }

  .intro {
    max-width: 730px;
  }

  .card-wrap {
    width: min(100%, 600px);
    margin: 0 auto;
  }

  .how-it-works {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .calendar-heading {
    grid-template-columns: 1fr;
    gap: 35px;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 30px, 1180px);
  }

  .site-header {
    min-height: 78px;
  }

  .header-note {
    display: none;
  }

  .hero {
    gap: 66px;
    padding: 50px 0 80px;
  }

  h1 {
    font-size: clamp(49px, 15vw, 68px);
  }

  .lead {
    margin: 25px 0 36px;
    font-size: 16px;
  }

  .legend {
    gap: 14px;
  }

  .legend-code span {
    width: 42px;
  }

  .legend-items span {
    font-size: 11px;
  }

  .converter-card {
    padding: 27px 20px 22px;
    border-radius: 22px;
  }

  .decorative-code-one {
    right: 6px;
  }

  .decorative-code-two {
    right: 5px;
  }

  .date-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .calendar-section {
    padding: 66px 0 75px;
  }

  .calendar-caption {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-navigation {
    width: 100%;
  }

  .calendar-weekdays span {
    height: 44px;
  }

  .calendar-weekdays i {
    display: none;
  }

  .calendar-weekdays b {
    display: block;
    color: #efffc0;
    font-size: 11px;
  }

  .calendar-day,
  .calendar-blank {
    min-height: 79px;
  }

  .calendar-day {
    padding: 9px 7px;
  }

  .calendar-date-number {
    font-size: 20px;
  }

  .calendar-code {
    padding: 4px 5px;
    font-size: 9px;
  }

  .calendar-day.is-today::after {
    top: 8px;
    right: 7px;
    width: 5px;
    height: 5px;
  }

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

  .how-it-works {
    padding: 64px 0;
  }

  footer {
    gap: 12px;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
