/* ===
   Modern Minimalist Stylesheet
   Inspired by Notion, shadcn/ui, and Untitled UI
   === */

/* --- 1. Root & Variables --- */
:root {
  /* Fonts */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* Colors (Cool Gray Palette) */
  --color-bg: #ffffff;
  --color-text: #111827; /* Gray 900 */
  --color-muted: #6b7280; /* Gray 500 */
  --color-border: #e5e7eb; /* Gray 200 */
  --color-accent: #3b82f6; /* Blue 500 */
  --color-code-bg: #f9fafb; /* Gray 50 */
  --color-table-header: #f9fafb; /* Gray 50 */

  /* Sizing & Spacing */
  --max-width: 720px;
  --border-radius: 0.5rem;
  --line-height: 1.65;
}

/* --- 2. Global Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height);
  margin: 0;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* --- 3. Layout --- */
main {
  width: 100%;
  max-width: var(--max-width);
}

/* --- 4. Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2.25em;
  margin-bottom: 0.75em;
}

h1 {
  font-size: 2.5rem; /* 40px */
}
h2 {
  font-size: 1.875rem; /* 30px */
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
}
h3 {
  font-size: 1.5rem; /* 24px */
}
h4 {
  font-size: 1.25rem; /* 20px */
}
h5 {
  font-size: 1rem; /* 16px */
  font-weight: 500;
  color: var(--color-muted);
}
h6 {
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-top: 0;
  margin-bottom: 1.25em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
a:hover {
  border-bottom-color: var(--color-accent);
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* --- 5. Lists --- */
ul,
ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

li {
  margin-bottom: 0.5em;
}

/* --- 6. Block Elements --- */
blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1em;
  border-left: 4px solid var(--color-border);
  color: var(--color-muted);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5em 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 1.5em 0;
}

/* --- 7. Code Blocks --- */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  border: 1px solid var(--color-border);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1em;
  overflow-x: auto;
  margin-bottom: 1.25em;
}

pre code {
  background-color: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

/* --- 8. Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25em;
  font-size: 0.95em;
}

th,
td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

th {
  font-weight: 600;
  background-color: var(--color-table-header);
}

/* --- 9. Forms & Buttons --- */
form {
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  display: block;
  width: 100%;
  padding: 0.75em;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); /* Blue 500 w/ 20% opacity */
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
input[type="submit"] {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75em 1.25em;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  border: 1px solid transparent;
}

/* Primary Button */
button.primary,
input[type="submit"] {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
button.primary:hover,
input[type="submit"]:hover {
  opacity: 0.8;
}

/* Secondary Button */
button.secondary {
  background-color: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}
button.secondary:hover {
  background-color: var(--color-code-bg);
}

/* --- 10. Other Elements --- */
details {
  background-color: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: 1.25em;
}

summary {
  font-weight: 500;
  padding: 0.75em 1em;
  cursor: pointer;
}

details[open] > summary {
  border-bottom: 1px solid var(--color-border);
}

details > p {
  padding: 0 1em 0.5em 1em;
  margin-top: 1em;
  color: var(--color-muted);
}