:root {
  /* Palette from ribdigihouse.com and the Ribdigi House logo */
  --brand: #7fa347;
  --brand-dark: #658338;
  --brand-ink: #577330; /* brand green dark enough for small text on light backgrounds */
  --brand-light: #c6d9a8;
  --forest: #003024;
  --forest-deep: #001a14;
  --deep: #13612e;
  --ink: #10211b;
  --muted: #4d5d56;
  --line: #d7e0d8;
  --mist: #f3f6f1;
  --sand: #f7f4ec;
  --card: #ffffff;

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-card: 0 18px 40px -28px rgb(0 48 36 / 0.45);
  --shadow-lift: 0 28px 50px -28px rgb(0 48 36 / 0.42);

  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  background: var(--forest-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--forest-deep);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: color-mix(in srgb, var(--brand) 35%, white);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 80;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-ink);
}

.eyebrow--invert {
  color: var(--brand-light);
}

/* Missing details */
.is-placeholder {
  font-style: italic;
  font-weight: 500 !important;
  color: var(--muted) !important;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--forest-deep);
  color: #fff;
}

.page .hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.hero__glow,
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__glow {
  background:
    radial-gradient(circle at 18% 18%, rgb(127 163 71 / 0.3), transparent 38%),
    radial-gradient(circle at 85% 8%, rgb(19 97 46 / 0.45), transparent 34%),
    radial-gradient(circle at 70% 85%, rgb(127 163 71 / 0.14), transparent 40%);
  animation: glow-shift 12s ease-in-out infinite;
}

.hero__grid {
  opacity: 0.7;
  background-image:
    linear-gradient(to right, rgb(127 163 71 / 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(127 163 71 / 0.09) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
}

.hero__edge {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgb(127 163 71 / 0.5), transparent);
}

.hero__inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 28px;
  padding-top: max(20px, env(safe-area-inset-top));
}

.page .hero__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.hero__top {
  display: flex;
  justify-content: center;
  padding: 6px 0 4px;
}

.hero__logo {
  display: block;
  width: 168px;
  height: auto; /* keeps the logo's original proportions */
}

/* ---------- Profile ---------- */

.profile {
  padding: 28px 0 24px;
  text-align: center;
}

.page .profile {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 12px 0 16px;
}

.portrait {
  --portrait-size: clamp(148px, min(70vw, 36dvh, calc(100dvh - 420px)), 268px);
  position: relative;
  width: var(--portrait-size);
  height: var(--portrait-size);
  margin: 0 auto 18px;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-light), var(--deep), var(--brand));
  box-shadow:
    0 0 0 8px rgb(127 163 71 / 0.1),
    0 24px 48px -16px rgb(0 0 0 / 0.65);
}

.portrait__clip {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--forest-deep);
  background: var(--forest);
  box-sizing: border-box;
}

.portrait__img,
.portrait__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.portrait__img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  object-fit: cover;
  object-position: 50% 30%;
}

