/* ---------- Colours (light by default, dark via prefers-color-scheme) ---------- */
:root {
  --bg: #fff8f0;
  --surface: #ffffff;
  --text: #2b211c;
  --muted: #65554b;
  --border: #f0dfcf;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --on-accent: #ffffff;
  --blob-1: #ffd9b8;
  --blob-2: #ffe9a8;
  --shadow: 0 1px 2px rgb(80 40 20 / 0.06), 0 8px 24px -12px rgb(80 40 20 / 0.25);

  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1714;
    --surface: #27201c;
    --text: #f6ece4;
    --muted: #c9b8ab;
    --border: #3a2f29;
    --accent: #fb923c;
    --accent-hover: #fdba74;
    --on-accent: #1c1714;
    --blob-1: #4a2a18;
    --blob-2: #3d3215;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.7);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

/* keeps the decorative hero blobs from causing sideways scroll */
.hero-wrap { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Language switching ---------- */
html[lang="en"] body [lang="pt-PT"],
html[lang="pt-PT"] body [lang="en"] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout ---------- */
.hero,
main,
.footer {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 1rem;
  padding-bottom: 2.25rem;
  isolation: isolate;
}

/* soft warm blobs behind the hero */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.8;
}
.hero::before {
  width: 16rem; height: 16rem;
  top: 2rem; right: -4rem;
  background: var(--blob-1);
}
.hero::after {
  width: 12rem; height: 12rem;
  top: 10rem; left: -5rem;
  background: var(--blob-2);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand img { border-radius: 8px; }

.lang-toggle {
  display: none; /* needs JS */
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.js .lang-toggle { display: inline-flex; }

.lang-toggle button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 2.75rem;
  min-height: 2.25rem;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.avatar {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  margin-top: 2.5rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
  font-size: 2.75rem;
  overflow: hidden;
  transform: rotate(-4deg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

h1 {
  margin: 1.25rem 0 0.75rem;
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.4s ease-in-out 0.6s 2;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20%, 40% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

.intro {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

/* ---------- Apps ---------- */
main { padding-bottom: 2rem; }

.section-title {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.apps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-3px); }

.card p { margin: 0; }

.card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* Logos come with their own rounded corners and background: no frame here. */
.app-icon {
  flex: none;
  display: block;
  width: 3.75rem;
  height: 3.75rem;
}
.app-icon img { width: 100%; height: 100%; }

.card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.tag {
  font-size: 0.875rem;
  color: var(--muted);
}

.open,
.soon {
  align-self: flex-start;
  margin-top: auto !important;
}

.open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}
.open:hover { background: var(--accent-hover); }
.open .arrow { transition: transform 0.15s ease; }
.open:hover .arrow { transform: translate(2px, -2px); }

.soon {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 2px dashed var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.footer {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.footer p { margin: 0; }

/* ---------- Bigger screens ---------- */
@media (min-width: 720px) {
  .hero { padding-top: 1.5rem; padding-bottom: 3rem; }
  .hero::before { width: 22rem; height: 22rem; right: 2rem; opacity: 0.6; filter: blur(70px); }
  .apps { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .card { padding: 1.5rem; }
}

@media (min-width: 1100px) {
  .hero, main, .footer { padding-inline: 2rem; }
}

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