/* EnkelPendel — Minimal CSS */

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2563eb;
  --border: #e5e5e5;
  --code-bg: #f4f4f4;
  --max-width: 680px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --text: #e5e5e5;
    --text-muted: #999;
    --accent: #60a5fa;
    --border: #333;
    --code-bg: #1a1a1a;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  line-height: 1.6;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input, select, textarea, code, pre, kbd, samp {
  font-family: inherit;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  padding: 1rem 1.5rem;
  z-index: 100;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    #006AA7 20%,
    #FECC00 50%,
    #006AA7 80%,
    transparent
  );
  background-size: 200% 100%;
  animation: glow-slide 3s linear infinite;
  box-shadow: 0 0 10px #006AA7, 0 0 20px #FECC00;
}

@keyframes glow-slide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

header nav {
  max-width: var(--max-width);
  margin: 0 auto;
}

.container {
  padding-top: 5rem;
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  transition: transform 0.2s, opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.logo:active {
  transform: scale(0.95);
}

/* Stabilized pendulum mark */
.logo-pendulum {
  display: block;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(0, 106, 167, 0.1);
  border: 1px solid rgba(0, 106, 167, 0.3);
}

.nav-links a:hover {
  color: #FECC00;
  background: rgba(0, 106, 167, 0.2);
  box-shadow: 0 0 10px rgba(0, 106, 167, 0.5), 0 0 20px rgba(254, 204, 0, 0.3);
  border-color: #006AA7;
}

.nav-links a.active {
  color: #FECC00;
  background: rgba(0, 106, 167, 0.3);
  box-shadow: 0 0 8px rgba(0, 106, 167, 0.4), 0 0 15px rgba(254, 204, 0, 0.2);
  border-color: #FECC00;
}

.nav-links a:active {
  transform: scale(0.95);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-text {
  display: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-btn {
  font-size: 1.4rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: 6px;
  background: rgba(0, 106, 167, 0.1);
  border: 1px solid rgba(0, 106, 167, 0.3);
}

.lang-btn:hover {
  transform: scale(1.1);
  text-decoration: none;
  box-shadow: 0 0 10px rgba(0, 106, 167, 0.5), 0 0 15px rgba(254, 204, 0, 0.3);
  border-color: #006AA7;
}

.lang-btn:active {
  transform: scale(0.9);
}

.lang-btn.active {
  opacity: 0.5;
  font-size: 1rem;
  filter: grayscale(30%);
  background: transparent;
  border-color: transparent;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* The same company mark is used in both languages. */
.hero-logo {
  display: block;
  width: auto;
  height: 120px;
  margin: 0 auto 1.5rem;
}

/* Content */
main {
  min-height: 60vh;
}

.intro {
  margin-bottom: 3rem;
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

code {
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Posts */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.post-list time {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 50px;
}

/* Under construction stamp */
.under-construction-stamp {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(1.75rem, 6vw, 3.5rem);
  letter-spacing: 0.08em;
  color: #d92626;
  border: 0.35em double #d92626;
  padding: 0.4em 0.7em;
  transform: rotate(-6deg);
  text-transform: uppercase;
  margin: 1rem 0 2rem;
  opacity: 0.85;
}

/* Projects */
.project-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--text-muted);
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Article */
article.single {
  margin-bottom: 3rem;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.tagline {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .logo .site-title {
    display: none;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
  }

  .lang-btn {
    font-size: 1.2rem;
  }

  .lang-btn.active {
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* Original vector lettering: no font dependency. */
.site-title svg {
  display: block;
  width: 150px;
  height: auto;
}
.hero .company-wordmark {
  width: min(100%, 390px);
  margin: 0 auto 0.75rem;
  line-height: 0;
}
.company-wordmark svg {
  display: block;
  width: 100%;
  height: auto;
}

/* The homepage demonstrates the method; the company mark stays stabilized. */
.hero-pendulum-arm {
  transform-origin: 64px 30px;
  animation: hero-pendulum-swing 2.5s ease-in-out infinite;
}
.lang-en .hero-pendulum-pivot { fill: #012169; }
.lang-en .hero-pendulum-bob { fill: #C8102E; }
@keyframes hero-pendulum-swing {
  0%, 100% { transform: rotate(-20deg); }
  50% { transform: rotate(20deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-pendulum-arm { animation: none; }
}

/* Circular portraits on the People page. */
/* Square portrait, vignetted into the page (same mask as rebase.nu's author
   portrait) so the photo has no hard edge. */
.person-portrait {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  border-radius: 0;
  object-fit: cover;
  margin: 1.5rem 0 1rem;
}
@supports (mask-composite: intersect) or (-webkit-mask-composite: source-in) {
  .person-portrait {
    -webkit-mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 50%, transparent 100%), linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: radial-gradient(ellipse 64% 64% at 50% 50%, #000 50%, transparent 100%), linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
    mask-composite: intersect;
  }
}
.person-portrait + h2 { margin-top: 0; }

/* Keep the full navigation usable on narrow phones. */
@media (max-width: 400px) {
  header { padding: 0.75rem 0.5rem; }
  header nav { gap: 0.5rem; align-items: flex-start; }
  .nav-right { flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem; }
  .nav-links { gap: 0.25rem; }
  .container { padding-top: 8rem; }
}

/* Comparison articles need room for the drawing grid. */
.container-wide { max-width: 1280px; }

/* Blog excerpts and optional cover thumbnails. */
.blog-list { list-style: none; padding: 0; margin: 2rem 0; }
.blog-list > li { padding: 1.5rem 0; border-top: 1px solid var(--border); }
.post-preview.has-image { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1.25rem; }
.post-preview-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.post-preview-copy time { font-size: 0.85rem; color: var(--text-muted); }
.post-preview-copy h2 { margin: 0.35rem 0 0.65rem; font-size: 1.35rem; }
.post-preview-copy p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-preview-more { font-size: 0.9rem; }
@media (max-width: 480px) {
  .post-preview.has-image { grid-template-columns: 90px minmax(0, 1fr); gap: 0.75rem; }
}

/* Public project introductions */
.project-showcase {
  display: grid;
  gap: 1.25rem;
}
.project-intro {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--code-bg);
}
.project-intro-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  min-height: 64px;
}
.project-intro-heading h2 {
  margin: 0;
  font-size: 1.65rem;
}
.project-intro-heading h2 a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
.project-intro-heading h2 a::after {
  content: " ↗";
  font-size: 0.7em;
  color: var(--accent, #2563eb);
}
.project-icon {
  flex: none;
  object-fit: contain;
  border-radius: 12px;
}
.project-children {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.project-children li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  min-height: 46px;
}
.project-children img { object-fit: contain; }
.project-intro .project-status {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: .8rem;
  letter-spacing: .03em;
}
