:root{
  --brand: #dbb544;
  --brand-ink: #2c260f;
  --bg: #ffffff;
  --fg: #101010;
  --muted: #666666;
  --line: #e8e8e8;
  --rad: 14px;
  --maxw: 1120px;

  /* Animation variables */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  background: var(--bg); color: var(--fg); line-height: 1.55;
}

/* Layout */
.container{ width:100%; max-width: var(--maxw); margin:0 auto; padding: 0 16px; }
.section{ padding: 5px 0; }

/* Header */
.header{
  position: sticky; top:0; z-index: 50;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header .container{
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; padding: 12px 0;
}
.nav__brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
.nav__logo{
  width:36px; height:36px; border-radius:10px; background: var(--brand);
  display:inline-block; flex-shrink: 0;
  background-image: url('media/logo-tfm.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 85% 85%;
}
.nav__title{ font-weight: 700; letter-spacing: 0.2px; }

/* Menu */
.menu{ display:flex; align-items:center; gap:18px; }
.menu a{
  text-decoration:none; color:inherit; font-weight:500;
}
.menu a:hover{ text-decoration: underline; }

/* CTA */
.btn{
  display:inline-block; padding:10px 16px; border-radius: 10px;
  font-weight:600; text-decoration:none; border:1px solid var(--fg);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.btn::before{
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}
.btn:hover::before{ left: 100%; }
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active{ transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn--brand{
  background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
}

/* Hero */
.hero{
  position: relative; overflow: clip; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% -10%, rgba(219,181,68,0.25), transparent 60%),
    linear-gradient(to bottom, rgba(219,181,68,0.06), transparent 35%);
}
.hero__grid{
  display:grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items:center;
  padding: 28px 0 28px;
}
.hero h1{ font-size: clamp(28px, 4.5vw, 42px); line-height:1.15; margin:0 0 10px; }
.hero p{ color: var(--muted); margin: 0 0 14px; }

/* Cardy */
.cards{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.card{
  border:1px solid var(--line); border-radius: var(--rad); padding:16px;
  background:#fff;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.card h3{ margin:0 0 8px; font-size:18px; }
.card p{ margin:0; color: var(--muted); }

/* Projects */
.projects{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.project{
  border:1px solid var(--line); border-radius: var(--rad); overflow:hidden; background: #fff;
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.project:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}
.project img{
  display:block; width:100%; height:160px; object-fit: cover;
  transition: transform var(--transition-normal);
}

.project_body{ padding: 12px 14px; }
.project_body h4{ margin:0 0 6px; font-size: 16px; }
.project_body p{ margin:0; color: var(--muted); }
/* subtle circular icon button with hover label */
.project_more{
  --size: 28px;
  display:inline-flex; align-items:center; justify-content:center;
  width: var(--size); height: var(--size);
  border-radius: 999px;
  text-decoration:none; color:inherit; font-weight:600;
  border:1px solid var(--line); background:#fff;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.project_more::before{
  content:""; width:6px; height:6px; border-right:2px solid currentColor;
  border-bottom:2px solid currentColor; transform: rotate(-45deg);
  transition: transform var(--transition-fast);
}
.project_more::after{
  content: attr(aria-label);
  position:absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%);
  background:#fff; border:1px solid var(--line); border-radius:8px; padding:4px 8px; color:inherit; white-space:nowrap; font-size:12px;
  opacity:0; pointer-events:none; transition: opacity var(--transition-fast);
  box-shadow: var(--shadow-md);
}
.project_more:hover{
  background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}
.project_more:hover::before{ transform: rotate(-45deg) scale(1.2); }
.project_more:hover::after{ opacity:1; }

/* Footer */
.footer{
  border-top:1px solid var(--line); color:#222; background:#fafafa;
}
.footer__grid{
  display:grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px;
}
.made{ margin-top: 16px; text-align:center; color: var(--muted); font-size: 14px; }
.made img{ width:64px; height:64px; vertical-align: middle; margin-left:6px; }

/* Language switch */
.lang{ display:flex; align-items:center; gap:8px; position: relative; }
.lang a,
.lang__summary{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; border-radius:9px; border:1px solid var(--line);
  text-decoration:none; color:inherit; font-weight:600;
  transition: all var(--transition-fast);
  position: relative; background:#fff; cursor: pointer;
}
.lang a:hover,
.lang__summary:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.lang a[aria-current="true"],
.lang__summary[aria-current="true"]{
  background: var(--brand); color: var(--brand-ink); border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}
/* caret for summary */
.lang__summary::after{
  content:""; width:6px; height:6px; margin-left:6px;
  border-right:2px solid currentColor; border-bottom:2px solid currentColor;
  transform: rotate(45deg); transition: transform var(--transition-fast);
}
.lang__cb{ position:absolute; opacity:0; pointer-events:none; }
.lang__list{
  position:absolute; right:0; top: calc(100% + 6px);
  background:#fff; border:1px solid var(--line); border-radius:10px;
  box-shadow: var(--shadow-md); padding:4px; z-index: 100;
  width: max-content; min-width: 0;
  display:none;
}
.lang__list a{ display:block; padding:6px 8px; border-radius:8px; }
.lang__list a[aria-current="true"]{ background: var(--brand); color: var(--brand-ink); }
.lang__list a:hover{ background:#f5f5f5; }
/* toggle open */
.lang__cb:checked + .lang__summary::after{ transform: rotate(-135deg); }
.lang__cb:checked + .lang__summary + .lang__list{ display:block; }

/* Donation methods */
.donation-methods{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 24px 0;
}
.donation-method{
  border: 1px solid var(--line); border-radius: var(--rad); padding: 20px;
  background: #fff; transition: all var(--transition-fast);
}
.donation-method:hover{
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: var(--brand);
}
.donation-method h3{
  margin: 0 0 8px; font-size: 18px; color: var(--fg);
}
.donation-method p{
  margin: 0 0 16px; font-size: 14px; color: var(--muted);
  line-height: 1.4;
}
.donation-buttons{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.btn--wallet{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 10px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink);
  transition: all var(--transition-fast); font-size: 14px;
  min-height: 40px; white-space: nowrap;
}
.btn--wallet:hover{
  transform: translateY(-1px); box-shadow: var(--shadow-md);
  background: var(--brand-ink); color: var(--brand);
}
.btn--secondary{
  background: var(--brand); color: var(--brand-ink);
  border-color: var(--brand);
}
.btn--secondary:hover{
  background: var(--brand-ink); color: var(--brand);
}
.wallet-address{
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.address-text{
  flex: 1; background: #f8f8f8; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; font-family: monospace;
  font-size: 14px; color: var(--fg); word-break: break-all;
  cursor: pointer; user-select: all; transition: all var(--transition-fast);
}
.address-text:hover{
  background: #f0f0f0; border-color: var(--brand);
}
.donation-note{
  margin: 8px 0 0; font-size: 14px; color: var(--muted);
}
.donation-info{
  margin-top: 24px; text-align: center;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Loading animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeInUp 0.6s ease-out;
}

/* Responsive */
@media (max-width: 920px){
  .hero__grid{ grid-template-columns: 1fr; }
  .cards, .projects{ grid-template-columns: 1fr 1fr; }
  .footer__grid{ grid-template-columns: 1fr; }
  .donation-methods{ grid-template-columns: 1fr; }
  .donation-buttons{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .menu{ display:none; }
  .cards, .projects{ grid-template-columns: 1fr; }
  .hero .container{ padding-left: 20px; padding-right: 20px; }
  .header .container{ padding-left: calc(20px + env(safe-area-inset-left)); padding-right: calc(20px + env(safe-area-inset-right)); }
  .hero__grid{ padding: 20px 0 16px; gap: 16px; }
  .donation-methods{ grid-template-columns: 1fr; gap: 16px; }
  .donation-buttons{ grid-template-columns: 1fr; }
  .wallet-address{ flex-direction: column; gap: 8px; }
  .address-text{ font-size: 12px; padding: 10px; }
  .btn--wallet{ padding: 12px 16px; font-size: 16px; }
  /* Show single control on narrow screens */
  .lang > a{ display:none; }
  .lang__summary{ display:inline-flex; margin-left:auto; font-size: 14px; padding:4px 8px; }
  .lang__list a{ font-size: 14px; }
}

/* Custom amount forms */
.donation-custom{
  margin-top: 10px; display:flex; gap: 8px; align-items: center;
}
.donation-custom input[type="number"]{
  width: 110px; padding:8px 10px; border:1px solid var(--line); border-radius:8px;
  font-size:14px; background:#fff; transition: border-color var(--transition-fast);
}
.donation-custom input[type="number"]:focus{ border-color: var(--brand); outline:none; }
.donation-custom button{
  padding:8px 10px; border-radius:8px; font-weight:600; border:1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); cursor:pointer; transition: all var(--transition-fast);
}
.donation-custom button:hover{ transform: translateY(-1px); box-shadow: var(--shadow-sm); background: var(--brand-ink); color: var(--brand); }
.donation-custom small{ color: var(--muted); }
