/* =========================================================
   Cloudberry Workshop — shared stylesheet
   Palette taken from the logo:
   plum outline, cream cloud, lavender shade, cloudberry orange, leaf green
   ========================================================= */

:root {
  --plum: #2e1238;
  --plum-soft: #4a2a57;
  --lavender: #e4d7ee;
  --lavender-light: #f3edf8;
  --lavender-deep: #c9b3dc;
  --cream: #f6f3ed;
  --white: #fdfcfa;
  --berry: #f5a83c;
  --berry-dark: #e07f22;
  --berry-light: #ffd28a;
  --leaf: #6aae45;
  --leaf-dark: #3f7a26;

  --radius: 22px;
  --border: 4px solid var(--plum);
  --shadow: 6px 6px 0 var(--plum);
  --shadow-sm: 4px 4px 0 var(--plum);
  --maxw: 1160px;

  --font-display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--plum);
  background:
    radial-gradient(circle at 12% 8%, var(--white) 0 140px, transparent 141px),
    radial-gradient(circle at 88% 30%, var(--lavender-light) 0 220px, transparent 221px),
    linear-gradient(180deg, var(--lavender) 0%, var(--lavender-light) 55%, var(--cream) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--plum-soft);
  margin-bottom: .8rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { height: 68px; width: auto; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 3px solid transparent;
  transition: background .2s, border-color .2s, transform .2s;
}

.nav-links a:hover {
  background: var(--lavender);
  border-color: var(--plum);
}

.nav-links a.active {
  background: var(--berry);
  border-color: var(--plum);
  box-shadow: 3px 3px 0 var(--plum);
}

.nav-toggle {
  display: none;
  background: var(--berry);
  border: var(--border);
  border-radius: 14px;
  width: 50px;
  height: 46px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--plum);
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--plum);
  margin: 4px auto;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--cream);
    border-bottom: var(--border);
    padding: 12px 20px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 16px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--plum);
  background: var(--berry);
  border: var(--border);
  border-radius: 999px;
  padding: 12px 26px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--plum);
  background: var(--berry-light);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--plum);
}

