/* CSS vars and fallback */
:root {
    --main-color: #4CAF50;
    --secondary-color: orange;
    --border-style: dashed;
    --fallback-color: var(--made-up-color, purple); /* Fallback example */
  }
  
  /* Styles */
  body {
    font-family: 'Roboto', sans-serif; /* Google Font */
    background-color: hsl(210, 40%, 95%);
    color: color(display-p3 0.1 0.2 0.3 / 0.9);
    margin: 0;
    padding: 0;
  }
  
  /* Header */
  header {
    background-color: var(--main-color);
    padding: 20px;
    color: white;
    text-align: center;
  }
  
  /* Nav Style (with RGB + fallback font */
  nav {
    background-color: rgba(100, 100, 255, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  /* section margins and padding */
  section {
    margin-top: 20px;
    margin-right: 10px;
    margin-bottom: 20px;
    margin-left: 10px; /* Longhand */
    padding: 1em 2em 1em 2em; /* Shorthand */
    background-color: #f9f9f9;
  }
  
  /* img and borders */
  img {
    border-style: var(--border-style);
    border-width: 3px;
    border-color: var(--secondary-color);
    border-radius: 12px;
    display: block;
    margin: auto;
    max-width: 100%;
  }
  
  /* jheadings */
  h2 {
    margin-top: 2rem; /* relative unit */
    margin-bottom: 3vw; /* relative unit */
    font-size: 24px; /* absolute unit */
    line-height: 1.5em; /* relative unit */
    color: navy;
  }
  
  /* texts */
  p {
    color: color-mix(in srgb, orange 40%, black);
    text-align: justify;
  }
  
  /* button and link interactions */
  a {
    text-decoration: underline;
  }
  
  a:hover {
    color: red;
  }
  
  button:active {
    background-color: black;
    color: white;
  }
  
  /* form and media */
  #media img {
    height: auto;
    width: 400px;
    max-width: 100%;
    min-width: 250px;
  }
  
  /* positioning */
  footer {
    position: sticky;
    bottom: 0;
    background-color: #ddd;
    padding: 10px;
  }
  
  /* grid layout in form */
  #form form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center;
  }
  
  /* Responsiveness */
  @media screen and (max-width: 600px) {
    header {
      font-size: 0.8rem;
    }
  
    nav {
      flex-direction: column;
    }
  
    #form form {
      grid-template-columns: 1fr;
    }
  }
  
  /* Selectors! */
  .highlight {
    background-color: yellow;
  }
  
  #media {
    padding: 1em;
  }
  
  * {
    box-sizing: border-box;
  }
  
  section p {
    font-style: italic;
  }
  
  section > p {
    color: green;
  }
  
  p + p {
    margin-top: 2rem;
  }
  
  p ~ label {
    font-style: italic;
  }
  
  input[type="text"] {
    border: 1px solid gray;
  }
  
  input.highlight {
    border: 2px solid red;
  }
  
  form:has(textarea) {
    background-color: #ffe;
  }
  
  section:has(img) {
    border: 2px dotted blue;
  }

  
  
