/* ========= Root & Base ========= */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

:root {
  --bg-main: #050608;
  --text-main: #f9fafb;
  --text-muted: #e5e7eb;
  --text-soft: #9ca3af;
  --accent: #cc5500;          /* burnt orange */
  --accent-soft: rgba(204, 85, 0, 0.16);
  --header-height: 50px;
  --container-width: 1200px;
}

body {
  font-family: "TH Sarabun New", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-main);
  padding-top: var(--header-height);
}

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

/* Sections */
.section {
  padding: 4.7rem 0;
}

/* ========= Header ========= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: rgba(5, 6, 8, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);

  transition: box-shadow 180ms ease, background-color 180ms ease;
}

/* subtle glow/gradient only after scroll */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.45),
    rgba(15, 23, 42, 0)
  );
}

.site-header.header--with-glow::after {
  opacity: 1;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 0;
}

/* ========= Logo ========= */

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 1.35rem;
}

.logo-main {
  font-weight: 700;
}

.logo-animated {
  font-style: italic;
}

.logo-animated-word {
  display: inline-block;
  opacity: 1;
  transition: opacity 260ms ease;
}

/* ========= Navigation ========= */

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.05rem;
  position: relative;
  padding-bottom: 2px;
  transition: color 150ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background-color: var(--accent);
  transition: width 150ms ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link--active::after {
  width: 100%;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.25rem 0.55rem;
  color: var(--text-main);
  font-size: 1.1rem;
}

/* When nav is open on mobile */
.site-header.nav-open .main-nav {
  display: flex;
}

/* ========= Hero Section ========= */

.hero-text {
  width: 100%;
  text-align: center;
  margin-bottom: 5rem; /* add spacing ABOVE the chevron */
}

.hero-section {
  min-height: calc(65vh - var(--header-height));
  display: flex;
  align-items: center;
  padding-top: 8rem;
  padding-bottom: 5.5rem;
}

.hero-inner {
  position: relative;
  width: 100%;
}

.hero-heading {
  margin: 0;
  text-align: center;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  line-height: 1.3;
  font-weight: 500;
  padding-top: 300px;
}

/* Scroll-down chevron */
.scroll-down-btn {
  position: absolute;
  left: 50%;
  bottom: 1.8rem;
  transform: translateX(-50%);
  border: none;
  background: none;
  color: var(--text-main);
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: transform 150ms ease, opacity 150ms ease;
}

.scroll-down-btn:hover {
  transform: translateX(-50%) translateY(2px);
  color: var(--accent);
}

.scroll-down-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========= About Section ========= */

.about-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.about-intro {
  max-width: 52rem;
  margin: 0 auto;          
  text-align: left;        
}

.about-heading {
  font-size: 2.4rem;
  margin: 0 0 0.35rem;
  margin-left: -0.5rem;
}

.about-text {
  margin: 0;
  max-width: 52rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.about-card {
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 1.5rem 1.4rem 1.25rem;
  background: rgba(15, 23, 42, 0.45);

  display: flex;              
  flex-direction: column;
}

.about-card-title {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.about-card p {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}

.about-card-footer {
  margin-top: auto;           
  text-align: right;          
}

/* ========= Blog Preview Section ========= */

.blog-preview-section {
}

.blog-preview-inner {
  max-width: 52rem;
}

.blog-preview-heading {
  font-size: 2.1rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.blog-preview-text {
  margin-top: 0;
  margin-bottom: 0.9rem;
}

/* ========= Mission & Philosophy ========= */

.mission-inner {
  max-width: 54rem;
  text-align: center;
}

.mission-heading {
  font-size: 2.4rem;
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.mission-subtitle {
  margin: 0 0 1.4rem;
}

.mission-text {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

/* ========= Contact Section ========= */

.contact-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.contact-heading {
  font-size: 2.2rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.contact-text {
  margin: 0;
  max-width: 26rem;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

/* Icon "badges" in social platform colors */
.contact-icon {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

/* Simple approximations of platform colors */
.email-icon {
  background: #6b21a8;           /* purple-ish for ProtonMail */
}

.linkedin-icon {
  background: #0a66c2;
}

.github-icon {
  background: #111827;
  border: 1px solid #e5e7eb;
}

.x-icon {
  background: #000000;
  border: 1px solid #e5e7eb;
}

.contact-link {
  color: var(--text-main);
  text-decoration: none;
  font-style: italic;
  transition: color 150ms ease;
}

.contact-link:hover {
  color: var(--accent);
}

/* ========= Text Buttons ========= */

.text-button {
  font-style: italic;
  font-family: "TH Sarabun New", ui-monospace, SFMono-Regular, Menlo, Monaco,
    "Courier New", monospace;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--text-main);
  transition: color 150ms ease, transform 150ms ease, text-shadow 150ms ease;
}

.text-button:hover {
  color: var(--accent);
  transform: translateY(-1px);
  text-shadow: 0 0 8px var(--accent-soft);
}

/* ========= Blog Page ========= */

.blog-main-section {
  padding-top: 4.5rem;
}

.blog-main-inner {
  max-width: 52rem;
}

.blog-main-heading {
  font-size: 2.6rem;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.blog-main-intro {
  margin-top: 0;
  margin-bottom: 1.4rem;
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.blog-post {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.5rem;
  padding: 1.4rem 1.6rem 1.3rem;
  background: rgba(15, 23, 42, 0.6);
}

.blog-post-meta {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  font-style: italic;
}

.blog-post-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.blog-post-excerpt {
  margin: 0 0 0.9rem;
}

.blog-post-footer {
  margin: 0;
  text-align: right;
}

/* ========= Responsive ========= */

@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  body {
    padding-top: var(--header-height);
  }

  .main-nav {
    position: absolute;
    top: 100%;
    right: 0;
    padding: 0.75rem 1.2rem;
    background: rgba(5, 6, 8, 0.98);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 9rem;
    display: none;
    border-bottom-left-radius: 0.75rem;
    border-left: 1px solid rgba(148, 163, 184, 0.35);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-inner {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero-heading {
    font-size: clamp(2rem, 6vw + 1rem, 3rem);
  }
}