.portrait__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(160deg, var(--forest), #0b2b20);
  color: var(--brand-light);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.portrait__placeholder .icon {
  width: clamp(28px, 8vw, 40px);
  height: clamp(28px, 8vw, 40px);
  color: var(--brand);
}

.profile .eyebrow {
  margin-bottom: 10px;
}

.profile__name {
  margin: 0;
  font-size: clamp(1.75rem, 7.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.profile__title {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: rgb(255 255 255 / 0.75);
  overflow-wrap: anywhere;
}

.hero .is-placeholder {
  color: rgb(255 255 255 / 0.6) !important;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--primary {
  width: 100%;
  min-height: 58px;
  font-size: 1.05rem;
  background: var(--brand);
  color: var(--forest-deep);
  box-shadow: 0 14px 30px -14px rgb(127 163 71 / 0.8);
}

.btn--primary:hover {
  background: #8fb556;
}

.btn--forest {
  background: var(--forest);
  color: #fff;
}

.btn--forest:hover {
  background: var(--forest-deep);
  box-shadow: 0 12px 24px -12px rgb(0 48 36 / 0.55);
}

.btn--outline {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn--outline:hover {
  color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.actions__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.btn--tile {
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn--tile .icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
  transition: color 0.3s ease;
}

.btn--tile:hover {
  background: rgb(255 255 255 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(127 163 71 / 0.6);
}

.btn--tile[aria-expanded="true"] {
  background: var(--brand);
  color: var(--forest-deep);
}

.btn--tile[aria-expanded="true"] .icon {
  color: var(--forest-deep);
}

/* Buttons whose detail has not been added yet */
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  transform: none;
}

.btn--tile[aria-disabled="true"] {
  background: rgb(255 255 255 / 0.04);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
  color: rgb(255 255 255 / 0.6);
}

.btn--tile[aria-disabled="true"] .icon {
  color: rgb(255 255 255 / 0.4);
}

.btn--tile[aria-disabled="true"]::after {
  content: "Not added yet";
  font-size: 0.68rem;
  font-weight: 500;
  color: rgb(255 255 255 / 0.55);
}

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

.social-panel {
  margin-top: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}

.social-panel .eyebrow {
  margin-bottom: 12px;
}

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

.social-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.social-list a:hover {
  background: rgb(255 255 255 / 0.18);
}

.social-list .icon {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.social-list .is-placeholder {
  color: rgb(255 255 255 / 0.6) !important;
}

/* ---------- Content cards ---------- */

.content {
  display: grid;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 0;
  background: var(--mist);
}

.page .content {
  max-width: none;
  padding: 20px 16px 48px;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.page .content > * {
  max-width: 480px;
  width: 100%;
  margin-inline: auto;
}

.panel {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.details {
  margin: 0;
}

.details__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 2px 0;
}

.details__row + .details__row {
  border-top: 1px solid var(--line);
}

.details__row dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.details__row dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: break-word;
  min-width: 0;
}

.details__row a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  color: var(--forest);
  text-decoration: none;
  background-image: linear-gradient(var(--brand), var(--brand));
  background-size: 0% 2px;
  background-position: 0 calc(100% - 8px);
  background-repeat: no-repeat;
  transition: background-size 0.3s ease, color 0.3s ease;
}

.details__row a:hover {
  color: var(--deep);
  background-size: 100% 2px;
}

.details__row a.is-placeholder {
  pointer-events: none;
}

.about__text {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--muted);
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--mist);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.service:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.service__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--forest-deep);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgb(127 163 71 / 0.25);
}

/* ---------- QR ---------- */

.panel--qr {
  text-align: center;
}

.qr__code {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.qr__code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr__placeholder {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
}

.qr__caption {
  margin: 12px 0 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.qr__buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.qr__buttons .btn {
  padding-inline: 14px;
}

.footer {
  padding: 12px 8px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

/* ---------- Team page ---------- */

.team__intro {
  padding-bottom: 36px;
  text-align: center;
}

.team__intro .eyebrow {
  margin: 32px 0 10px;
}

.team__title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.team__lead {
  max-width: 34ch;
  margin: 12px auto 0;
  color: rgb(255 255 255 / 0.75);
}

.team__notice {
  display: inline-block;
  margin: 18px 0 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  box-shadow: inset 0 0 0 1px rgb(127 163 71 / 0.35);
  color: var(--brand-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.team__list {
  display: grid;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 16px;
  list-style: none;
}

.team__list,
.team .footer {
  background: var(--mist);
}

.team__empty {
  padding: 20px;
  text-align: center;
}

.member {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 14px 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.member:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.member__avatar {
  display: block;
  flex: none;
  overflow: hidden;
  width: 60px;
  height: 60px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-light), var(--deep), var(--brand));
}

.member__avatar img,
.member__initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--card);
  object-fit: cover;
  background: var(--forest-deep);
  color: var(--brand-light);
  font-weight: 700;
  font-size: 1.05rem;
}

.member__text {
  flex: 1;
  min-width: 0;
}

.member__name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.member__title {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--muted);
}

.member > .icon {
  color: var(--brand-ink);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--forest-deep);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.6), inset 0 0 0 1px rgb(127 163 71 / 0.35);
  transform: translate(-50%, 160%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- Small phones ---------- */

@media (max-width: 350px) {
  .details__row {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 8px;
  }
  .services,
  .qr__buttons {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tablet ---------- */

@media (min-width: 600px) {
  body {
    background: var(--mist);
  }
  .portrait {
    --portrait-size: 180px;
  }
  .hero {
    max-width: 560px;
    margin: 24px auto 0;
    border-radius: var(--radius-xl);
  }
  .page .hero {
    min-height: 0;
  }
  .hero__inner,
  .page .hero__inner {
    padding: 28px 32px 32px;
  }
  .content,
  .page .content,
  .team__list {
    max-width: 560px;
    padding-inline: 0;
    background: transparent;
  }
  .page .content > * {
    max-width: none;
  }
  .panel {
    padding: 28px;
  }
}

/* ---------- Desktop: profile on the left, details on the right ---------- */

@media (min-width: 980px) {
  .page {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px;
  }
  .page .hero {
    position: sticky;
    top: 32px;
    max-width: none;
    margin: 0;
    min-height: 0;
  }
  .page .hero__inner {
    padding: 32px;
  }
  .team .hero {
    max-width: 960px;
    margin-top: 40px;
  }
  .team__list {
    max-width: 960px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content {
    max-width: none;
    padding: 0;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr);
    align-items: stretch;
  }
  .content > .panel:nth-child(2),
  .content > .panel:nth-child(3),
  .content > .footer {
    grid-column: 1 / -1;
  }
  .content > .panel:nth-child(1) {
    order: 1;
  }
  .content > .panel:nth-child(2) {
    order: 0;
  }
  .content > .panel:nth-child(3) {
    order: 2;
  }
  .content > .panel:nth-child(4) {
    order: 1;
  }
  .content > .footer {
    order: 3;
    text-align: left;
    padding-top: 4px;
  }
  .services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .panel--qr {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .qr__code {
    width: 200px;
    height: 200px;
  }
  .qr__buttons {
    width: 100%;
    grid-template-columns: 1fr;
  }
}

@keyframes glow-shift {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .btn:hover,
  .service:hover {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
  }
  .actions,
  .qr__buttons,
  .toast,
  .skip-link {
    display: none !important;
  }
}
