:root {
  --ink: #21170f;
  --oxblood: #0147d7;
  --line: rgba(33, 23, 15, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Lora", Georgia, serif;
  background: linear-gradient(180deg, rgba(255,250,247,1) 18%, rgba(254,254,254,1) 37%, rgba(244,244,244,1) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(40, 22, 8, 0.18)),
    repeating-linear-gradient(90deg, rgba(86, 55, 24, 0.08) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease, opacity 180ms ease;
}

a:hover,
a:focus-visible {
  border-color: var(--oxblood);
  opacity: 0.86;
  outline: none;
}

.footer {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(33, 23, 15, 0.78);
}

/* Home page */
body.home .page {
  padding: 34px clamp(18px, 4vw, 58px);
}

.hero {
  display: grid;
  min-height: calc(100vh - 122px);
  place-items: center;
  padding: clamp(42px, 8vw, 86px) 0;
  text-align: center;
}

.hero-inner {
  width: min(980px, 100%);
}

.brand-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: min(78vw, 520px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  perspective: 900px;
  isolation: isolate;
}

.brand-wrap::before,
.brand-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: -1;
}

.brand-wrap::after {
  inset: 8%;
  border-top: 1px dashed rgba(33, 23, 15, 0.38);
  animation: reverseTurn 36s linear infinite;
}

.brand {
  margin: 0;
  font-size: clamp(3.9rem, 14vw, 9.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 245, 214, 0.55), 0 18px 38px rgba(57, 34, 12, 0.22);
  animation: brandTurn 13s cubic-bezier(0.62, 0.01, 0.24, 1) infinite;
  transform-style: preserve-3d;
}

.subtitle {
  color: #0147d7;
  max-width: 650px;
  margin: 30px auto 0;
  font-size: clamp(1.28rem, 3vw, 2rem);
  line-height: 1.35;
  animation: fadeUp 900ms ease 330ms both;
}

.rule {
  width: min(520px, 76vw);
  height: 1px;
  margin: 34px auto 0;
  background: linear-gradient(90deg, transparent, rgba(33, 23, 15, 0.58), transparent);
  animation: growLine 900ms ease 500ms both;
}

body.home .footer {
  display: flex;
  justify-content: center;
  padding: 28px 0 10px;
}

/* About page */
body.about .page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
}

h1 {
  margin: 12px 0 0;
  font-size: clamp(2.1rem, 6vw, 4rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--oxblood);
}

.lead {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 1.7rem);
  line-height: 1.45;
  max-width: 52ch;
  text-wrap: balance;
}

.card {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  display: grid;
  gap: 16px;
}

.card p {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.55;
  max-width: 62ch;
}

.year {
  letter-spacing: 0.08em;
  color: var(--oxblood);
  font-weight: 700;
}

body.about .footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@keyframes brandTurn {
  0%, 100% {
    transform: rotateY(0deg) rotateX(0deg);
  }
  42% {
    transform: rotateY(360deg) rotateX(0deg);
  }
  64% {
    transform: rotateY(360deg) rotateX(8deg);
  }
}

@keyframes reverseTurn {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes growLine {
  from {
    opacity: 0;
    transform: scaleX(0.2);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  body.home .page {
    padding: 24px 18px;
  }

  .brand-wrap {
    width: min(88vw, 390px);
  }

  .top {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }
}