.btn-ghost { background: var(--white); }
.btn-ghost:hover { background: var(--lavender); }
.btn-leaf { background: var(--leaf); }
.btn-leaf:hover { background: #8fcb6a; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Sections ---------- */

main { flex: 1; }

.section { padding: 80px 0; }
.section-tight { padding: 50px 0; }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.section-head p { font-size: 1.15rem; color: var(--plum-soft); }

/* ---------- Hero (home) ---------- */

.hero { padding: 70px 0 90px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: center;
}

.hero h1 span { color: var(--berry-dark); }

.hero-lead {
  font-size: 1.25rem;
  color: var(--plum-soft);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.hero-logo {
  background: var(--white);
  border: var(--border);
  border-radius: 40px;
  box-shadow: 10px 10px 0 var(--plum);
  padding: 30px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero .btn-row { justify-content: center; }
  .hero-logo { max-width: 440px; margin: 0 auto; }
}

/* ---------- Page hero (subpages) ---------- */

.page-hero {
  padding: 70px 0 40px;
  text-align: center;
}

.page-hero p {
  font-size: 1.2rem;
  color: var(--plum-soft);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */

.grid {
  display: grid;
  gap: 28px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--plum);
}

.card p { color: var(--plum-soft); }
.card .btn { margin-top: auto; align-self: flex-start; }

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: var(--border);
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  margin-bottom: 18px;
  background: var(--lavender);
}

.card-icon.berry { background: var(--berry); }
.card-icon.leaf { background: var(--leaf); }

/* Project card with cover art */
.project {
  padding: 0;
  overflow: hidden;
}

.project-cover {
  aspect-ratio: 16 / 9;
  border-bottom: var(--border);
  display: grid;
  place-items: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.project-cover::after {
  content: "";
  position: absolute;
  width: 60%;
  height: 40%;
  top: 10%;
  left: 8%;
  background: rgba(255, 255, 255, .35);
  border-radius: 50%;
  filter: blur(6px);
}

.cover-lavender { background: linear-gradient(135deg, var(--lavender-deep), var(--lavender)); }
.cover-berry { background: linear-gradient(135deg, var(--berry-dark), var(--berry-light)); }
.cover-leaf { background: linear-gradient(135deg, var(--leaf-dark), #a6d98a); }
.cover-plum { background: linear-gradient(135deg, var(--plum), var(--plum-soft)); }

.project-body {
  padding: 24px 26px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2px solid var(--plum);
  background: var(--lavender-light);
}

.tag.status { background: var(--leaf); }
.tag.soon { background: var(--berry-light); }

/* ---------- Feature strip ---------- */

.strip {
  background: var(--plum);
  color: var(--cream);
  border-top: var(--border);
  border-bottom: var(--border);
}

.strip h2, .strip h3 { color: var(--white); }
.strip p { color: var(--lavender); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--berry);
  line-height: 1;
  margin-bottom: 6px;
}

/* ---------- Split (text + visual) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}

.blob {
  background: var(--white);
  border: var(--border);
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  box-shadow: 10px 10px 0 var(--plum);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 14%;
}

/* ---------- Values / team ---------- */

.team-card { text-align: center; align-items: center; }

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: var(--border);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.role {
  font-weight: 700;
  color: var(--berry-dark);
  margin-bottom: .6em;
}

/* ---------- Contact form ---------- */

.form {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--plum);
  background: var(--cream);
  border: 3px solid var(--plum);
  border-radius: 14px;
  padding: 12px 16px;
  transition: box-shadow .15s, background .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--berry);
}

textarea { min-height: 160px; resize: vertical; }

.form-note {
  display: none;
  padding: 14px 18px;
  border: 3px solid var(--plum);
  border-radius: 14px;
  background: var(--leaf);
  font-weight: 700;
}

.form-note.show { display: block; }
.form-error { background: var(--berry-light); }
.btn:disabled { opacity: .6; cursor: wait; }

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.contact-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-list .card-icon {
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  border-radius: 14px;
  margin: 0;
  flex-shrink: 0;
}

.contact-list strong { display: block; }

/* ---------- Social ---------- */

.social-card {
  text-decoration: none;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}

.social-card .card-icon { margin: 0; flex-shrink: 0; }
.social-card h3 { margin-bottom: .2em; }
.social-card p { margin: 0; }

.social-card .arrow {
  margin-left: auto;
  font-size: 1.6rem;
  transition: transform .2s;
}

.social-card:hover .arrow { transform: translateX(6px); }

.social-icon svg { width: 30px; height: 30px; fill: var(--plum); }

/* ---------- CTA ---------- */

.cta {
  background: var(--berry);
  border: var(--border);
  border-radius: 34px;
  box-shadow: 10px 10px 0 var(--plum);
  padding: 50px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before,
.cta::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
}

.cta::before { width: 220px; height: 220px; top: -90px; left: -60px; }
.cta::after { width: 160px; height: 160px; bottom: -70px; right: -30px; }

.cta > * { position: relative; z-index: 1; }
.cta p { font-size: 1.15rem; max-width: 560px; margin: 0 auto 1.6rem; }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--plum);
  color: var(--lavender);
  padding: 50px 0 30px;
  margin-top: 40px;
  border-top: var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand img {
  height: 90px;
  width: auto;
  background: var(--cream);
  border-radius: 18px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.site-footer h4 {
  color: var(--berry);
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--cream); text-decoration: none; }
.site-footer a:hover { color: var(--berry); }

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 2px solid var(--plum-soft);
  font-size: .9rem;
  text-align: center;
  color: var(--lavender-deep);
}

/* ---------- Embedded game ---------- */

.game-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #17172b; /* the game's own background colour */
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--plum);
  overflow: hidden;
}

.game-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.game-frame:fullscreen { border: 0; border-radius: 0; box-shadow: none; }

.game-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--cream);
  background:
    radial-gradient(circle at 50% 40%, rgba(245, 168, 60, .35), transparent 60%),
    linear-gradient(160deg, var(--plum-soft), #17172b);
}

.game-cover[hidden] { display: none; }

.game-cover img {
  height: 46%;
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, .45));
  transition: transform .2s;
}

.game-cover:hover img { transform: translateY(-6px) rotate(-2deg); }
.game-cover .btn { font-size: 1.2rem; }
.game-cover small { opacity: .8; font-size: .9rem; }

.game-actions { justify-content: center; margin-top: 26px; }

.controls { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--plum-soft); }

kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: 1px 7px;
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
  color: var(--plum);
  background: var(--lavender-light);
  border: 2px solid var(--plum);
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--plum);
}

/* Pixel-art cover picture on project cards */
.project-cover.has-art img {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  height: 88%;
  width: auto;
  max-width: none;
  z-index: 1;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(46, 18, 56, .35));
}

/* Wide featured project card (picture left, text right) */
.project-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-feature .project-cover {
  aspect-ratio: auto;
  min-height: 340px;
  border-bottom: 0;
  border-right: var(--border);
}

