/*
  Global Styles
  -------------
  Variables and default styles for the whole site.
*/
:root {
  --color-accent: #c4d6a4;
  --color-accent-hover: #d4e4b8;
  --color-bg: #1a1d28;
  --color-bg-card: #252836;
  --color-muted: #8a8f9e;
  --color-text: #e4e6eb;
  --color-text-muted: #b0b3bf;
  --color-border: #323544;
  
  /* Typography: Modern, professional font stacks */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-heading: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/*
  Layout
  ------
  Main grid structure for the site.
*/
.site-grid {
  display: grid;
  grid-template-areas:
    "nav"
    "main"
    "footer";
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  min-height: 100vh;
}

.site-nav {
  display: flex;
  grid-area: nav;
  justify-content: center;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
}

nav {
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  padding: 0 2rem;
}

nav > ul {
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.nav-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  background: var(--color-bg);
  border-radius: 8px;
  transition: all 0.15s ease-out;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

nav ul {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  width: auto;
}

nav li {
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  transition: color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

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

.nav-link[aria-current="page"] {
  color: var(--color-accent);
}

.site-main {
  display: grid;
  grid-area: main;
  margin: 0 auto;
}

main {
  max-width: 1200px;
  width: 100%;
  padding: 0;
}

/* Main Content */
.content-body {
  background: var(--color-bg);
  margin: 2rem 6rem;
}

.content-body h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.title-underline {
  animation: drawIn 0.25s ease-out;
  border: none;
  border-top: 3px solid var(--color-accent);
  margin-bottom: 2rem;
  margin-left: 0;
  margin-top: 1rem;
  transform-origin: left;
  width: 5rem;
}

/* Hero Container - Single Page Layout */
.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  padding: 1rem 1rem;
  animation: fadeIn 0.8s ease-out;
}

.hero-content {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero Identity Section */
.hero-identity {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  animation: slideDown 0.6s ease-out;
}

.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--color-accent);
  object-fit: cover;
  flex-shrink: 0;
}

.hero-text {
  flex: 1;
}

.hero-name {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: 1.1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Hero Sections */
.hero-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-section {
  animation: slideUp 0.7s ease-out backwards;
}

.hero-section:nth-child(1) {
  animation-delay: 0.1s;
}

.hero-section:nth-child(2) {
  animation-delay: 0.2s;
}

.hero-section:nth-child(3) {
  animation-delay: 0.3s;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.section-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-accent);
  margin: 0 0 0.75rem 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.4rem;
  flex: 1;
}

.expand-toggle {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.expand-toggle:hover {
  border-color: var(--color-accent);
  background: var(--color-bg);
}

.expand-icon {
  stroke: var(--color-accent);
  transition: transform 0.3s ease;
}

.expand-icon.rotated {
  transform: rotate(180deg);
}

.section-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Expertise Grid */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.expertise-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.expertise-item:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.expertise-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expertise-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-accent);
}

.expertise-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Experience List */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.experience-expandable {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease;
}

.experience-expandable.expanded {
  max-height: 800px;
  opacity: 1;
  margin-top: 0.75rem;
}

.experience-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-card);
  border-left: 3px solid var(--color-border);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.experience-item:hover {
  border-left-color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg-card) 0%, rgba(196, 214, 164, 0.05) 100%);
}

