/* ===========================
   Fonts & Variables
=========================== */

:root {
  --bg: #0a0a0a;
  --surface: #101010;
  --text: #f5f5f5;
  --muted: #888;
  --border: #242424;
}

body.light {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111;
  --muted: #666;
  --border: #dddddd;
}

/* ===========================
   Reset
=========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);

  font-family: "Inter", sans-serif;

  transition: 0.35s;

  position: relative;

  overflow-x: hidden;
}

/* ===========================
   Grid Background
=========================== */

.grid {
  position: fixed;

  inset: 0;

  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);

  background-size: 80px 80px;

  opacity: 0.35;

  pointer-events: none;

  z-index: -1;
}

/* ===========================
   Navbar
=========================== */

header {
  position: sticky;

  top: 0;

  z-index: 100;

  backdrop-filter: blur(14px);

  background: rgba(10, 10, 10, 0.75);

  border-bottom: 1px solid var(--border);
}

body.light header {
  background: rgba(255, 255, 255, 0.75);
}

nav {
  width: min(900px, 92%);

  margin: auto;

  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 24px 0;
}

.logo {
  text-decoration: none;

  color: var(--text);

  font-size: 18px;

  letter-spacing: 6px;

  font-weight: 600;
}

.nav-links {
  display: flex;

  align-items: center;

  gap: 32px;
}

.nav-links a {
  color: var(--muted);

  text-decoration: none;

  transition: 0.25s;
}

.nav-links a:hover {
  color: var(--text);
}

.active {
  color: var(--text) !important;
}

/* ===========================
   Theme Button
=========================== */

#theme-toggle {
  border: none;

  background: none;

  color: var(--text);

  cursor: pointer;

  font-size: 18px;

  transition: 0.25s;
}

#theme-toggle:hover {
  transform: rotate(20deg);
}

/* ===========================
   Layout
=========================== */

main {
  width: min(760px, 92%);

  margin: auto;
}

.section {
  padding: 110px 0;

  border-top: 1px solid var(--border);
}

/* ===========================
   Hero
=========================== */

.hero {
  padding: 150px 0;
}

.hero-top {
  color: var(--muted);

  letter-spacing: 5px;

  font-size: 0.75rem;

  margin-bottom: 30px;
}

.hero h1 {
  font-family: "Cormorant Garamond", serif;

  font-size: 6rem;

  font-weight: 700;

  line-height: 0.9;
}

.hero h2 {
  margin-top: 20px;

  font-family: "Cormorant Garamond", serif;

  font-size: 3rem;

  font-weight: 500;

  line-height: 1.05;
}

.hero-text {
  margin-top: 35px;

  max-width: 520px;

  color: var(--muted);

  line-height: 1.9;

  font-size: 17px;
}

/* ===========================
   Section Titles
=========================== */

.section h3 {
  font-size: 0.8rem;

  letter-spacing: 4px;

  color: var(--muted);

  text-transform: uppercase;

  margin-bottom: 20px;
}

.section-text {
  color: var(--muted);

  margin-bottom: 50px;
}
/* ===========================
   Projects
=========================== */

.project {
  margin-bottom: 70px;
}

.project img {
  width: 100%;

  display: block;

  aspect-ratio: 16/9;

  object-fit: cover;

  background: var(--surface);

  border: 1px solid var(--border);

  transition: 0.35s ease;
}

.project:hover img {
  transform: translateY(-4px);

  border-color: var(--text);
}

.project h4 {
  margin-top: 28px;

  font-family: "Cormorant Garamond", serif;

  font-size: 2.4rem;

  font-weight: 600;
}

.project p {
  margin-top: 14px;

  color: var(--muted);

  line-height: 1.8;

  max-width: 620px;
}

.project span {
  display: block;

  margin-top: 16px;

  color: var(--muted);

  font-size: 0.9rem;

  letter-spacing: 0.5px;
}

.divider {
  width: 100%;

  height: 1px;

  background: var(--border);

  margin: 70px 0;
}

/* ===========================
   Skills
=========================== */

.skills {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 18px 40px;
}

.skills span {
  color: var(--text);

  padding-bottom: 12px;

  border-bottom: 1px solid var(--border);

  transition: 0.25s;
}

.skills span:hover {
  padding-left: 10px;
}

/* ===========================
   Socials
=========================== */

.socials {
  display: flex;

  flex-direction: column;

  gap: 22px;
}

.socials a {
  text-decoration: none;

  color: var(--muted);

  font-size: 1rem;

  transition: 0.25s;
}

.socials a:hover {
  color: var(--text);

  padding-left: 10px;
}

/* ===========================
   Footer
=========================== */

footer {
  width: min(760px, 92%);

  margin: auto;

  padding: 80px 0;

  border-top: 1px solid var(--border);
}

footer p {
  color: var(--muted);

  font-size: 0.9rem;
}

/* ===========================
   Scrollbar
=========================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ===========================
   Selection
=========================== */

::selection {
  background: var(--text);

  color: var(--bg);
}

/* ===========================
   Animations
=========================== */

