/* Berkshire DAO — static landing page
   Design source: Figma "Berkshire DAO" (node 71:165)
   Fonts: "Arcade Normal"/"Pixel Emulator" in the design → Press Start 2P substitute */

:root {
  --black: #000000;
  --green: #00e964;
  --green-dim: rgba(0, 233, 100, 0.1);
  --overlay-blue: rgba(9, 41, 66, 0.5);
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Inter", system-ui, sans-serif;
  --pad-page: 128px;
  --dur: 0.7s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--green);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 24px;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; }

/* ---------- Type ---------- */
.h-pixel {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 3.2vw, 32px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 1px;
}
.h-arcade {
  font-family: var(--font-pixel);
  font-size: clamp(18px, 2.6vw, 28px);
  font-weight: 400;
  line-height: 1.35;
}
.h-arcade-s {
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

/* ---------- Pixel corner treatments ---------- */
/* Notch: small black square that "cuts" a corner of a bordered card */
.notch {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--black);
  border: 0 solid var(--green);
}
.notch--tl { top: -1px; left: -1px; border-right-width: 1px; border-bottom-width: 1px; }
.notch--tr { top: -1px; right: -1px; border-left-width: 1px; border-bottom-width: 1px; }
.notch--bl { bottom: -1px; left: -1px; border-right-width: 1px; border-top-width: 1px; }
.notch--br { bottom: -1px; right: -1px; border-left-width: 1px; border-top-width: 1px; }

/* Image blocks: corners cut to page black via clip-path */
.pixel-corners-cut {
  clip-path: polygon(
    16px 0, calc(100% - 16px) 0, calc(100% - 16px) 16px, 100% 16px,
    100% calc(100% - 16px), calc(100% - 16px) calc(100% - 16px), calc(100% - 16px) 100%,
    16px 100%, 16px calc(100% - 16px), 0 calc(100% - 16px), 0 16px, 16px 16px
  );
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 64px;
  padding: 0 24px;
  font-family: var(--font-pixel);
  font-size: 12px;
  text-decoration: none;
  text-align: center;
  clip-path: polygon(
    8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px), 0 8px, 8px 8px
  );
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn--solid { background: var(--green); color: var(--black); }
.btn--ghost { background: var(--green-dim); color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.btn--small { height: 48px; width: 190px; }
.btn:hover { transform: translateY(-2px); filter: drop-shadow(0 0 12px rgba(0, 233, 100, 0.55)); }
.btn:active { transform: translateY(1px); filter: none; }
.btn--ghost:hover { background: rgba(0, 233, 100, 0.22); }

/* ---------- Sections ---------- */
.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  padding: var(--pad-page);
}
.section__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.section__sub {
  font-size: 20px;
  line-height: 28px;
  max-width: 800px;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  gap: 16px;
  padding: 16px;
  min-height: 696px;
}
.hero__block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 540px;
  flex-shrink: 0;
  padding: 32px;
  background: var(--black);
  border: 1px solid var(--green);
}
.hero__logo {
  display: flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  text-decoration: none;
}
.hero__logo-mark { width: 96px; height: 96px; }
.hero__logo-word { width: 278px; height: auto; aspect-ratio: 278 / 67; }
.hero__title {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero__headline {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 400;
  line-height: 1.5;
  min-height: 3em;
  text-shadow: 0 0 18px rgba(0, 233, 100, 0.45);
}
.hero__tagline {
  font-size: 18px;
  line-height: 30px;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.hero__tagline.is-waiting {
  opacity: 0;
  transform: translateY(10px);
}
.hero__tagline strong {
  font-weight: 500;
  color: #7dffb4;
}
.hero__chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--green);
  color: var(--black);
  font-family: var(--font-pixel);
  font-size: 13px;
  vertical-align: 2px;
  clip-path: polygon(
    4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px
  );
}
.hero__cursor {
  display: inline-block;
  width: 0.6em;
  height: 1em;
  margin-left: 2px;
  background: var(--green);
  vertical-align: text-bottom;
  animation: cursor-blink 1s steps(1) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }
.hero__content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.hero__buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}
.hero__buttons .btn { flex: 1; }

