@layer base, layout, components, utilities;

@layer base {
  :root {
    /* Base Colors (OKLCH) - Light Mode */
    --primary: oklch(60% 0.15 250); /* Fresh Blue */
    --primary-glow: oklch(65% 0.2 250 / 0.4);
    --secondary: oklch(45% 0.1 240);
    --background: oklch(98% 0.01 250);
    --surface: oklch(100% 0 0);
    --text-main: oklch(20% 0.02 250);
    --text-muted: oklch(50% 0.02 250);
    --border: oklch(92% 0.01 250);
    --glass-bg: rgba(255, 255, 255, 0.7);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px oklch(0% 0 0 / 0.05);
    --shadow-md: 0 10px 20px oklch(0% 0 0 / 0.08);
    --shadow-lg: 0 20px 40px oklch(0% 0 0 / 0.12);
    --glow: 0 0 15px var(--primary-glow);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Transition */
    --transition-fast: 0.2s ease;
    --transition-base: 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  }

  [data-theme="dark"] {
    --background: oklch(18% 0.02 250);
    --surface: oklch(22% 0.02 250);
    --text-main: oklch(98% 0.01 250);
    --text-muted: oklch(75% 0.01 250);
    --border: oklch(30% 0.02 250);
    --primary-glow: oklch(60% 0.15 250 / 0.2);
    --glass-bg: rgba(30, 35, 45, 0.7);
    --shadow-md: 0 10px 30px oklch(0% 0 0 / 0.3);
    --shadow-lg: 0 20px 50px oklch(0% 0 0 / 0.5);
  }

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

  body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color var(--transition-base), color var(--transition-base);
  }

  /* Premium Noise Texture */
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
  }

  h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
  }

  ul {
    list-style: none;
  }
}

@layer layout {
  .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
  }

  section {
    padding: var(--space-lg) 0;
  }

  .about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-lg);
    align-items: start;
  }

  .greeting-box {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .greeting-box h3 {
    color: var(--primary);
    margin-bottom: var(--space-sm);
    font-size: 1.4rem;
  }

  .greeting-box p {
    margin-bottom: var(--space-sm);
    color: var(--text-main);
    font-size: 1.05rem;
    word-break: keep-all;
  }

  .signature {
    margin-top: var(--space-md);
    text-align: right;
    font-size: 1.1rem;
    color: var(--text-main);
  }

  .area-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 32px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .area-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
  }

  .area-card .description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }

  .area-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }

  .area-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
  }

  @media (max-width: 968px) {
    .about-grid {
      grid-template-columns: 1fr;
      gap: var(--space-md);
    }
  }
}

@layer components {
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    font-size: 1rem;
  }

  .btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow), var(--shadow-lg);
  }

  .glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
}
