@font-face {
  font-family: "NotoSans";
  src: url("fonts/sans_serif/noto/noto.ttf") format("truetype");
}

@font-face {
  font-family: "NotoSerif";
  src: url("fonts/serif/NotoSerif.ttf") format("truetype");
}

@font-face {
  font-family: "NotoMono";
  src: url("fonts/serif/NotoMono.ttf") format("truetype");
}

@font-face {
  font-family: "DM";
  src: url("fonts/DM.ttf") format("truetype");
}

:root {
  --bg: #ffffff;
  --muted: #e0e4e6;
  --text: #222222;
  --subtext: #444444;
  --border: #d6d6d6;
  --accent: #333333;
  --max-width: 1100px;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  --page-gutter: clamp(1rem, 3vw, 1.5rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "NotoSans", sans-serif;
  line-height: 1.65;
  transition: opacity 140ms ease;
}

body.i18n-fade-out {
  opacity: 0.15;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 0 0 1rem;
  color: var(--subtext);
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  text-align: justify;
}

.container {
  width: 100%;
  max-width: calc(var(--max-width) + (2 * var(--page-gutter)));
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.btn.is-active-lang {
  border-color: rgba(161, 2, 2, 0.55);
  box-shadow: 0 0 0 3px rgba(161, 2, 2, 0.1);
  background: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

.btn[aria-pressed="true"] {
  display: none;
}

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: var(--accent);
  color: #d6d6d6;
  font-family: "DM", sans-serif;
  backdrop-filter: blur(10px);
}

.topnav .inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.topnav .icons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topnav .icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 999px;
}

.topnav .icons a:hover {
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.separator {
  padding: 0 6px;
  opacity: 0.4;
}

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 26px;
  align-items: center;
  padding-top: 34px;
  padding-bottom: 34px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 3.8vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero .meta {
  margin: 0 0 14px;
  color: var(--subtext);
  font-size: 0.98rem;
}

.hero .lead {
  margin-bottom: 18px;
  font-family: "DM", sans-serif;
  font-size: 1.25rem;
  line-height: 1.5;
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 0.75em 1em;
  border-radius: 10px;
  background-color: #ececec;
  color: #353535;
  font-family: "Poppins", sans-serif;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

.btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Sections ---------- */
.section {
  padding: 34px 0;
}

.section h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  text-align: center;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: justify;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;  
}

.card .thumb {
  width: min(220px, 60%);
  margin: 0 auto 12px;
}

.card h3 {
  margin: 0 0 8px;
  text-align: center;
}

.card p {
  margin: 0 0 12px;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
  }



/* ---------- Hyperlinks ---------- */
.container p a,
.container li a,
.rhagymadrodd p a,
.rhagymadrodd li a,
.penllun p a,
.penllun li a {
  color: #124a9c;
  text-decoration: none;
  position: relative;
  z-index: 0;
  transition: color 0.2s ease;
}

.container p a::after,
.container li a::after,
.rhagymadrodd p a::after,
.rhagymadrodd li a::after,
.penllun p a::after,
.penllun li a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.32em;
  background: rgba(70, 130, 220, 0.18);
  border-radius: 0.08em;
  z-index: -1;
  transition:
    height 0.2s ease,
    bottom 0.2s ease,
    background 0.2s ease;
}

/* hover */
.container p a:hover,
.container li a:hover,
.rhagymadrodd p a:hover,
.rhagymadrodd li a:hover,
.penllun p a:hover,
.penllun li a:hover {
  color: #124a9c;
  text-decoration: none;
}

.container p a:hover::after,
.container li a:hover::after,
.rhagymadrodd p a:hover::after,
.rhagymadrodd li a:hover::after,
.penllun p a:hover::after,
.penllun li a:hover::after {
  height: 0.9em;
  bottom: -0.05em;
  background: rgba(70, 130, 220, 0.26);
}

/* ---------- Footer ---------- */
footer {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  color: var(--subtext);
  font-size: 0.95rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --page-gutter: 1rem;
  }

  .topnav .inner {
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .topnav .icons {
    justify-content: center;
  }

  .hero .wrap {
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .hero .lead {
    font-size: 1.05rem;
  }

  .section {
    padding: 24px 0;
  }

  .card {
    text-align: left;
  }
}