.experience-company {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.experience-detail {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 400;
  line-height: 1.5;
}

.experience-note {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-style: italic;
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

/* Mobile adjustments for expandable */
@media (max-width: 600px) {
  .section-header {
    margin-bottom: 0.875rem;
  }

  .expand-toggle {
    padding: 0.375rem;
  }

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

/* Hero Connect Section */
.hero-connect {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  animation: slideUp 0.8s ease-out backwards;
  animation-delay: 0.4s;
}

.hero-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.hero-link:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  transform: translateY(-3px);
}

.hero-link svg {
  width: 20px;
  height: 20px;
  fill: var(--color-text-muted);
  transition: fill 0.3s ease;
}

.hero-link:hover svg {
  fill: var(--color-bg);
}

.hero-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.hero-cta:hover {
  background: var(--color-accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(196, 214, 164, 0.3);
}

/* Scoped styles for links within the main content */
.content-body a {
  background: linear-gradient(
    to bottom,
    var(--color-accent) 0%,
    var(--color-accent) 100%
  );
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 3px 3px;
  color: var(--color-accent);
  text-decoration: none;
}

.content-body a:hover {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cstyle%3E.squiggle{animation:shift .3s linear infinite;}@keyframes shift{from{transform:translateX(0)}to{transform:translateX(-20px)}}%3C/style%3E%3Cpath fill='none' stroke='%23d74a49' stroke-width='2' class='squiggle' d='M0,3.5 c 5,0,5,-3,10,-3 s 5,3,10,3 c 5,0,5,-3,10,-3 s 5,3,10,3'/%3E%3C/svg%3E");
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: auto 6px;
  text-decoration: none;
}

/* Responsive images in content */
.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 2rem auto;
}

.content-body picture {
  display: block;
  margin: 2rem 0;
}

.notfound {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Post Listing */
.post-listing {
  border-bottom: 1px solid var(--color-accent-hover);
  display: flex;
  margin-bottom: 30px;
  width: 100%;
}

.post-listing a {
  background: none;
  color: var(--color-text-muted);
  text-decoration: none;
}

.post-listing a:hover {
  background: none;
  text-decoration: underline;
}

.post-date {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 5px;
  width: 30%;
}

.post-title {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 600;
  height: 60px;
  margin: 0 auto;
  width: 60%;
}

.intro {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

/* Footer */
.site-footer {
  align-items: center;
  display: grid;
  grid-area: footer;
  justify-content: center;
}

footer {
  color: var(--color-text-muted);
  padding: 1rem 1rem;
  text-align: center;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

footer span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-bg);
  transition: all 0.3s ease;
}

.social-links a:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

.social-links a svg {
  width: 18px;
  height: 18px;
  fill: var(--color-text-muted);
  transition: fill 0.3s ease;
}

.social-links a:hover svg {
  fill: var(--color-bg);
}

/*
  Animations
  ----------
*/
@keyframes drawIn {
  0% {
    opacity: 0;
    transform: translateX(500%) scaleX(5);
  }

  1% {
    opacity: 1;
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
  Responsive
  ----------
*/
@media (max-width: 600px) {
  .site-grid {
    grid-template-rows: auto 1fr auto;
    height: 100vh;
  }

  main {
    width: 100%;
    padding: 0;
  }

  nav {
    padding: 0 1rem;
  }

  nav > ul {
    gap: 0.25rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }

  .content-body {
    margin: 1.5rem 1rem;
    padding: 0.5rem 0.5rem;
  }

  .content-body h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
  }

  .title-underline {
    width: 3rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
  }

  .intro {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
  }

  .post-listing {
    flex-direction: column;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
  }

  .post-date,
  .post-title {
    width: 100%;
    margin: 0.15rem 0;
    font-size: 1.05rem;
    height: auto;
  }

  .poster {
    max-width: 100%;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .notfound {
    padding: 1.5rem 2.5rem;
  }

  footer {
    padding: 2rem 1rem;
  }

  .social-links {
    gap: 1rem;
  }

  /* Hero responsive */
  .hero-container {
    min-height: calc(100vh - 100px);
    padding: 1.5rem 1rem;
  }

  .hero-content {
    gap: 2rem;
  }

  .hero-identity {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-avatar {
    width: 120px;
    height: 120px;
  }

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

  .hero-title {
    font-size: 1.1rem;
  }

  .hero-sections {
    gap: 1.5rem;
  }

  .section-label {
    font-size: 0.8rem;
  }

  .section-text {
    font-size: 1rem;
  }

  .expertise-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .expertise-item {
    padding: 0.875rem;
  }

  .expertise-icon svg {
    width: 20px;
    height: 20px;
  }

  .expertise-text {
    font-size: 0.875rem;
  }

  .experience-list {
    gap: 0.75rem;
  }

  .experience-item {
    padding: 0.875rem 1rem;
  }

  .experience-company {
    font-size: 0.8rem;
  }

  .experience-detail {
    font-size: 0.9rem;
  }

  .experience-note {
    font-size: 0.85rem;
  }

  .hero-connect {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .hero-link {
    width: 44px;
    height: 44px;
  }

  .hero-cta {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }
}