.project-feature .project-body { justify-content: center; padding: 36px 40px; }
.project-feature h3 { font-size: 1.8rem; }

@media (max-width: 760px) {
  .project-feature { grid-template-columns: 1fr; }
  .project-feature .project-cover { min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: var(--border); }
  .project-feature .project-body { padding: 24px 26px 28px; }
  .project-feature h3 { font-size: 1.35rem; }
}

.more-soon {
  text-align: center;
  margin-top: 36px;
  font-weight: 700;
  color: var(--plum-soft);
}

/* ---------- Work in progress (Software page) ---------- */

.wip {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 50px 40px 0;
  text-align: center;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .9) 0 70px, transparent 71px),
    linear-gradient(180deg, var(--white) 0%, var(--lavender-light) 100%);
  border: var(--border);
  border-radius: 40px;
  box-shadow: 10px 10px 0 var(--plum);
  overflow: hidden;
}

.wip h2 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: .4em; }

.wip > p {
  font-size: 1.15rem;
  color: var(--plum-soft);
  max-width: 520px;
  margin: 0 auto 1.6rem;
}

.wip-badge {
  display: inline-block;
  font-weight: 800;
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 16px;
  margin-bottom: 18px;
  background: var(--berry-light);
  border: 3px solid var(--plum);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--plum);
  transform: rotate(-3deg);
}

/* Striped "ripening" progress bar */
.ripen { max-width: 340px; margin: 0 auto; }
.ripen small { display: block; margin-top: 8px; font-weight: 700; color: var(--plum-soft); }

.ripen-bar {
  height: 22px;
  background: var(--white);
  border: 3px solid var(--plum);
  border-radius: 999px;
  overflow: hidden;
}

.ripen-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-right: 3px solid var(--plum);
  background: repeating-linear-gradient(-45deg, var(--berry) 0 12px, var(--berry-light) 12px 24px);
  background-size: 34px 34px;
  animation: stripes 1.2s linear infinite;
  transition: width 2.4s cubic-bezier(.2, .8, .2, 1) .4s;
}

.wip.visible .ripen-bar span { width: 62%; }

@keyframes stripes { to { background-position: 34px 0; } }

/* Berries dropped in a little pile at the bottom */
.berry-pile {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 34px -40px 0;
  padding: 0 20px 22px;
  min-height: 170px;
}

/* soft lavender "ground" the berries land on */
.berry-pile::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  background: var(--lavender);
  border-top: 3px solid var(--lavender-deep);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.berry {
  position: relative;
  width: var(--s);
  height: calc(var(--s) * 1.2);
  margin: 0 -8px;
  overflow: visible;
  transform: rotate(var(--r));
  filter: drop-shadow(3px 4px 0 rgba(46, 18, 56, .25));
  opacity: 0;
  transition: transform .25s;
}

.wip.visible .berry {
  animation: berryDrop 1.1s cubic-bezier(.3, .1, .3, 1) var(--d) both;
}

.berry:hover { animation: none !important; opacity: 1; transform: rotate(calc(var(--r) * -1)) translateY(-8px) scale(1.06); }

@keyframes berryDrop {
  0%   { opacity: 0; transform: translateY(-340px) rotate(calc(var(--r) - 40deg)); }
  10%  { opacity: 1; }
  55%  { transform: translateY(0) rotate(var(--r)) scale(1.06, .9); }
  70%  { transform: translateY(-26px) rotate(calc(var(--r) + 6deg)); }
  85%  { transform: translateY(0) rotate(var(--r)) scale(1.03, .96); }
  93%  { transform: translateY(-6px) rotate(var(--r)); }
  100% { opacity: 1; transform: translateY(0) rotate(var(--r)); }
}

@media (max-width: 600px) {
  .wip { padding: 40px 22px 0; border-radius: 30px; }
  .berry-pile { margin: 28px -22px 0; min-height: 120px; }
  .berry { width: calc(var(--s) * .62); height: calc(var(--s) * .74); margin: 0 -5px; }
}

@media (prefers-reduced-motion: reduce) {
  .wip .berry { animation: none !important; opacity: 1; }
  .ripen-bar span { animation: none; transition: none; }
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Photo inside the round avatar */
.avatar-photo {
  width: 150px;
  height: 150px;
  overflow: hidden;
  background: #1c1410; /* matches the dark slats behind the photo */
  position: relative;
}

/* Zoomed out so the whole head and some chest fit in the circle */
.avatar-photo img {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 112%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
}