.hero__bg {
  position: relative;
  flex: 1;
  min-height: 400px;
  overflow: hidden;
}
.hero__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-drift 24s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-bg.png");
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
  filter: contrast(2.6) brightness(1.35) saturate(1.5);
  opacity: 0;
  pointer-events: none;
  animation:
    hero-drift 24s ease-in-out infinite alternate,
    glint 7s ease-in-out 2.5s infinite;
}
/* CRT scanline overlay */
.hero__scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0 3px,
    rgba(0, 0, 0, 0.18) 3px 4px
  );
  mix-blend-mode: multiply;
}

/* ---------- PSA ticker ---------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--green);
  border-bottom: 1px solid var(--green);
  background: var(--green-dim);
  padding: 12px 0;
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 32s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* ---------- What is Berkshire ---------- */
.what__cards {
  display: flex;
  gap: 24px;
  width: 100%;
  max-width: 1184px;
}
.card {
  position: relative;
  background: var(--green-dim);
  border: 1px solid var(--green);
}
.what__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  padding: 24px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}
.what__card:hover {
  transform: translateY(-6px);
  background: rgba(0, 233, 100, 0.16);
  box-shadow: 0 0 24px rgba(0, 233, 100, 0.25);
}
.what__card:hover .what__icon { transform: translateY(-4px) scale(1.08); }
.what__icon { width: 64px; height: 64px; transition: transform 0.25s var(--ease); }
.what__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- $GREED token ---------- */
.greed__heading {
  display: flex;
  align-items: center;
  gap: 16px;
}
.greed__badge {
  height: 58px;
  animation: badge-pulse 2.4s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(0, 233, 100, 0)); }
  50% { filter: drop-shadow(0 0 14px rgba(0, 233, 100, 0.6)); }
}
.greed__cards {
  display: flex;
  gap: 28px;
  width: 100%;
  max-width: 1184px;
}
.greed__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  padding: 24px;
  background-image: linear-gradient(var(--overlay-blue), var(--overlay-blue)), var(--card-bg);
  background-size: cover;
  background-position: center;
  transition: transform 0.3s var(--ease);
}
.greed__card:hover { transform: translateY(-4px); }
/* Occasional glint: a screen-blended copy of the art with crushed shadows,
   so only bright pixels (eyes, window lights) flare up */
.greed__card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
  filter: contrast(2.6) brightness(1.4) saturate(1.5);
  opacity: 0;
  pointer-events: none;
  animation: glint 9s ease-in-out infinite;
}
.greed__card > * { position: relative; z-index: 1; }
.greed__card--tall::after { animation-delay: 1s; }
.greed__col .greed__card:nth-child(1)::after { animation-delay: 4s; }
.greed__col .greed__card:nth-child(2)::after { animation-delay: 6.5s; }
@keyframes glint {
  0%, 80% { opacity: 0; }
  86% { opacity: 0.65; }
  90% { opacity: 0.2; }
  94%, 100% { opacity: 0; }
}
.greed__card--tall { min-height: 394px; }
.greed__col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}
.greed__col .greed__card { min-height: 185px; }
.greed__list { font-size: 14px; line-height: 24px; }