.hero,
.section {
  animation: fadeUp 0.8s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;

    transform: translateY(20px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* ===========================
   Responsive
=========================== */

@media (max-width: 768px) {
  .hero {
    padding: 100px 0;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero h2 {
    font-size: 2.3rem;
  }

  .project h4 {
    font-size: 2rem;
  }

  .skills {
    grid-template-columns: 1fr;
  }

  nav {
    flex-direction: column;

    gap: 18px;
  }

  .nav-links {
    gap: 20px;
  }

  footer {
    padding: 60px 0;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 3.2rem;
  }

  .hero h2 {
    font-size: 1.9rem;
  }

  .project h4 {
    font-size: 1.7rem;
  }

  .hero-text {
    font-size: 15px;
  }

  .section {
    padding: 80px 0;
  }
}
/* ===========================
   Scroll Animations
=========================== */

.hidden {
  opacity: 0;

  transform: translateY(40px);

  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.show {
  opacity: 1;

  transform: translateY(0);
}

/* ===========================
   Link Underline
=========================== */

.nav-links a,
.socials a {
  position: relative;
}

.nav-links a::after,
.socials a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -4px;

  width: 0;

  height: 1px;

  background: currentColor;

  transition: 0.3s;
}

.nav-links a:hover::after,
.socials a:hover::after {
  width: 100%;
}

/* ===========================
   Smooth Image Zoom
=========================== */

.project {
  overflow: hidden;
}

.project img {
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.project:hover img {
  transform: scale(1.015);
}

/* ===========================
   Better Theme Transition
=========================== */

body,
header,
.project img,
.divider {
  transition:
    background 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

#posts-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-link {
  display: block;

  text-decoration: none;

  color: inherit;
}

.post img {
  width: 100%;

  aspect-ratio: 16/9;

  object-fit: cover;

  margin-bottom: 25px;

  border: 1px solid var(--border);

  transition: 0.35s;
}

.post:hover img {
  transform: translateY(-5px);
}

.post h2 {
  font-family: "Cormorant Garamond", serif;

  font-size: 2.3rem;

  margin-bottom: 15px;

  transition: 0.3s;
}

.post:hover h2 {
  padding-left: 10px;
}

.post p {
  color: var(--muted);

  line-height: 1.8;

  margin-bottom: 20px;
}

.post-meta {
  display: flex;

  justify-content: space-between;

  margin-bottom: 20px;

  font-size: 0.85rem;

  color: var(--muted);
}

/* ===========================
ADMIN
=========================== */

.admin {
  width: min(720px, 92%);

  margin: auto;

  padding: 120px 0;
}

.admin h1 {
  font-family: "Cormorant Garamond", serif;

  font-size: 4rem;

  margin-bottom: 60px;
}

.admin label {
  display: block;

  margin-bottom: 12px;

  margin-top: 30px;

  color: var(--muted);

  font-size: 0.9rem;

  letter-spacing: 2px;

  text-transform: uppercase;
}

.admin input,
.admin textarea {
  width: 100%;

  padding: 18px;

  background: transparent;

  border: 1px solid var(--border);

  color: var(--text);

  font-family: Inter, sans-serif;

  font-size: 16px;

  outline: none;

  transition: 0.3s;
}

.admin input:focus,
.admin textarea:focus {
  border-color: var(--text);
}

.admin textarea {
  resize: vertical;

  min-height: 300px;
}

.publish {
  margin-top: 40px;

  padding: 18px 40px;

  background: var(--text);

  color: var(--bg);

  border: none;

  cursor: pointer;

  font-size: 15px;

  transition: 0.3s;
}

.publish:hover {
  opacity: 0.85;
}

#status {
  margin-top: 25px;

  color: var(--muted);
}

/* ==========================
ADMIN
========================== */

.admin {
  width: min(760px, 92%);
  margin: auto;
  padding: 120px 0;
}

.admin h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 4rem;
  margin-bottom: 40px;
}

.admin label {
  display: block;
  margin: 25px 0 10px;

  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.admin input,
.admin textarea {
  width: 100%;

  padding: 18px;

  background: none;

  border: 1px solid var(--border);

  color: var(--text);

  font-family: Inter, sans-serif;

  font-size: 16px;

  outline: none;

  transition: 0.3s;
}

.admin input:focus,
.admin textarea:focus {
  border-color: var(--text);
}

.admin textarea {
  resize: vertical;
  min-height: 250px;
}

.publish {
  margin-top: 35px;

  padding: 16px 40px;

  background: var(--text);

  color: var(--bg);

  border: none;

  cursor: pointer;

  font-size: 15px;

  transition: 0.3s;
}

.publish:hover {
  opacity: 0.85;
}

.logout {
  background: none;

  border: 1px solid var(--border);

  padding: 12px 24px;

  color: var(--text);

  cursor: pointer;
}

.editor-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 40px;
}

#status,
#login-status {
  margin-top: 20px;

  color: var(--muted);
}

/* ==========================
ARTICLE
========================== */

.article {
  width: min(760px, 92%);

  margin: auto;

  padding: 120px 0;
}

.article h1 {
  font-family: "Cormorant Garamond", serif;

  font-size: 4.5rem;

  margin-bottom: 20px;

  line-height: 1;
}

.article-date {
  color: var(--muted);

  margin-bottom: 40px;
}

.article-cover {
  width: 100%;

  border: 1px solid var(--border);

  margin-bottom: 50px;
}

.article-content {
  font-size: 18px;

  line-height: 2;

  color: var(--text);

  white-space: pre-wrap;
}

.article-content h2 {
  margin-top: 50px;

  margin-bottom: 20px;
}

.article-content img {
  max-width: 100%;
}

.article-content p {
  margin-bottom: 25px;
}