/* ---------- Tokenomics ---------- */
.tokenomics__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(660px, 100%);
  min-height: 280px;
  padding: 32px;
}
.tokenomics__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tokenomics__list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tokenomics__coin {
  position: absolute;
  right: -27px;
  top: -31px;
  width: 276px;
  height: 260px;
  pointer-events: none;
  animation: coin-float 4s ease-in-out infinite;
}
@keyframes coin-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.tokenomics__overview {
  display: flex;
  justify-content: space-between;
  width: min(660px, 100%);
  gap: 24px;
}
.tokenomics__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 180px;
  text-align: center;
}
.tokenomics__value {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tokenomics__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.tokenomics__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Roadmap ---------- */
.roadmap { align-items: center; gap: 32px; }
.roadmap__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 1184px;
}
.roadmap__title {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.roadmap__disclaimer {
  font-size: 16px;
  line-height: 26px;
  max-width: 720px;
}
.roadmap__scroller { overflow-x: auto; }
.roadmap__track {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 900px;
}
.roadmap__art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.roadmap__phases {
  display: flex;
  gap: 69px;
}
.roadmap__phase {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Animated roadmap layers (SVG is inlined by main.js) */
.roadmap__art #Dino {
  animation: dino-walk 1.1s steps(2) infinite;
  transform-origin: center bottom;
  transform-box: fill-box;
}
@keyframes dino-walk {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.roadmap__art [id="465277 1"] {
  animation: flag-bounce 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}
@keyframes flag-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* Buildings pop in as the section reveals */
.roadmap__art #House, .roadmap__art #Cottage, .roadmap__art #City, .roadmap__art [id="Mini house"] {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.reveal:not(.is-visible) .roadmap__art :is(#House, #Cottage, #City) { transform: scale(0); }
.is-visible .roadmap__art #House { animation: building-pop 0.5s var(--ease) 0.3s backwards; }
.is-visible .roadmap__art #Cottage { animation: building-pop 0.5s var(--ease) 0.5s backwards; }
.is-visible .roadmap__art #City { animation: building-pop 0.5s var(--ease) 0.7s backwards; }
@keyframes building-pop {
  from { transform: scale(0); }
  60% { transform: scale(1.08); }
  to { transform: scale(1); }
}

/* ---------- Team ---------- */
.team { gap: 48px; }
.team__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: min(660px, 100%);
  padding: 0 24px;
  text-align: center;
}
.team__img {
  position: relative;
  width: 183px;
  height: 183px;
  border: 1px solid var(--green);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.team__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team__img:hover {
  transform: scale(1.04);
  box-shadow: 0 0 28px rgba(0, 233, 100, 0.35);
}
.team__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/team-warden.png");
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
  filter: contrast(2.8) brightness(1.3) saturate(1.6);
  opacity: 0;
  pointer-events: none;
  animation: glint 11s ease-in-out 3.5s infinite;
}
.team__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.team__content .btn { margin-top: 36px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--green);
  margin-top: 64px;
}
/* Pixel dither transition from page black into footer green */
.footer__dither {
  height: 96px;
  background:
    linear-gradient(var(--black), var(--black)) 0 12px / 100% 12px no-repeat,
    conic-gradient(var(--black) 90deg, transparent 90deg 180deg, var(--black) 180deg 270deg, transparent 270deg) 0 0 / 24px 24px repeat-x,
    conic-gradient(transparent 90deg, var(--black) 90deg 180deg, transparent 180deg 270deg, var(--black) 270deg) 0 48px / 24px 24px repeat-x,
    conic-gradient(var(--black) 90deg, transparent 90deg 180deg, var(--black) 180deg 270deg, transparent 270deg) 12px 72px / 48px 24px repeat-x;
}
.footer__bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--black);
}
.footer__bar a { display: inline-flex; transition: transform 0.15s var(--ease); }
.footer__bar a:hover { transform: scale(1.15); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger children that are themselves .reveal inside a .reveal-group */
.reveal-group .reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.24s; }
.reveal-group .greed__col .reveal:nth-child(1) { transition-delay: 0.12s; }
.reveal-group .greed__col .reveal:nth-child(2) { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  :root { --pad-page: 64px; }
}

@media (max-width: 900px) {
  .hero { flex-direction: column; }
  .hero__block { width: 100%; min-height: 600px; }
  .what__cards { flex-direction: column; }
  .greed__cards { flex-direction: column; }
  .tokenomics__coin { width: 180px; height: 170px; top: -20px; right: -12px; }
}

@media (max-width: 640px) {
  :root { --pad-page: 16px; }
  .section { padding-top: 64px; padding-bottom: 64px; gap: 40px; }
  .hero__block { padding: 16px; min-height: 600px; }
  .hero__logo-mark { width: 70px; height: 70px; }
  .hero__logo-word { width: 200px; }
  .hero__buttons { flex-direction: column; }
  .hero__buttons .btn { flex: none; }
  .section__sub { font-size: 16px; line-height: 26px; }
  .greed__heading { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .greed__badge { height: 45px; }
  .tokenomics__card { padding: 24px; }
  .tokenomics__coin { width: 140px; height: 132px; right: -4px; }
  .tokenomics__overview { flex-direction: column; align-items: center; gap: 24px; }
  .roadmap__phases { gap: 40px; }
  .team__content .btn { margin-top: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__cursor { display: none; }
}
